Page 1 of 1

Lua script has been running for more than 10 seconds error

Posted: Wednesday 11 September 2019 9:11
by EddyG
Recently my Internet connection (Ziggo) has the effect of disconnecting a few minutes almost every day.
During that period I get a lot of this error message.
2019-09-11 01:27:17.366 Error: EventSystem: Warning!, lua script /home/pi/domoticz/dzVents/runtime/dzVents.lua has been running for more than 10 seconds
I suppose that some scripts are waiting for this Internet connection and give this message after 10 seconds.
Is there a way to log which script gives this error?
Is there a way to prevent this?
Most of my scripts are asynchronous http, but could it still be that that part is giving the error?

Re: Lua script has been running for more than 10 seconds error

Posted: Wednesday 11 September 2019 11:52
by waaren
EddyG wrote: Wednesday 11 September 2019 9:11 Recently my Internet connection (Ziggo) has the effect of disconnecting a few minutes almost every day.
During that period I get a lot of this error message.

Code: Select all

2019-09-11 01:27:17.366 Error: EventSystem: Warning!, lua script /home/pi/domoticz/dzVents/runtime/dzVents.lua has been running for more than 10 seconds
I suppose that some scripts are waiting for this Internet connection and give this message after 10 seconds.
Is there a way to log which script gives this error?
The event system is single threaded so it sounds logical that the last script started before you see this message is the culprit. If you set dzVents logging to the level that you will see the start and stop of the scripts, you might be able to see whodunnit.
is there a way to prevent this?
if you enter

Code: Select all

sudo  grep -wirn curl <domoticz dir>/scripts
at the CLI you will see all lines in your scripts using curl. If possible; rewrite them to use openURL() or send them to the background by adding ' &' to the command.
Most of my scripts are asynchronous http, but could it still be that that part is giving the error?
the openURL() method is handled within milliseconds so not likely that this will be the cause of this message.

Re: Lua script has been running for more than 10 seconds error

Posted: Saturday 28 September 2019 14:47
by EddyG
So, it took a some time, but I checked and rewrote to openURL() where necessary all my scripts.
There is only 1 script left where I call Telegram via os.execute with curl.
That one is only used with my doorbell.
I checked doorbell times and error times. I can conclude that that script is not the cause of the 10 sec. timeout.
I had Ziggo change my Internet modem, so let's wait if the problem is gone.
Still wondering if there is an easy way for finding out which script causes the 10 sec. timeout.

Re: Lua script has been running for more than 10 seconds error

Posted: Saturday 28 September 2019 19:13
by waaren
Did you set the dzVents loglevel in settings at the level that shows which scripts were started or when that's not working set it to debug.
Maybe if you share the logfile containing the message ?

Verstuurd vanaf mijn ONEPLUS A6003 met Tapatalk


Re: Lua script has been running for more than 10 seconds error  [Solved]

Posted: Wednesday 16 October 2019 8:40
by EddyG
Now, some weeks later, I do not have any of these errors anymore.
What changed was by Ziggo modem got replaced by a newer one and the errors are gone.
So the culprit was probably the Ziggo modem.