hassio-addons / addon-node-red

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

Continual connection closed, reconnecting, connected #1878

Closed julio8a closed 2 months ago

julio8a commented 2 months ago

Problem/Motivation

I've been running Node-Red through Home Assistant for over a year and never had this issue. It keeps connecting/disconnecting and I don't know why.

Expected behavior

Should always be connected and not disconnect/connect constantly.

Actual behavior

My flows don't run in the periods when it disconnects and tries to connect, which is causes issues with my home.

Steps to reproduce

Run node-red or restart node-red

Proposed changes

I don't know why this is happening.

Log

s6-rc: info: service s6rc-oneshot-runner: starting
s6-rc: info: service s6rc-oneshot-runner successfully started
s6-rc: info: service base-addon-banner: starting

-----------------------------------------------------------
 Add-on: Node-RED
 Flow-based programming for the Internet of Things
-----------------------------------------------------------
 Add-on version: 17.0.12
 You are running the latest version of this add-on.
 System: Home Assistant OS 12.2  (aarch64 / raspberrypi4-64)
 Home Assistant Core: 2024.4.4
 Home Assistant Supervisor: 2024.04.0
-----------------------------------------------------------
 Please, share the above information when looking for help
 or support in, e.g., GitHub, forums or the Discord chat.
-----------------------------------------------------------
s6-rc: info: service base-addon-banner successfully started
s6-rc: info: service fix-attrs: starting
s6-rc: info: service base-addon-log-level: starting
s6-rc: info: service fix-attrs successfully started
s6-rc: info: service base-addon-log-level successfully started
s6-rc: info: service legacy-cont-init: starting
s6-rc: info: service legacy-cont-init successfully started
s6-rc: info: service init-nginx: starting
s6-rc: info: service init-customizations: starting
s6-rc: info: service init-customizations successfully started
s6-rc: info: service init-nodered: starting
s6-rc: info: service init-nginx successfully started

up to date, audited 110 packages in 4s

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

3 vulnerabilities (1 moderate, 2 critical)

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

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

Run `npm audit` for details.
npm notice 
npm notice New patch version of npm available! 10.5.0 -> 10.5.2
npm notice Changelog: <https://github.com/npm/cli/releases/tag/v10.5.2>
npm notice Run `npm install -g npm@10.5.2` to update!
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
s6-rc: info: service legacy-services successfully started
[14:37:13] INFO: Starting Node-RED...

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

24 Apr 14:37:18 - [info] 

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

24 Apr 14:37:18 - [info] Node-RED version: v3.1.9
24 Apr 14:37:18 - [info] Node.js  version: v18.20.2
24 Apr 14:37:18 - [info] Linux 6.1.73-haos-raspi arm64 LE
24 Apr 14:37:19 - [info] Loading palette nodes
24 Apr 14:37:21 - [info] Node-RED Contrib Theme Collection version: v3.1.11
24 Apr 14:37:25 - [info] Dashboard version 3.6.5 started at /endpoint/ui
24 Apr 14:37:28 - [info] Settings file  : /etc/node-red/config.js
24 Apr 14:37:28 - [info] Context store  : 'default' [module=memory]
24 Apr 14:37:28 - [info] User directory : /config/
24 Apr 14:37:28 - [warn] Projects disabled : editorTheme.projects.enabled=false
24 Apr 14:37:28 - [info] Flows file     : /config/flows.json
24 Apr 14:37:28 - [info] Server now running at http://127.0.0.1:46836/
24 Apr 14:37:28 - [info] Starting flows
[14:37:28] INFO: Starting NGinx...
24 Apr 14:37:28 - [info] Started flows
24 Apr 14:37:33 - [info] [server:Home Assistant] Connecting to http://supervisor/core
24 Apr 14:37:33 - [info] [server:Home Assistant] Connected to http://supervisor/core
24 Apr 15:06:03 - [info] [server:Home Assistant] Connection closed to http://supervisor/core
24 Apr 15:06:08 - [info] [server:Home Assistant] Connecting to http://supervisor/core
24 Apr 15:06:08 - [info] [server:Home Assistant] Connected to http://supervisor/core
24 Apr 15:10:48 - [error] [api-call-service:Dryer on] Error: Unrecognized error: 3
24 Apr 15:10:49 - [error] [api-call-service:Red island light 2] Error: Unrecognized error: 3
24 Apr 15:10:50 - [info] [server:Home Assistant] Connection closed to http://supervisor/core
24 Apr 15:10:56 - [info] [server:Home Assistant] Connecting to http://supervisor/core
24 Apr 15:10:56 - [info] [server:Home Assistant] Connected to http://supervisor/core
sinclairpaul commented 2 months ago

Personally I would look at the errors reported:

24 Apr 15:10:48 - [error] [api-call-service:Dryer on] Error: Unrecognized error: 3
24 Apr 15:10:49 - [error] [api-call-service:Red island light 2] Error: Unrecognized error: 3

Either way this is likely to do with the Home Assistant nodes that the addon installs, I would suggest seeking help at https://github.com/zachowj/node-red-contrib-home-assistant-websocket