The Vera Community forums have moved!

Advanced => Plugins & Plugin Development => Programming => EventWatcher Events & Logs Plugin => Topic started by: paros on November 16, 2016, 07:29:53 am

Title: EventWatcher[834] : Startup Lua Failed"
Post by: paros on November 16, 2016, 07:29:53 am
First I tried to install the version that is available in Vera App Store, but I got an error "EventWatcher[834] : Startup Lua Failed""
Then I installed the version that is available in the Alternate UI App Store (version 16.7.6) but it give me the same error.

What should I do to get it working?
The only information that is available in Eventwather (under Control) is the following (everything else is empty):
- Last Reboot
- Last Luup Restart
If I try to go open "Variable and Event log" it give the following error: No handler (http://my_IP/port_3480/data_request?id=lr_ALTUI_Handler&command=home&#)
Title: Re: EventWatcher[834] : Startup Lua Failed"
Post by: akbooer on November 16, 2016, 08:07:53 am
A copy of the log whilst Vera is starting up should show some useful diagnostics.
Title: Re: EventWatcher[834] : Startup Lua Failed"
Post by: paros on November 16, 2016, 08:24:29 am
My primary idea with getting Eventwatcher is to see what is in the logs :)
Can you please tell me how to get what logs that you think can help to understand this issue?
Title: Re: EventWatcher[834] : Startup Lua Failed"
Post by: akbooer on November 16, 2016, 08:40:02 am
My primary idea with getting Eventwatcher is to see what is in the logs :)

EventWatcher doesn't do that... it creates its own logs.

Quote
Can you please tell me how to get what logs that you think can help to understand this issue?

The easiest way is to open a browser to
Code: [Select]
http://VeraIP/cgi-bin/cmh/log.sh?Device=LuaUPnP

and watch whilst Vera starts up after a reload.  After it settles down (maybe some time - the output is buffered) then copy the whole of the page contents (much of it scrolled off screen.)
Title: Re: EventWatcher[834] : Startup Lua Failed"
Post by: paros on November 16, 2016, 08:55:19 am
Is it safe to publish the logs officially?
Title: Re: EventWatcher[834] : Startup Lua Failed"
Post by: akbooer on November 16, 2016, 09:13:54 am
Depends whether you have any plugins or lock etc. with sensitive info.  Otherwise, everything is behind you firewall.  PM the log to me if that helps.
Title: Re: EventWatcher[834] : Startup Lua Failed"
Post by: paros on November 16, 2016, 11:05:56 am
PM send.
Title: Re: EventWatcher[834] : Startup Lua Failed"
Post by: akbooer on November 16, 2016, 11:48:32 am
Indeed the logs show an error:
Code: [Select]
50 11/16/16 14:58:18.987 luup_log:838: EventWatcher: defining CLI... <0x772cb520>
50 11/16/16 14:58:18.997 luup_log:838: EventWatcher: Starting Event service... <0x772cb520>
50 11/16/16 14:58:18.998 luup_log:838: EventWatcher: Server listening on port 443 <0x772cb520>
10 11/16/16 14:58:18.998 AlarmManager::AddRelativeAlarm current time 1479304698 delay 10 type 7 <0x772cb520>
10 11/16/16 14:58:18.999 AlarmManager::AddAbsoluteAlarm alarm 0x1928f98 entry 0x1ede370 id 0 type 7 param=0x198d380 entry->when: 1479304708 time: 1479304698 bCancelFirst 0=0 <0x772cb520>
50 11/16/16 14:58:18.999 luup_log:838: EventWatcher: Starting Watch service... <0x772cb520>
01 11/16/16 14:58:19.000 LuaInterface::CallFunction_Startup-1 device 838 function init failed [string "local ABOUT = {..."]:1156: attempt to index local 'c' (a nil value) <0x772cb520>
01 11/16/16 14:58:19.000 LuImplementation::StartLua running startup code for 838 I_EventWatcher.xml failed <0x772cb520>

The good news is that I understand that the condition that it reports would generate an error, the bad news is I simply cannot understand how that might happen.  I've loaded the same version from GitHub onto both an openLuup development machine and one of my VeraLite machines and they both work perfectly.

There is, I suppose, the remote possibility of a download error.  Can I ask that you re-install from the AltAppStore and try again?
Title: Re: EventWatcher[834] : Startup Lua Failed"
Post by: paros on November 16, 2016, 12:18:06 pm
First I installed the version located in the Vera App Store (same problem), then I have installed the version in Alternate App Store 8 times. Same problem, have tried to reboot.
Any other idea?
Title: Re: EventWatcher[834] : Startup Lua Failed"
Post by: akbooer on November 16, 2016, 01:07:35 pm
I have updated the version on the AltAppStore to the very latest (it's what I run.) it's v16.11.16.

Please try again from the AltAppStore.
Title: Re: EventWatcher[834] : Startup Lua Failed"
Post by: paros on November 16, 2016, 01:37:20 pm
Same problem...

Should I try a manual installation with WinSCP?
In this case, where do I find the latest files and where should i put them?

I used the files from github and put them all in cmh-ludl folder.
Tried again but still the same problem.
Title: Re: EventWatcher[834] : Startup Lua Failed"
Post by: paros on November 16, 2016, 02:49:20 pm
I noticed this in the log file: /etc/cmh/persist:

/etc/cmh/wan_failover:
-rw-r--r--    1 root     root            44 Jul 20  2015 check_internet.hosts
df -h
Filesystem                Size      Used Available Use% Mounted on
rootfs                    8.9M      4.9M      4.0M  55% /
/dev/root                 9.8M      9.8M         0 100% /rom
tmpfs                   124.8M      6.7M    118.1M   5% /tmp
/dev/mtdblock6            8.9M      4.9M      4.0M  55% /overlay
overlayfs:/overlay        8.9M      4.9M      4.0M  55% /
tmpfs                   512.0K         0    512.0K   0% /dev
/dev/mtdblock10          50.0M     10.4M     39.6M  21% /storage
/dev/mtdblock10          50.0M     10.4M     39.6M  21% /etc/cmh-firmware
/dev/mtdblock10          50.0M     10.4M     39.6M  21% /etc/cmh-backup
/dev/mtdblock9            9.0M      9.0M         0 100% /mios

What does it mean /dev/root  and /dev/mtdblock9  has no available storage left?
Title: Re: EventWatcher[834] : Startup Lua Failed"
Post by: akbooer on November 17, 2016, 12:04:41 pm
OK, so we sorted all your problems...

- the 0 free memory is standard for Vera's ROM
- the other issue was some uncompressed files from an old (manual?) install

As you asked, here's a plot of the last day's memory (in kilobytes, so 40K = 40 Mbyte), cpu, and uptime for the last month (only latest week showing so far.)  You'll see that my Veras stay up for a good long time without reloads (in fact, in this case, it's just between power outages... we had one today.)

This is for 2x VeraLite with 64 Mbyte and 1x VeraEdge with 128 Mbyte.  I believe your Plus has 256 Mbyte.

20% CPU seems standard for me, but YMMV.

Good luck!
Title: Re: EventWatcher[834] : Startup Lua Failed"
Post by: paros on November 17, 2016, 01:55:58 pm
Many thanks to akbooer for the fantastic support  :)
What plugin do you use for showing that diagram?
Title: Re: EventWatcher[834] : Startup Lua Failed"
Post by: akbooer on November 17, 2016, 02:53:01 pm
That's Grafana, running on a Raspberry Pi, plotting data from a DataYours (Graphite) database.
Title: Re: EventWatcher[834] : Startup Lua Failed"
Post by: Mai Pensato on January 17, 2017, 12:59:28 pm
I used Eventwatcher for several months on Vera3 on UI5 without any problems. Recently I upgraded to Veraplus with the latest firmware. Eventwatcher did work good first days but then I also got message as mentioned in the subject. Cannot find what's the cause and how to solve it....
Title: Re: EventWatcher[834] : Startup Lua Failed"
Post by: akbooer on January 17, 2017, 01:02:05 pm
Which version of EventWatcher?

What does the log show?
Title: Re: EventWatcher[834] : Startup Lua Failed"
Post by: Mai Pensato on January 17, 2017, 04:36:02 pm
Current Version:1.20140123

I looked at the logs after a restart. I see a lot of lines but nothing with EventWatcher in...   Where do I have to look at ?
Title: Re: EventWatcher[834] : Startup Lua Failed"
Post by: akbooer on January 17, 2017, 04:44:43 pm
That's massively out of date, and probably is only fit for UI5.  Latest update was 20161116.

Would suggest first that you update all your files from here: https://github.com/akbooer/EventWatcher

and then see what happens.

Title: Re: EventWatcher[834] : Startup Lua Failed"
Post by: Mai Pensato on January 17, 2017, 05:58:53 pm
I just downloaded it from the appstore and this was the version I got.

Well I followed your instructions and updated the 5 files via develop apps -> luup files -> upload & restart Luup after upload.   The strange thing is: I still am on the same version number and I still have the lua startup error ....
Title: Re: EventWatcher[834] : Startup Lua Failed"
Post by: akbooer on January 17, 2017, 06:02:11 pm
Ah, I think that is UI7 doing bad things to you.  I'll try it myself tomorrow and see what works.
Title: Re: EventWatcher[834] : Startup Lua Failed"
Post by: akbooer on January 18, 2017, 06:15:09 am
It turns out that I'm running the latest EventWatcher on a Vera Edge with no difficulty.  One action I could suggest is simply to delete the plugin entirely using the plugin pages (this will not delete the files) and then create a new EventWatcher device manually with device file D_EventWatcher.xml and implementation file I_EventWatcher.xml.

This is assuming the new files were all, in fact, uploaded correctly (sounds like you used the right approach.)
Title: Re: EventWatcher[834] : Startup Lua Failed"
Post by: Mai Pensato on January 18, 2017, 12:49:11 pm
Thanks for your reply and support, really appreciate it.
I don't like iit very much to delete the plugin and then  creating it again manually
One last info, maybe this can help to come to an easy solution:\When in the plugin device under "control" I click on one of the blue items it opens this URL:
http://192.168.1.xxx/port_3480/data_request?id=lr_EventWatcher&report=cpu and it says "no handler"
(xxx = ip adress of my veraplus and this is correct)
Title: Re: EventWatcher[834] : Startup Lua Failed"
Post by: chrugel on February 04, 2017, 04:46:41 pm
Indeed the logs show an error:
Code: [Select]
50 11/16/16 14:58:18.987 luup_log:838: EventWatcher: defining CLI... <0x772cb520>
50 11/16/16 14:58:18.997 luup_log:838: EventWatcher: Starting Event service... <0x772cb520>
50 11/16/16 14:58:18.998 luup_log:838: EventWatcher: Server listening on port 443 <0x772cb520>
10 11/16/16 14:58:18.998 AlarmManager::AddRelativeAlarm current time 1479304698 delay 10 type 7 <0x772cb520>
10 11/16/16 14:58:18.999 AlarmManager::AddAbsoluteAlarm alarm 0x1928f98 entry 0x1ede370 id 0 type 7 param=0x198d380 entry->when: 1479304708 time: 1479304698 bCancelFirst 0=0 <0x772cb520>
50 11/16/16 14:58:18.999 luup_log:838: EventWatcher: Starting Watch service... <0x772cb520>
01 11/16/16 14:58:19.000 LuaInterface::CallFunction_Startup-1 device 838 function init failed [string "local ABOUT = {..."]:1156: attempt to index local 'c' (a nil value) <0x772cb520>
01 11/16/16 14:58:19.000 LuImplementation::StartLua running startup code for 838 I_EventWatcher.xml failed <0x772cb520>

The good news is that I understand that the condition that it reports would generate an error, the bad news is I simply cannot understand how that might happen.  I've loaded the same version from GitHub onto both an openLuup development machine and one of my VeraLite machines and they both work perfectly.

There is, I suppose, the remote possibility of a download error.  Can I ask that you re-install from the AltAppStore and try again?

Hi,
I have now followed the exact things you have done here in this thread but i still have the same entries in the luup log as you stated above:
Code: [Select]
50 02/04/17 22:30:21.727 luup_log:353: EventWatcher: Starting Watch service... <0x7755a520>
01 02/04/17 22:30:21.727 LuaInterface::CallFunction_Startup-1 device 353 function init failed [string "ABOUT = {..."]:1158: attempt to index local 'c' (a nil value) <0x7755a520>
01 02/04/17 22:30:21.728 LuImplementation::StartLua running startup code for 353 I_EventWatcher.xml failed <0x7755a520>
50 02/04/17 22:30:22.100 luup_log:351: ALTUI: startupDeferred, called on behalf of device:351 <0x75d5a520>

I seem to  have missed the spot in this thread where you say what exacly fixed the problem?
Could you please point me to how you managed to fix this?

Thank you very much in advance!
regards
Christian
Title: Re: EventWatcher[834] : Startup Lua Failed"
Post by: akbooer on February 04, 2017, 05:21:05 pm
Are you absolutely sure that you have downloaded and installed the latest version from GitHub?
Title: Re: EventWatcher[834] : Startup Lua Failed"
Post by: chrugel on February 05, 2017, 09:23:58 am
Are you absolutely sure that you have downloaded and installed the latest version from GitHub?

Initially i thought you said that earlier in the thread that you had updated the version in the Alternate Appstore in AltUi so i installed that one. But now i have downloaded the GitHub version and installed that one just to be sure, with the same result I'm afraid.
Is it possible that there is something stuck in the system from the first one i installed from the Mios AppStore?

christian
Title: Re: EventWatcher[834] : Startup Lua Failed"
Post by: akbooer on February 05, 2017, 09:55:25 am
Initially i thought you said that earlier in the thread that you had updated the version in the Alternate Appstore in AltUi so i installed that one. But now i have downloaded the GitHub version and installed that one just to be sure, with the same result I'm afraid.

They should be similar, if not identical.

Quote
Is it possible that there is something stuck in the system from the first one i installed from the Mios AppStore?

Yes, it must be something like that.   If you look through the files on your system "Apps > Develop Apps > Luup files", do you see any duplicates for any EventWatcher files?  It's possible that you have both compressed and uncompressed versions.  Delete ALL EventWatcher files (D_xxx, S_xxx, I_xxx, L_xxx) and try again.

As I mentioned before, I've done a raw install from the App Store on a clean machine without any issues.
Title: Re: EventWatcher[834] : Startup Lua Failed"
Post by: chrugel on February 05, 2017, 11:07:27 am
Initially i thought you said that earlier in the thread that you had updated the version in the Alternate Appstore in AltUi so i installed that one. But now i have downloaded the GitHub version and installed that one just to be sure, with the same result I'm afraid.

They should be similar, if not identical.

Quote
Is it possible that there is something stuck in the system from the first one i installed from the Mios AppStore?

Yes, it must be something like that.   If you look through the files on your system "Apps > Develop Apps > Luup files", do you see any duplicates for any EventWatcher files?  It's possible that you have both compressed and uncompressed versions.  Delete ALL EventWatcher files (D_xxx, S_xxx, I_xxx, L_xxx) and try again.

As I mentioned before, I've done a raw install from the App Store on a clean machine without any issues.


Now i deleted what ever i could find in the /etc/cmh-ludl path i also checked the /etc/cmh-lu path but there was nothing. Restarted the lua engine to make sure de Eventwatcher device was gone. And then transferd the files from github with the Upload button in Develop Apps and created a New device.
The exact same result:
Code: [Select]
50 02/05/17 16:58:31.758 luup_log:357: EventWatcher: Starting Watch service... <0x76dd2520>
01 02/05/17 16:58:31.759 LuaInterface::CallFunction_Startup-1 device 357 function init failed [string "ABOUT = {..."]:1158: attempt to index local 'c' (a nil value) <0x76dd2520>
01 02/05/17 16:58:31.759 LuImplementation::StartLua running startup code for 357 I_EventWatcher.xml failed <0x76dd2520>
50 02/05/17 16:58:32.101 luup_log:351: ALTUI: startupDeferred, called on behalf of device:351 <0x757d2520>


 Any other information i could provide that might help?
I'm currently running the latest version 1.7.2406.

christian
Title: Re: EventWatcher[834] : Startup Lua Failed"
Post by: pit on February 18, 2017, 08:19:42 am
Today I got the same error. I removed and reinstalled eventWatcher (1.20140123) without effekt.
I run eventWatcher on veraEdge since more than a year without problems. Last week I made a vera upgrade to the newest softwarelevel without problems. Yesterday (when eventWatcher still was working) I renamed some devices and I installed the GetLogUtility, popp thermostat and aeon sirene. Maybe one of these changes was initiating the error?