node-red-contrib-home-assistant-websocket icon indicating copy to clipboard operation
node-red-contrib-home-assistant-websocket copied to clipboard

package causes NodeRed to crash if connection to HA server fails (HA reboots, etc)

Open marc-gist opened this issue 3 years ago • 2 comments

Describe the bug

If the node-red-contrib-home-assistant-websocket loses connection and eventually reconnects to HomeAssistant the

[red] Uncaught Exception:
19 Aug 20:25:58 - [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 "#<Object>".

is thrown.

more logs:

19 Aug 20:23:03 - [info] [server:x.duckdns.org] Connected to https://x.duckdns.org:8123
19 Aug 20:25:25 - [info] [server:x.duckdns.org] Connection closed to https://x.duckdns.org:8123
19 Aug 20:25:25 - [info] [server:x.duckdns.org] Connecting to https://x.duckdns.org:8123
19 Aug 20:25:30 - [info] [server:x.duckdns.org] Connecting to https://x.duckdns.org:8123
19 Aug 20:25:35 - [info] [server:x.duckdns.org] Connecting to https://x.duckdns.org:8123
19 Aug 20:25:40 - [info] [server:x.duckdns.org] Connecting to https://x.duckdns.org:8123
19 Aug 20:25:41 - [info] [server:x.duckdns.org] Connected to https://x.duckdns.org:8123
19 Aug 20:25:58 - [info] [server:x.duckdns.org] Connection closed to https://x.duckdns.org:8123
19 Aug 20:25:58 - [red] Uncaught Exception:
19 Aug 20:25:58 - [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 "#<Object>".

Note: x.duckdns.org points to an internal IP via internal DNS settings, the same thing happens if I use an IP address.

To Reproduce

  1. Have HA setup on a different server/docker etc
  2. Connect via the package to HA.
  3. Restart HA
  4. Watch for NR to restart (if you have restart-unless-stopped etc setup for docker).

Expected behavior

Error messages only, then a connection followed by working system :)

Screenshots

No response

Example Flow

n/a

This package's version (not the Home Assistant add-on version)

0.44.0

Is Node-RED running in Docker?

Yes

Node-RED version

3.0.2

Node.js version

v16.16.0

Additional context

No response

marc-gist avatar Aug 20 '22 00:08 marc-gist

Are you using the device node?

zachowj avatar Aug 24 '22 05:08 zachowj

This issue has been automatically marked as abandoned because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

github-actions[bot] avatar Sep 23 '22 07:09 github-actions[bot]