hassio-addons / addon-node-red

Node-RED - Home Assistant Community Add-ons
https://addons.community
MIT License
532 stars 123 forks source link

Node-Red Addon keeps crashing #1917

Closed johntdyer closed 2 months ago

johntdyer commented 2 months ago

Node-Red Addon - : 18.0.4 HassOS: 2024-07-03 Supervisor: 2024.07.00

Problem/Motivation

About once a day the add-on crashes and the watchdog doesnt seem to trigger a restart

Expected behavior

Crashes to not happen daily and if they do the watchdog should restart them

Actual behavior

Crashes every day, I have to manually start it

Steps to reproduce

Start it, wait and watch

Proposed changes

s6-rc: info: service init-nodered: starting
s6-rc: info: service init-nginx successfully started

up to date, audited 407 packages in 3s

81 packages are looking for funding
  run `npm fund` for details

28 vulnerabilities (20 moderate, 6 high, 2 critical)

To address issues that do not require attention, run:
  npm audit fix

To address all issues possible (including breaking changes), run:
  npm audit fix --force

Some issues need review, and may require choosing
a different dependency.

Run `npm audit` for details.
npm notice
npm notice New minor version of npm available! 10.7.0 -> 10.8.2
npm notice Changelog: https://github.com/npm/cli/releases/tag/v10.8.2
npm notice To update run: npm install -g npm@10.8.2
npm notice
s6-rc: info: service init-nodered successfully started
s6-rc: info: service nodered: starting
s6-rc: info: service nodered successfully started
s6-rc: info: service nginx: starting
s6-rc: info: service nginx successfully started
s6-rc: info: service legacy-services: starting
[00:32:46] INFO: Starting Node-RED...
s6-rc: info: service legacy-services successfully started

> start
> node $NODE_OPTIONS node_modules/node-red/red.js --settings /etc/node-red/config.js

26 Jul 00:32:47 - [info] 

Welcome to Node-RED
===================

26 Jul 00:32:47 - [info] Node-RED version: v4.0.2
26 Jul 00:32:47 - [info] Node.js  version: v18.20.3
26 Jul 00:32:47 - [info] Linux 6.6.33-haos x64 LE
26 Jul 00:32:47 - [info] Loading palette nodes
26 Jul 00:32:48 - [info] Node-RED Contrib Theme Collection version: v4.0.4
26 Jul 00:32:50 - [info] Dashboard version 3.6.5 started at /endpoint/ui
26 Jul 00:32:50 - [info] Settings file  : /etc/node-red/config.js
26 Jul 00:32:50 - [info] Context store  : 'default' [module=memory]
26 Jul 00:32:50 - [info] User directory : /config/
26 Jul 00:32:50 - [warn] Projects disabled : editorTheme.projects.enabled=false
26 Jul 00:32:50 - [info] Flows file     : /config/flows.json
26 Jul 00:32:50 - [info] Server now running at http://127.0.0.1:46836/
26 Jul 00:32:50 - [info] Starting flows
26 Jul 00:32:50 - [error] [mqtt out:118db764.b6fe21] missing broker configuration
26 Jul 00:32:50 - [error] [mqtt in:6f09dcc604075a1c] missing broker configuration
[00:32:51] INFO: Starting NGinx...
26 Jul 00:32:51 - [info] Started flows
26 Jul 00:32:55 - [info] [server:Home Assistant] Connecting to http://supervisor/core
26 Jul 00:32:55 - [info] [server:Home Assistant] Connected to http://supervisor/core
26 Jul 00:34:59 - [error] [function:Update global] TypeError: Cannot read properties of undefined (reading 'find')
26 Jul 00:35:18 - [info] [server:Home Assistant] Connection closed to http://supervisor/core
26 Jul 00:35:18 - [error] [ha-api:Entities] Error: Unrecognized error: {"type":"result","success":false,"error":{"code":3,"message":"Connection lost"}}
26 Jul 00:35:18 - [error] [ha-api:Entities] Error: Unrecognized error: {"type":"result","success":false,"error":{"code":3,"message":"Connection lost"}}
26 Jul 00:35:18 - [error] [ha-api:Entities] Error: Unrecognized error: {"type":"result","success":false,"error":{"code":3,"message":"Connection lost"}}
26 Jul 00:35:18 - [error] [ha-api:Entities] Error: Unrecognized error: {"type":"result","success":false,"error":{"code":3,"message":"Connection lost"}}
26 Jul 00:35:18 - [error] [ha-api:Entities] Error: Unrecognized error: {"type":"result","success":false,"error":{"code":3,"message":"Connection lost"}}
26 Jul 00:35:18 - [error] [ha-api:Entities] Error: Unrecognized error: {"type":"result","success":false,"error":{"code":3,"message":"Connection lost"}}
26 Jul 00:35:18 - [error] [ha-api:Entities] Error: Unrecognized error: {"type":"result","success":false,"error":{"code":3,"message":"Connection lost"}}
26 Jul 00:35:18 - [error] [ha-api:Entities] Error: Unrecognized error: {"type":"result","success":false,"error":{"code":3,"message":"Connection lost"}}
26 Jul 00:35:18 - [error] [ha-api:Entities] Error: Unrecognized error: {"type":"result","success":false,"error":{"code":3,"message":"Connection lost"}}
26 Jul 00:35:18 - [error] [ha-api:Entities] Error: Unrecognized error: {"type":"result","success":false,"error":{"code":3,"message":"Connection lost"}}
26 Jul 00:35:18 - [error] [ha-api:Entities] Error: Unrecognized error: {"type":"result","success":false,"error":{"code":3,"message":"Connection lost"}}
26 Jul 00:35:18 - [error] [ha-api:Entities] Error: Unrecognized error: {"type":"result","success":false,"error":{"code":3,"message":"Connection lost"}}
26 Jul 00:35:18 - [red] Uncaught Exception:
26 Jul 00:35:18 - [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>".
[00:35:18] INFO: Service Node-RED exited with code 1 (by signal 0)
s6-rc: info: service legacy-services: stopping
s6-rc: info: service legacy-services successfully stopped
s6-rc: info: service nginx: stopping
[00:35:18] INFO: Service NGINX exited with code 0 (by signal 0)
s6-rc: info: service nginx successfully stopped
s6-rc: info: service init-nginx: stopping
s6-rc: info: service nodered: stopping
s6-rc: info: service nodered successfully stopped
s6-rc: info: service init-nodered: stopping
s6-rc: info: service init-nginx successfully stopped
s6-rc: info: service init-nodered successfully stopped
s6-rc: info: service init-customizations: stopping
s6-rc: info: service init-customizations successfully stopped
s6-rc: info: service legacy-cont-init: stopping
s6-rc: info: service legacy-cont-init successfully stopped
s6-rc: info: service fix-attrs: stopping
s6-rc: info: service base-addon-log-level: stopping
s6-rc: info: service fix-attrs successfully stopped
s6-rc: info: service base-addon-log-level successfully stopped
s6-rc: info: service base-addon-banner: stopping
s6-rc: info: service base-addon-banner successfully stopped
s6-rc: info: service s6rc-oneshot-runner: stopping
s6-rc: info: service s6rc-oneshot-runner successfully stopped

Supervisor logs

2024-07-26 00:29:55.175 INFO (MainThread) [supervisor.docker.addon] Starting Docker add-on ccab4aaf/amd64-addon-frigate-proxy with version 1.5
2024-07-26 00:30:21.428 INFO (MainThread) [supervisor.api.proxy] Home Assistant WebSocket API error: Cannot proxy websocket message of unsupported type: 258
2024-07-26 00:30:21.429 INFO (MainThread) [supervisor.api.proxy] Home Assistant WebSocket API for a0d7b954_nodered closed
2024-07-26 00:30:25.111 WARNING (MainThread) [supervisor.addons.addon] Watchdog found addon Node-RED is failed, restarting...
2024-07-26 00:30:25.116 INFO (SyncWorker_12) [supervisor.docker.manager] Cleaning addon_a0d7b954_nodered application
2024-07-26 00:30:25.375 INFO (MainThread) [supervisor.docker.addon] Starting Docker add-on ghcr.io/hassio-addons/node-red/amd64 with version 18.0.4
2024-07-26 00:30:41.864 INFO (MainThread) [supervisor.api.proxy] Home Assistant WebSocket API request initialize
2024-07-26 00:30:41.874 INFO (MainThread) [supervisor.api.proxy] WebSocket access from a0d7b954_nodered
2024-07-26 00:30:41.916 INFO (MainThread) [supervisor.api.proxy] Home Assistant WebSocket API request running
2024-07-26 00:31:58.273 WARNING (MainThread) [supervisor.misc.tasks] Watchdog missing application response from ccab4aaf_frigate-proxy
2024-07-26 00:32:39.000 INFO (MainThread) [supervisor.api.proxy] Home Assistant WebSocket API error: Cannot proxy websocket message of unsupported type: 258
2024-07-26 00:32:39.001 INFO (MainThread) [supervisor.api.proxy] Home Assistant WebSocket API for a0d7b954_nodered closed
2024-07-26 00:32:42.282 WARNING (MainThread) [supervisor.addons.addon] Watchdog found addon Node-RED is failed, restarting...
2024-07-26 00:32:42.286 INFO (SyncWorker_1) [supervisor.docker.manager] Cleaning addon_a0d7b954_nodered application
2024-07-26 00:32:42.550 INFO (MainThread) [supervisor.docker.addon] Starting Docker add-on ghcr.io/hassio-addons/node-red/amd64 with version 18.0.4
2024-07-26 00:32:55.917 INFO (MainThread) [supervisor.api.proxy] Home Assistant WebSocket API request initialize
2024-07-26 00:32:55.927 INFO (MainThread) [supervisor.api.proxy] WebSocket access from a0d7b954_nodered
2024-07-26 00:32:55.931 INFO (MainThread) [supervisor.api.proxy] Home Assistant WebSocket API request running
2024-07-26 00:34:01.345 WARNING (MainThread) [supervisor.misc.tasks] Watchdog found a problem with ccab4aaf_frigate-proxy application!
2024-07-26 00:34:01.352 INFO (SyncWorker_12) [supervisor.docker.manager] Stopping addon_ccab4aaf_frigate-proxy application
2024-07-26 00:34:01.769 INFO (SyncWorker_12) [supervisor.docker.manager] Cleaning addon_ccab4aaf_frigate-proxy application
2024-07-26 00:34:02.165 INFO (MainThread) [supervisor.docker.addon] Starting Docker add-on ccab4aaf/amd64-addon-frigate-proxy with version 1.5
2024-07-26 00:34:42.525 WARNING (MainThread) [supervisor.addons.options] Unknown option 'desc' for Network UPS Tools (a0d7b954_nut)
2024-07-26 00:34:42.525 WARNING (MainThread) [supervisor.addons.options] Unknown option 'snmp_version' for Network UPS Tools (a0d7b954_nut)
2024-07-26 00:34:42.525 WARNING (MainThread) [supervisor.addons.options] Unknown option 'mibs' for Network UPS Tools (a0d7b954_nut)
2024-07-26 00:34:42.525 WARNING (MainThread) [supervisor.addons.options] Unknown option 'pollinterval' for Network UPS Tools (a0d7b954_nut)
2024-07-26 00:34:42.525 WARNING (MainThread) [supervisor.addons.options] Unknown option 'upsmon_deadtime' for Network UPS Tools (a0d7b954_nut)
2024-07-26 00:35:18.029 INFO (MainThread) [supervisor.api.proxy] Home Assistant WebSocket API error: Cannot proxy websocket message of unsupported type: 258
2024-07-26 00:35:18.029 INFO (MainThread) [supervisor.api.proxy] Home Assistant WebSocket API for a0d7b954_nodered closed
2024-07-26 00:35:21.488 ERROR (MainThread) [asyncio] Task exception was never retrieved
future: <Task finished name='Task-95945' coro=<Addon.watchdog_container() done, defined at /usr/src/supervisor/supervisor/addons/addon.py:1429> exception=AddonsJobError('Rate limit exceeded, more than 10 calls in 0:30:00')>
Traceback (most recent call last):
  File "/usr/src/supervisor/supervisor/addons/addon.py", line 1443, in watchdog_container
    await self._restart_after_problem(event.state)
  File "/usr/src/supervisor/supervisor/jobs/decorator.py", line 290, in wrapper
    raise on_condition(
supervisor.exceptions.AddonsJobError: Rate limit exceeded, more than 10 calls in 0:30:00
2024-07-26 00:36:05.249 WARNING (MainThread) [supervisor.misc.tasks] Watchdog missing application response from ccab4aaf_frigate-proxy
2024-07-26 00:38:08.321 WARNING (MainThread) [supervisor.misc.tasks] Watchdog found a problem with ccab4aaf_frigate-proxy application!
2024-07-26 00:38:08.330 INFO (SyncWorker_8) [supervisor.docker.manager] Stopping addon_ccab4aaf_frigate-proxy application
2024-07-26 00:38:08.800 INFO (SyncWorker_8) [supervisor.docker.manager] Cleaning addon_ccab4aaf_frigate-proxy application
2024-07-26 00:38:09.266 INFO (MainThread) [supervisor.docker.addon] Starting Docker add-on ccab4aaf/amd64-addon-frigate-proxy with version 1.5
sinclairpaul commented 2 months ago

Your issue appears to be related to the node-red WebSocket palette that the addon pre-installs, it can be found at https://github.com/zachowj/node-red-contrib-home-assistant-websocket

johntdyer commented 2 months ago

Thank you , opened https://github.com/zachowj/node-red-contrib-home-assistant-websocket/issues/1451 to see if they can help me track this down