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

NR addon crashes on every launch #1419

Closed
Stooovie opened this issue Aug 6, 2022 · 10 comments
Closed

NR addon crashes on every launch #1419

Stooovie opened this issue Aug 6, 2022 · 10 comments
Labels
stale There has not been activity on this issue or PR for quite some time.

Comments

@Stooovie
Copy link

Stooovie commented Aug 6, 2022

Node Red addon 13.3.1 running on HA 2022.8.1 (HAOS) crashes on every launch.

I haven't been able to run it at all.

up to date, audited 117 packages in 11s
3 packages are looking for funding
  run `npm fund` for details
15 vulnerabilities (3 low, 3 moderate, 6 high, 3 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.
cont-init: info: /etc/cont-init.d/node-red.sh exited 0
s6-rc: info: service legacy-cont-init successfully started
s6-rc: info: service legacy-services: starting
services-up: info: copying legacy longrun nginx (no readiness notification)
services-up: info: copying legacy longrun nodered (no readiness notification)
s6-rc: info: service legacy-services successfully started
[23:49:36] INFO: Starting Node-RED...
> start
> node $NODE_OPTIONS node_modules/node-red/red.js "--settings" "/etc/node-red/config.js"
6 Aug 23:49:40 - [info] 
Welcome to Node-RED
===================
6 Aug 23:49:40 - [info] Node-RED version: v3.0.2
6 Aug 23:49:40 - [info] Node.js  version: v16.16.0
6 Aug 23:49:40 - [info] Linux 5.15.32-v8 arm64 LE
6 Aug 23:49:42 - [info] Loading palette nodes
6 Aug 23:49:49 - [info] Dashboard version 3.1.7 started at /endpoint/ui
6 Aug 23:49:50 - [warn] ------------------------------------------------------
6 Aug 23:49:50 - [warn] [node-red-contrib-mi-devices/xiaomi-yeelight] Error: Cannot find module '/config/node-red/node_modules/node-red-contrib-mi-devices/dist/nodes/yeelight/index.js'
Require stack:
- /opt/node_modules/@node-red/registry/lib/loader.js
- /opt/node_modules/@node-red/registry/lib/index.js
- /opt/node_modules/@node-red/runtime/lib/nodes/index.js
- /opt/node_modules/@node-red/runtime/lib/index.js
- /opt/node_modules/node-red/lib/red.js
- /opt/node_modules/node-red/red.js
6 Aug 23:49:50 - [warn] [node-red-contrib-mi-sensors/xiaomi-ht] 'xiaomi-ht' already registered by module node-red-contrib-mi-devices
6 Aug 23:49:50 - [warn] [node-red-contrib-mi-sensors/xiaomi-magnet] 'xiaomi-magnet' already registered by module node-red-contrib-mi-devices
6 Aug 23:49:50 - [warn] [node-red-contrib-mi-sensors/xiaomi-motion] 'xiaomi-motion' already registered by module node-red-contrib-mi-devices
6 Aug 23:49:50 - [warn] [node-red-contrib-mi-sensors/xiaomi-switch] 'xiaomi-switch' already registered by module node-red-contrib-mi-devices
6 Aug 23:49:50 - [warn] [node-red-contrib-mi-sensors/xiaomi-socket] 'xiaomi-plug' already registered by module node-red-contrib-mi-devices
6 Aug 23:49:50 - [warn] [node-red-contrib-mi-sensors/xiaomi-socket-wifi] 'xiaomi-plug-wifi' already registered by module node-red-contrib-mi-devices
6 Aug 23:49:50 - [warn] [node-red-contrib-mi-sensors/xiaomi-all] 'xiaomi-all' already registered by module node-red-contrib-mi-devices
6 Aug 23:49:50 - [warn] [node-red-contrib-mi-sensors/xiaomi-configurator] 'xiaomi-configurator' already registered by module node-red-contrib-mi-devices
6 Aug 23:49:50 - [warn] [node-red-contrib-mi-sensors/xiaomi-gateway] 'xiaomi-gateway out' already registered by module node-red-contrib-mi-devices
6 Aug 23:49:50 - [warn] [node-red-contrib-mi-sensors/xiaomi-actions] 'xiaomi-actions toggle' already registered by module node-red-contrib-mi-devices
6 Aug 23:49:50 - [warn] ------------------------------------------------------
6 Aug 23:49:50 - [warn] Missing node modules:
6 Aug 23:49:50 - [warn]  - node-red-contrib-timecheck (1.1.0): timecheck
6 Aug 23:49:50 - [warn]  - node-red-contrib-actionflows (2.0.4): actionflows, actionflows_in, actionflows_out
6 Aug 23:49:50 - [warn]  - node-red-contrib-http-request (0.1.14): www-request
6 Aug 23:49:50 - [warn]  - node-red-contrib-looptimer (0.0.8): looptimer
6 Aug 23:49:50 - [warn]  - node-red-contrib-statistics (2.2.2): statistics
6 Aug 23:49:50 - [warn]  - node-red-contrib-stoptimer (0.0.7): stoptimer
6 Aug 23:49:50 - [warn]  - node-red-contrib-alexa-home-skill (0.1.19): alexa-home-conf, alexa-home, alexa-home-resp
6 Aug 23:49:50 - [warn]  - node-red-contrib-traffic (0.2.1): traffic
6 Aug 23:49:50 - [warn]  - node-red-node-geofence (0.3.0): geofence
6 Aug 23:49:50 - [warn]  - node-red-node-msgpack (1.2.1): msgpack
6 Aug 23:49:50 - [warn]  - node-red-node-sentiment (0.1.6): sentiment
6 Aug 23:49:50 - [warn]  - node-red-node-pi-gpio (1.2.3): rpi-gpio in, rpi-gpio out, rpi-mouse, rpi-keyboard
6 Aug 23:49:50 - [info] Removing modules from config
6 Aug 23:49:50 - [info] Settings file  : /etc/node-red/config.js
6 Aug 23:49:50 - [info] Context store  : 'default' [module=memory]
6 Aug 23:49:50 - [info] User directory : /config/node-red/
6 Aug 23:49:50 - [warn] Projects disabled : editorTheme.projects.enabled=false
6 Aug 23:49:50 - [info] Flows file     : /config/node-red/flows.json
6 Aug 23:49:50 - [red] Uncaught Exception:
6 Aug 23:49:50 - [error] TypeError: Cannot read properties of null (reading 'allNodes')
    at Object.eachNode (/opt/node_modules/@node-red/runtime/lib/flows/index.js:261:37)
    at YeelightSearch.<anonymous> (/config/node-red/node_modules/node-red-contrib-mi-sensors/dist/nodes/yeelight/Searcher.js:15:27)
    at YeelightSearch.emit (node:events:527:28)
    at YeelightSearch.addLight (/config/node-red/node_modules/yeelight-wifi/build/index.js:69:14)
    at SsdpClient.<anonymous> (/config/node-red/node_modules/yeelight-wifi/build/index.js:44:20)
    at SsdpClient.emit (node:events:527:28)
    at SsdpClient.parseResponse [as _parseResponse] (/config/node-red/node_modules/node-ssdp/lib/index.js:448:8)
    at SsdpClient.SSDP._parseMessage (/config/node-red/node_modules/node-ssdp/lib/index.js:289:10)
    at Socket.onSocketMessage (/config/node-red/node_modules/node-ssdp/lib/index.js:241:12)
    at Socket.emit (node:events:527:28)
    at UDP.onMessage (node:dgram:922:8)
[23:49:50] WARNING: Node-RED crashed, halting add-on
s6-rc: info: service legacy-services: stopping
[23:49:50] INFO: Node-RED stoped, restarting...
[23:49:50] INFO: Node-RED stoped, restarting...
[23:49:50] INFO: nginx stoped, restarting...
s6-svwait: fatal: supervisor died
s6-rc: info: service legacy-services 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 fix-attrs successfully stopped
s6-rc: info: service s6rc-oneshot-runner: stopping
s6-rc: info: service s6rc-oneshot-runner successfully stopped
@Stooovie
Copy link
Author

Stooovie commented Aug 6, 2022

I solved this by deleting the old NR config folder from /config.

@jofleck
Copy link

jofleck commented Aug 7, 2022

Same issue with a fresh install

@DaveR66
Copy link

DaveR66 commented Aug 13, 2022

This has hit me pretty hard as I have lots of flows in NR.

Deleted the config folder completely after taking a backup, removed and reinstalled NR addon and the logs run clean but when HA never recognises it as started. If you browse to https://Your_HA_IP/1800 then the NR dashboard comes up fine.

This looks like a permissions error in either HA or HACS, not a NR issue.

@frenck How do we get this escalated to the correct people?

Add-on: Node-RED
Flow-based programming for the Internet of Things

Add-on version: 13.3.1
You are running the latest version of this add-on.
System: Home Assistant OS 8.4 (armv7 / raspberrypi3)
Home Assistant Core: 2022.8.4
Home Assistant Supervisor: 2022.08.3

@DaveR66
Copy link

DaveR66 commented Aug 13, 2022

Quick update, After much messing, copying the config backup and restarting I finally got all my flows back but only connecting to ip:1880 directly. NR complained about a missing Hue Node and I added that in manually and it went into a crash and died. Copied the config files back over again and it's all up and running.

BUT HA sidebar link still stays HA isn't running, and so does the addon page indicator. Flows work when triggered and affect the various things that they should.

Log files say all ok - just the HA interface disagrees

Add-on version: 13.3.1
You are running the latest version of this add-on.
System: Home Assistant OS 8.4 (armv7 / raspberrypi3)
Home Assistant Core: 2022.8.4
Home Assistant Supervisor: 2022.08.3

Please, share the above information when looking for help
or support in, e.g., GitHub, forums or the Discord chat.

cont-init: info: /etc/cont-init.d/00-banner.sh exited 0
cont-init: info: running /etc/cont-init.d/01-log-level.sh
cont-init: info: /etc/cont-init.d/01-log-level.sh exited 0
cont-init: info: running /etc/cont-init.d/customizations.sh
cont-init: info: /etc/cont-init.d/customizations.sh exited 0
cont-init: info: running /etc/cont-init.d/nginx.sh
cont-init: info: /etc/cont-init.d/nginx.sh exited 0
cont-init: info: running /etc/cont-init.d/node-red.sh
patching file nodes/ui_base.html
Hunk #1 succeeded at 1164 (offset 633 lines).
removed 36 packages, and audited 764 packages in 44s
51 vulnerabilities (11 moderate, 34 high, 6 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.
cont-init: info: /etc/cont-init.d/node-red.sh exited 0
s6-rc: info: service legacy-cont-init successfully started
s6-rc: info: service legacy-services: starting
services-up: info: copying legacy longrun nginx (no readiness notification)
services-up: info: copying legacy longrun nodered (no readiness notification)
s6-rc: info: service legacy-services successfully started
[22:13:32] INFO: Starting Node-RED...

start
node $NODE_OPTIONS node_modules/node-red/red.js "--settings" "/etc/node-red/config.js"
13 Aug 22:13:38 - [info]
Welcome to Node-RED
===================
13 Aug 22:13:38 - [info] Node-RED version: v3.0.2
13 Aug 22:13:38 - [info] Node.js version: v16.16.0
13 Aug 22:13:38 - [info] Linux 5.15.32-v7 arm LE
13 Aug 22:13:41 - [info] Loading palette nodes
13 Aug 22:13:49 - [info] Dashboard version 2.25.0 started at /endpoint/ui
/bin/sh: /config/node-red/node_modules/node-red-node-pi-gpio/testgpio.py: not found
13 Aug 22:13:49 - [warn] rpi-gpio : Raspberry Pi specific node set inactive
13 Aug 22:13:53 - [info] Settings file : /etc/node-red/config.js
13 Aug 22:13:53 - [info] Context store : 'default' [module=memory]
13 Aug 22:13:53 - [info] User directory : /config/node-red/
13 Aug 22:13:53 - [warn] Projects disabled : editorTheme.projects.enabled=false
13 Aug 22:13:53 - [info] Flows file : /config/node-red/flows.json
13 Aug 22:13:54 - [info] Server now running at http://127.0.0.1:46836/
13 Aug 22:13:54 - [info] Starting flows
[22:13:54] INFO: Starting NGinx...
13 Aug 22:13:56 - [info] Started flows
13 Aug 22:13:59 - [info] [server:Home Assistant] Connecting to http://supervisor/core
13 Aug 22:13:59 - [info] [server:Home Assistant] Connected to http://supervisor/core

@xinyuwuhenwyx
Copy link

s6-rc: info: service s6rc-oneshot-runner: starting
s6-rc: info: service s6rc-oneshot-runner successfully started
s6-rc: info: service fix-attrs: starting
s6-rc: info: service fix-attrs successfully started
s6-rc: info: service legacy-cont-init: starting
cont-init: info: running /etc/cont-init.d/00-banner.sh

Add-on: Node-RED
Flow-based programming for the Internet of Things

Add-on version: 13.3.1
You are running the latest version of this add-on.
System: Debian GNU/Linux 10 (buster) (armhf / raspberrypi)
Home Assistant Core: 2022.8.4
Home Assistant Supervisor: 2022.08.3

Please, share the above information when looking for help
or support in, e.g., GitHub, forums or the Discord chat.

cont-init: info: /etc/cont-init.d/00-banner.sh exited 0
cont-init: info: running /etc/cont-init.d/01-log-level.sh
cont-init: info: /etc/cont-init.d/01-log-level.sh exited 0
cont-init: info: running /etc/cont-init.d/customizations.sh
cont-init: info: /etc/cont-init.d/customizations.sh exited 0
cont-init: info: running /etc/cont-init.d/nginx.sh
[00:01:07] FATAL:
[00:01:07] FATAL: SSL has been enabled using the 'ssl' option,
[00:01:08] FATAL: this requires a SSL certificate file which is
[00:01:08] FATAL: configured using the 'certfile' option in the
[00:01:08] FATAL: add-on configuration.
[00:01:08] FATAL:
[00:01:08] FATAL: Unfortunately, the file specified in the
[00:01:08] FATAL: 'certfile' option does not exists.
[00:01:08] FATAL:
[00:01:08] FATAL: Please ensure the certificate file exists and
[00:01:08] FATAL: is placed in the '/ssl/' directory.
[00:01:08] FATAL:
[00:01:08] FATAL: In case you don't have SSL yet, consider getting
[00:01:08] FATAL: a SSL certificate or setting the 'ssl' option
[00:01:08] FATAL: to 'false' in case you are not planning on using
[00:01:08] FATAL: SSL with this add-on.
[00:01:08] FATAL:
[00:01:08] FATAL: Check the add-on manual for more information.
[00:01:08] FATAL:
cont-init: info: /etc/cont-init.d/nginx.sh exited 1
cont-init: info: running /etc/cont-init.d/node-red.sh
[00:01:08] FATAL:
[00:01:08] FATAL: Configuration of this add-on is incomplete.
[00:01:08] FATAL:
[00:01:08] FATAL: Please be sure to set the "credential_secret" option.
[00:01:08] FATAL:
[00:01:08] FATAL: The credential secret is an encryption token, much like
[00:01:08] FATAL: a password, that is used by Node-RED for encrypting
[00:01:08] FATAL: credentials you put into Node-RED.
[00:01:08] FATAL:
[00:01:08] FATAL: Just like a password, a credential secret can be
[00:01:08] FATAL: anything you like. Just be sure to store it somewhere
[00:01:08] FATAL: safe for later, e.g., in case of a recovery.
[00:01:08] FATAL:
cont-init: info: /etc/cont-init.d/node-red.sh exited 1
cont-init: warning: some scripts exited nonzero
s6-rc: warning: unable to start service legacy-cont-init: command exited 1
/run/s6/basedir/scripts/rc.init: warning: s6-rc failed to properly bring all the services up! Check your logs (in /run/uncaught-logs/current if you have in-container logging) for more information.
prog: fatal: stopping the container.
s6-rc: info: service fix-attrs: stopping
s6-rc: info: service fix-attrs successfully stopped
s6-rc: info: service s6rc-oneshot-runner: stopping
s6-rc: info: service s6rc-oneshot-runner successfully stopped

@hauard
Copy link

hauard commented Sep 3, 2022

I had a crash on every start, not figuring out what causing it. It seemed nginx didn't want to start up.'

I figured out that under the "configuration" tab in NodeRed (in addons), I hadn't set a password for credential and http.
After setting a password, NodeRed startet without any issues.

@miguelgilmartinez
Copy link

miguelgilmartinez commented Sep 4, 2022

I fixed it by commenting these lines in Search.js:

RED.nodes.eachNode((tmpNode) => {
                   if (tmpNode.type.indexOf(`${constants_1.Constants.NODES_PREFIX}-yeelight configurator`) === 0) {
                      let tmpNodeInst = RED.nodes.getNode(tmpNode.id);
                        if (tmpNodeInst.ip === bulb.hostname || tmpNodeInst.sid === parseInt(bulb.id)) {
                            tmpNodeInst.setBulb(bulb);
                        }
                    }
                });

@github-actions
Copy link

github-actions bot commented Oct 4, 2022

There hasn't been any activity on this issue recently, so we clean up some of the older and inactive issues.
Please make sure to update to the latest version and check if that solves the issue. Let us know if that works for you by leaving a comment 👍
This issue has now been marked as stale and will be closed if no further activity occurs. Thanks!

@github-actions github-actions bot added the stale There has not been activity on this issue or PR for quite some time. label Oct 4, 2022
@artpcpl
Copy link

artpcpl commented Oct 5, 2022

Same issue.
Node-RED crashed, halting add-on

Node Red addon 13.4.0 node-red-contrib-home-assistant-websocket 0.45.8

Home Assistant 2022.9.7
Supervisor 2022.09.1

[ 'payload', 'brightness' ]
5 Oct 00:01:12 - [info] [astrodata sunposition:c580c0b29f81d901] JD0: 2459856.5Date:Wed Oct 05 2022 00:01:12 GMT+0200 (Central European Summer Time) TZ Offset: -120 User Offset: 0
5 Oct 00:01:12 - [info] [astrodata sunposition:c580c0b29f81d901] UTC Day: 4UTC Month:10 UTC Year:2022 UTC Hour:22 UTC Minute:1 UTC Second:12
5 Oct 00:01:12 - [info] [astrodata sunposition:c580c0b29f81d901] JD: 2459857.4175
5 Oct 00:01:12 - [info] [astrodata sunposition:c580c0b29f81d901] DeltaT: 65
5 Oct 00:01:12 - [info] [astrodata sunposition:c580c0b29f81d901] gmst: 22:55:30
5 Oct 00:01:12 - [info] [astrodata sunposition:c580c0b29f81d901] lmst: 02:25:30
5 Oct 00:01:15 - [red] Uncaught Exception:
5 Oct 00:01:15 - [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 "3".
[00:01:16] WARNING: Node-RED crashed, halting add-on
[00:01:16] INFO: Node-RED stopped, restarting...
s6-rc: info: service legacy-services: stopping
[00:01:16] INFO: Node-RED stopped, restarting...
s6-svwait: fatal: supervisor died
s6-rc: info: service legacy-services 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 fix-attrs successfully stopped
s6-rc: info: service s6rc-oneshot-runner: stopping
s6-rc: info: service s6rc-oneshot-runner successfully stopped

@github-actions github-actions bot removed the stale There has not been activity on this issue or PR for quite some time. label Oct 6, 2022
@github-actions
Copy link

github-actions bot commented Nov 6, 2022

There hasn't been any activity on this issue recently, so we clean up some of the older and inactive issues.
Please make sure to update to the latest version and check if that solves the issue. Let us know if that works for you by leaving a comment 👍
This issue has now been marked as stale and will be closed if no further activity occurs. Thanks!

@github-actions github-actions bot added the stale There has not been activity on this issue or PR for quite some time. label Nov 6, 2022
@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Nov 14, 2022
@github-actions github-actions bot locked and limited conversation to collaborators Dec 14, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
stale There has not been activity on this issue or PR for quite some time.
Projects
None yet
Development

No branches or pull requests

7 participants