-
-
Notifications
You must be signed in to change notification settings - Fork 103
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 now happens after update and crashes Node-Red! #1707
Comments
getting the same issue with v0.69.1
|
Add the following snippet to your process.on('unhandledRejection', (reason, p) => {
console.log('Unhandled Rejection: ', p, 'reason:', reason);
}); |
So after adding that to the end of my settings.js, your addon loads but gives this:
|
@ctark you getting the same issue? I don't have time to test adding this to my nodes, as its doing it in my production environment :( |
Set debug logging and audit true, i get a bit moreinformation...
I get the same as ctark
but now NR doesn't crash, which is good. Not sure those are related. But find it interesting that I get two Unhandled rejections, and your code is displaying two nodes with issues. |
Yes, started when I updated node red and all nodes to latest. I then got a log entry saying that home assistant needed to be 2023.12 or later (I was pinned to 2023.08 at the time). |
Do you need anything else? @zachowj |
The unhandled exception is caused by Node-RED sending a command over the WebSocket connection that isn’t registered with Home Assistant. This could happen if Node-RED thinks the custom integration is installed when it’s not or if a required component isn’t loaded. To identify the command sent to Home Assistant, set the logger level for
|
The exception is caused by the Node code not catching exceptions. In my case, looks like it may not be handling errors when entity ids do not exist. i'll try to do more debugging for you when i have a chance to shutdown my production machine. Hopefully you have time to check the code for where exceptions are not captured. Thanks! |
It’s unrelated to entity IDs. As mentioned earlier, the issue arises from Node-RED sending a command that Home Assistant doesn’t have a handler for. The "unknown command" log you shared confirms this. Here’s the relevant code in Home Assistant that returns the error message: Identifying the specific command being sent would save time and avoid the need to search through the entire codebase. |
On HA |
Thanks for the awesome integration and putting up with me, and helping me learn how to better debug. hopefully should I find another one I can provide better details from the start. Could the code not catch these errors to maintain backward compatibility? I don't like updating HA very often on the one system as its a customer facing production "system" that runs. take care! |
Maintaining backward compatibility is always a priority, but in this case, the floor and label registries are now core requirements for several nodes. Adding workarounds or version gates to handle older Home Assistant versions would significantly increase maintenance complexity. |
Describe the bug
after upgradding from 0.64 to 0.74.2.
[error] UnhandledPromiseRejection: This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). The promise rejected with the reason "#".
To Reproduce
update package to 0.74.2
Expected behavior
to keep running, or throw an error without crashing NR completely.
Screenshots
No response
Example Flow
No response
Environment Information
Version: 0.64.0
Home Assistant instances: 4
Server: 967b6c84.0c1c
Home Assistant version: 2024.1.6
Companion version: 0.0.0
Server: 90fe7859.6f59a8
Home Assistant version: 2024.11.2
Companion version: 4.1.1
Server: 6222af3a.62305
Home Assistant version: 2024.11.3
Companion version: 4.1.1
Server: 6cc6453e51f69328
Home Assistant version: 2024.7.2
Companion version: 0.0.0
Node-RED version: 3.1.14
Docker: yes
Add-on: no
Node.js version: v18.20.4 x64 linux
OS: Linux 6.1.0-20-amd64 x64
Additional context
No response
The text was updated successfully, but these errors were encountered: