Z-Wave-Me / zwave-smarthome

Z-Way Smart Home UI
GNU General Public License v3.0
57 stars 38 forks source link

Active Apps Page displays Blank #224

Closed NetNinja9 closed 7 years ago

NetNinja9 commented 7 years ago

Hi All,

I've got a strange issue affecting my 2.3.0 box.

last week, I noticed that I could not see or edit any of my active apps in the active tab. Yet, I can see widgets for all my apps, and can even install new ones! (I can see all apps in the app store) Important to note that these apps are all running in the background.

I took a look at forum.z-wave.me/viewtopic.php?f=3419&t=22002&hilit=active+apps+missing and cleared my cache, changed PC's and still nothing.

Tonight, I found that my disk usage was 95%+ and deleted some old log files, but still no change after a reboot.

Recent Changes: -I had a strange crash occur last week around the same time. I got a PRTG alert which monitors the health of z-way HTTP, and noticed the z-way-server service had stopped, however my log had maxed out and didn't get any messages - so not 100% sure if it is related.

-I also updated the "Condition Switch" app around the same time.

-I have modified the CSS file for theme modifications, but I have reverted to the default theme, and no changes.

I've attached a log from the last reboot, and i tried to access the "Active" apps tab just before the log ends. (no log messages are outputted when the active apps page loads)

Also, There is a console error when loading the page:

"Error: [ngRepeat:dupes] http://errors.angularjs.org/1.2.28/ngRepeat/dupes?p0=v%20in%20dataHolder.instances.all%7CorderBy%3Acfg.orderby.instances%5BdataHolder.instances.orderBy%5D%20%7C%20filter%3Aq%20track%20by%20v.id&p1=75&p2=%7B%22instanceId%22%3A%220%22%2C%22moduleId%22%3A%22ConditionSwitch%22%2C%22active%22%3Atrue%2C%22title%22%3A%22Watering%20Today%20Notification%20Trigger%22%2C%22params%22%3A%7B%22switches%22%3A%5B%7B%22type%22%3A%22event%22%2C%22event%22%3A%7B%22startEvent%22%3A%22tt%22%2C%22endEvent%22%3A%22vv%22%7D%7D%5D%2C%22condition%22%3A%7B%22type%22%3A%22binary%22%2C%22binaryDevice%22%3A%22DummyDevice_34%22%2C%22binaryValue%22%3A%22on%22%7D%7D%2C%22id%22%3A75%2C%22creationTime%22%3A1480833123%2C%22category%22%3A%22automation_basic%22%7D z/<@http://192.168.1.119:8083/smarthome/app/js/build.js:7489:450 xd</<.link/<@http://192.168.1.119:8083/smarthome/app/js/build.js:7684:179 Yd/this.$get</h.prototype.$watchCollection/<@http://192.168.1.119:8083/smarthome/app/js/build.js:7592:293 Yd/this.$get</h.prototype.$digest@http://192.168.1.119:8083/smarthome/app/js/build.js:7593:371 Yd/this.$get</h.prototype.$apply@http://192.168.1.119:8083/smarthome/app/js/build.js:7596:360 m@http://192.168.1.119:8083/smarthome/app/js/build.js:7555:452 w@http://192.168.1.119:8083/smarthome/app/js/build.js:7560:463 ye/</B.onreadystatechange@http://192.168.1.119:8083/smarthome/app/js/build.js:7562:24 "

z-way-server.log.zip screen shot 2017-02-23 at 7 07 53 pm screen shot 2017-02-19 at 5 45 17 pm screen shot 2017-02-19 at 6 06 27 pm

Thanks in advance,

Tim

PoltoS commented 7 years ago

can you access http://192.168.1.119:8083/ZAutomation/api/v1/instances ? Does it give you a JSON list of active apps?

If so, the problem is in the UI. And we will need access to check it (or you can try to walk through the code to locate it).

Another option is to do "git clone" into htdocs/smarthome_git of the UI from git and access it instead of original /smarthome/. This will give you a chance to compare behaviour

NetNinja9 commented 7 years ago

I did a git clone into a smarthome_git folder, and the results are unfortunately the same.

screen shot 2017-03-04 at 1 37 03 pm

I can get a list of the active apps via the api (I wasn't sure how to get this previously), and i've attached it to this reply. Looking at the Error in the console and the JSON output from the api, I believe I have found the issue - For some reason, the ID's are not unique, as ID's 73, 74 and 75 are re-used.

apps.zip

What would be the best way to resolve this sort of issue? Is there a way for me to change the ID of an app, and if so, what logic is in place when generating an ID for new apps (e.g. how do I stop this from happening when I add a new app?)

NetNinja9 commented 7 years ago

ok, I've modified the ID numbers in the config file, and can confirm that all is now working fine.

I've just created some new apps, and it is using the next unique ID value, so everything looks to be ok now. If it happens again, I'll raise another issue to determine root-cause screen shot 2017-03-04 at 2 14 19 pm

PoltoS commented 7 years ago

would interesting to find out how it happened

NetNinja9 commented 7 years ago

Totally agree. If it re-occurs, hopefully we can correlate any similar changes to determine RC.

I have a feeling it had something to the upgrade I did to the condition switch app... Even though my primary issue is fixed (Active apps display), I'm going to need to update all the logic in my condition switches as it is not configured correctly in the UI now for some reason... (the raw JSON output looks correct).

ronie-z-wave commented 7 years ago

ok, I've modified the ID numbers in the config file, and can confirm that all is now working fine.

Were there some duplicated instances in it? If yes could you remember which of them?

NetNinja9 commented 7 years ago

ID's 73, 74 and 75 are re-used.

yes, 73, 74 and 75 were duplicated, while there were ID's in the 80's present. After modifying the config file, new apps start at the next available ID

ronie-z-wave commented 7 years ago

Oh I had overlooked it, sry. Could you remember the moduleId or app that has produces this duplicated instances?

you can also check "moduleId": "ZWave" in instances api.

NetNinja9 commented 7 years ago

Faulty_Modules.zip

You can see attached all the modules I had, and their config when it was still broken (from my config backup).

The instance ID of ZWave was 1, and it looks like the duplication of ID's began on a condition switch module. This (I believe) leads more into the possible faulty upgrade of the condition switch module.

(the reason why there are more than one app after the first duplicate ID is due to me creating apps after the issue started as a troubleshooting measure)

It seems that Module ID 73 is now broken as it no longer runs. I will be deleting and reconfiguring all of my condition switches as a precaution. I figured I may need to do this due to the : "After update an instance may not works. In this case please remove this device from the "Active" list an install again. Are you sure to update an App?" message when upgrading an app.

NetNinja9 commented 7 years ago

regarding my last comment about Module ID 73:

Turns out it overwrote the settings of the id=73 condition switch with the settings of the duplicated ID=73 condition switch (which is now ID=80), hence module 73 and 80 were doing the same thing. I have now reconfigured ID73 back to its initial configuration. (I hope that makes sense)