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

Easy to use, 100% Lua-based event scripting framework.

Moderator: leecollings

Post Reply
EddyG
Posts: 1042
Joined: Monday 02 November 2015 5:54
Target OS: -
Domoticz version:

Lua script has been running for more than 10 seconds error

Post 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?
User avatar
waaren
Posts: 6028
Joined: Tuesday 03 January 2017 14:18
Target OS: Linux
Domoticz version: Beta
Location: Netherlands
Contact:

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

Post 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.
Debian buster, bullseye on RPI-4, Intel NUC.
dz Beta, Z-Wave, RFLink, RFXtrx433e, P1, Youless, Hue, Yeelight, Xiaomi, MQTT
==>> dzVents wiki
EddyG
Posts: 1042
Joined: Monday 02 November 2015 5:54
Target OS: -
Domoticz version:

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

Post 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.
User avatar
waaren
Posts: 6028
Joined: Tuesday 03 January 2017 14:18
Target OS: Linux
Domoticz version: Beta
Location: Netherlands
Contact:

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

Post 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

Debian buster, bullseye on RPI-4, Intel NUC.
dz Beta, Z-Wave, RFLink, RFXtrx433e, P1, Youless, Hue, Yeelight, Xiaomi, MQTT
==>> dzVents wiki
EddyG
Posts: 1042
Joined: Monday 02 November 2015 5:54
Target OS: -
Domoticz version:

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

Post 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.
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest