Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unhandled Exception, All Values Stop Getting Updated #6355

Closed
3 tasks done
evan-swinney opened this issue Sep 26, 2023 · 14 comments · Fixed by #6379
Closed
3 tasks done

Unhandled Exception, All Values Stop Getting Updated #6355

evan-swinney opened this issue Sep 26, 2023 · 14 comments · Fixed by #6379
Labels
bug Something isn't working

Comments

@evan-swinney
Copy link

Checklist

  • I am not using Home Assistant. Or: a developer has told me to come here.
  • I have checked the troubleshooting section and my problem is not described there.
  • I have read the changelog and my problem is not mentioned there.

Deploy method

Docker

Z-Wave JS UI version

8.23.2.882c26e

ZwaveJS version

11.13.0

Describe the bug

The integration works fine for hours, or even days, and then eventually it starts producing this error within the logs:

2023-09-26 03:05:32.287 ERROR APP: Unhandled Rejection, reason: TypeError: Cannot read properties of undefined (reading 'label')
2023-09-26 03:05:32.387 ERROR APP: Unhandled Rejection, reason: TypeError: Cannot read properties of undefined (reading 'label')
2023-09-26 03:05:38.086 ERROR APP: Unhandled Rejection, reason: TypeError: Cannot read properties of undefined (reading 'label')
2023-09-26 03:05:38.223 ERROR APP: Unhandled Rejection, reason: TypeError: Cannot read properties of undefined (reading 'label')

When this happens, Home Assistant cannot read any more data from the websocket and all values cease to update.

An additional side-effect of this is when it starts doing this, all of my devices which had previously had correct Manufacturer and Product names revert back to showing as Unknown.

Restarting the ZWave JS UI container does not resolve the issue. Restarting Home Assistant does not resolve the issue.

To Reproduce

Unknown; it starts happening seemingly at random. The first time it happened within 24 hours, the second time it took 2 weeks. Home Assistant & ZWave JS UI were completely hands off during those time periods.

Expected behavior

For errors to not show up in the logs; for data to keep streaming over the websocket connection to Home Assistant; for product and vendor names to show their correct values.

Additional context

Everything is Dockerized & run in Kubernetes with the following Docker tags:
Home Assistant: 2023.8.4
ZWave JS UI: 8.23

I initially saw this on tag 8.25, and I reverted back to 8.23 initially with the same data & config, but the problem persisted. I then reinstalled 8.23 completely (deleting all configs & data) thinking there was some sort of new error in 8.25, but this seems to have been unfounded.

I am using a Nortek HUSBZB-1 Zwave/Zigbee combo controller. However, I am only using the ZWave functionality at this time.

@evan-swinney evan-swinney added the bug Something isn't working label Sep 26, 2023
@robertsLando
Copy link
Member

robertsLando commented Sep 26, 2023

Tried 8.26?

Have you mqtt enabled or disabled?

@AlCalzone the only part in code that could cause this if mqtt is disabled could be this:

https://github.com/zwave-js/zwave-js-ui/blob/2e6fbd0ebca5fb99511a3c0f7267ab8a9450058a/lib/ZwaveClient.ts#L5408

Could it be that for some reasons args is undefined in ZWaveNotificationCallback ?

@AlCalzone
Copy link
Member

Could it be that for some reasons args is undefined in ZWaveNotificationCallback ?

I checked all locations where that event gets emitted. The args object is always immediately part of the call, so no.

robertsLando referenced this issue in zwave-js/zwave-js-ui Sep 26, 2023
@robertsLando
Copy link
Member

I submitted a fix to include error stack in error message. I will create a quick patch so you can try that and report me the new error when happens so we can understand the root cause

@robertsLando
Copy link
Member

@robertsLando
Copy link
Member

Use v 9+ version and let us know when possible

@evan-swinney
Copy link
Author

Will do as soon as I can!

@evan-swinney
Copy link
Author

evan-swinney commented Sep 29, 2023

@robertsLando I upgraded the zwave-js-ui container to the 9.0.1 tag. I did not delete or modify any configuration data when I did this.

Now no devices show up in the device list, and the health endpoint is returning 500 and the container is now in a slow infinite restart loop.

If you think I should delete all configuration data, I can.

@robertsLando
Copy link
Member

@evan-swinney
Please make a driver log, loglevel debug and attach it here as a file (drag & drop into the text field).

Then you could revert to previous version, we need to sort out what's going on with your instance

@AlCalzone
Copy link
Member

@evan-swinney you might be affected by this:
#6341

@evan-swinney
Copy link
Author

In the process of getting you the logs, I had my log level set on Silly and logging to a file the whole time. However, I changed this to the Debug level, and as soon as I saved the configuration, it started working again, sending data to Home Assistant and all of my devices appear in the list now.

I have some of the Silly level logs, if that'd be helpful. I can also wait until the problem occurs again with the log level at Debug.

@AlCalzone
Copy link
Member

I need to do some filtering, but those logs may still be helpful.

@evan-swinney
Copy link
Author

I was able to just leave it over night and it started happening again, so I have logs in Debug mode now. This time the devices remain in the list, but the values are still not updating and the unhandled exception is in the ZWave UI log again. I believe this is as close to the original problem as we'll get.

Attached are both the ZWave UI and ZWave JS logs.
z-ui_2023-10-01.log
zwavejs_2023-10-01.log

@robertsLando
Copy link
Member

robertsLando commented Oct 2, 2023

@AlCalzone There are tons of this:

2023-10-01 03:45:27.428 ERROR APP: Unhandled Rejection, reason: TypeError: Cannot read properties of undefined (reading 'label')
TypeError: Cannot read properties of undefined (reading 'label')
    at MultilevelSensorCCReport.persistValues (/usr/src/app/node_modules/@zwave-js/cc/src/cc/MultilevelSensorCC.ts:673:20)
    at Driver.persistCCValues (/usr/src/app/node_modules/zwave-js/src/lib/driver/Driver.ts:4435:6)
    at Driver.serialport_onData (/usr/src/app/node_modules/zwave-js/src/lib/driver/Driver.ts:3072:11)

@robertsLando robertsLando transferred this issue from zwave-js/zwave-js-ui Oct 2, 2023
@AlCalzone
Copy link
Member

...TypeScript knew better than me again :(

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants