Node Red not starting since I updated some nodes to the latest version

Node Red refuses to start after I updated some nodes to the latest version (not sure which). The first error in the logs reflect that one of my Entities could not be found but there is no problem with it. I restarted the entire system with no change. Here the relevant logs:

[16:29:16] INFO: Starting NGinx...
29 Aug 16:29:16 - [info] Starting flows
29 Aug 16:29:17 - [info] Started flows
29 Aug 16:29:19 - [error] [ha-wait-until:WkLampen Aan?] InputError: Entity (input_boolean.woonkamerlampen) could not be found
29 Aug 16:29:19 - [error] [ha-wait-until:WkLampen Aan?] InputError: Entity (input_boolean.woonkamerlampen) could not be found
29 Aug 16:29:20 - [red] Uncaught Exception:
29 Aug 16:29:20 - [error] TypeError: Cannot read properties of null (reading 'last_changed')
    at __classPrivateFieldSet.done.done (/config/node_modules/node-red-contrib-home-assistant-websocket/dist/nodes/wait-until/WaitUntilController.js:115:53)
    at Timeout._onTimeout (/config/node_modules/node-red-contrib-home-assistant-websocket/dist/common/errors/inputErrorHandler.js:70:13)
    at listOnTimeout (node:internal/timers:569:17)
    at processTimers (node:internal/timers:512:7)
[16:29:20] 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
[16:29:20] INFO: Service NGINX exited with code 0 (by signal 0)

Any idea what could be wrong? Thanks!

Try version v0.68.7

Many thanks for the quick response!
I’m not able to access NodeRed, it’s not starting. How can I lookup the current version and how can I update to v0.68.7, where can I find the files? Sorry if this is a stupid question, never looked into this.

How are you running NR? You should be able to boot NR into safe-word and update the package.

If you’re running it in docker you can add the the environment variable NODE_RED_ENABLE_SAFE_MODE: true

I’m running NR from the HA-addon. In there I tried to start in save mode as documented, adding “save_mode = true” to the config of the addon but it still won’t start.
My installation is Docker-based.

If you’re running the addon you would add it to you add-on config

https://github.com/hassio-addons/addon-node-red/blob/f2130f0e9923455a83c533167e4f9a2a209d4f32/node-red/DOCS.md#option-safe_mode

If it still doesn’t start what error is it throwing?

Okay, Kermit. NR is now starting in save-mode. I’m not sure what the problem was but I tried to configure save-mode in YAML but later I found this in the UI. In YAML the UI-setting is reflecting the same as I did but the case is different. Anyway, I managed to update then node to 0.68.7 but unfortunately without change, the errors in the log are still the same as before. See the complete log, maybe I’m missing something. Thanks a lot so far!

npm audit fix --force

Run `npm audit` for details.
npm notice
npm notice New minor version of npm available! 10.7.0 -> 10.8.3
npm notice Changelog: https://github.com/npm/cli/releases/tag/v10.8.3
npm notice To update run: npm install -g [email protected]
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
[21:15:34] INFO: Starting Node-RED...

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

29 Aug 21:15:36 - [info] 

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

29 Aug 21:15:36 - [info] Node-RED version: v4.0.2
29 Aug 21:15:36 - [info] Node.js  version: v18.20.3
29 Aug 21:15:36 - [info] Linux 6.6.46-haos arm64 LE
29 Aug 21:15:36 - [info] Loading palette nodes
29 Aug 21:15:37 - [info] Node-RED Contrib Theme Collection version: v4.0.8
29 Aug 21:15:39 - [info] Dashboard version 3.6.5 started at /endpoint/ui
29 Aug 21:15:40 - [info] Settings file  : /etc/node-red/config.js
29 Aug 21:15:40 - [info] Context store  : 'default' [module=memory]
29 Aug 21:15:40 - [info] User directory : /config/
29 Aug 21:15:40 - [warn] Projects disabled : editorTheme.projects.enabled=false
29 Aug 21:15:40 - [info] Flows file     : /config/flows.json
29 Aug 21:15:40 - [info] Server now running at http://127.0.0.1:46836/
[21:15:40] INFO: Starting NGinx...
29 Aug 21:15:40 - [info] Starting flows
29 Aug 21:15:40 - [info] Started flows
29 Aug 21:15:42 - [error] [ha-wait-until:WkLampen Aan?] InputError: Entity (input_boolean.woonkamerlampen) could not be found
29 Aug 21:15:42 - [error] [ha-wait-until:WkLampen Aan?] InputError: Entity (input_boolean.woonkamerlampen) could not be found
29 Aug 21:15:43 - [red] Uncaught Exception:
29 Aug 21:15:43 - [error] TypeError: Cannot read properties of null (reading 'last_changed')
    at __classPrivateFieldSet.done.done (/config/node_modules/node-red-contrib-home-assistant-websocket/dist/nodes/wait-until/WaitUntilController.js:115:53)
    at Timeout._onTimeout (/config/node_modules/node-red-contrib-home-assistant-websocket/dist/common/errors/inputErrorHandler.js:70:13)
    at listOnTimeout (node:internal/timers:569:17)
    at processTimers (node:internal/timers:512:7)
[21:15:43] 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
[21:15:44] 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 base-addon-log-level successfully stopped
s6-rc: info: service fix-attrs 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
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: 18.0.5
 You are running the latest version of this add-on.
 System: Home Assistant OS 13.1  (aarch64 / odroid-n2)
 Home Assistant Core: 2024.8.3
 Home Assistant Supervisor: 2024.08.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

Every time the add-on restarts it installs its default version. Which at the moment is not the latest.

Try adding node-red-contrib-home-assistant-websocket@latest in the add-on under npm_packages. After the addon is updated, this can be removed unless you always want to be running the latest version.

Thanks a lot, Kermit!
But still the same. As you can see in the logs, the notices are now gone but the errors remain. Any other idea?

29 Aug 22:05:05 - [info] Node.js  version: v18.20.3
29 Aug 22:05:05 - [info] Linux 6.6.46-haos arm64 LE
29 Aug 22:05:05 - [info] Loading palette nodes
29 Aug 22:05:06 - [info] Node-RED Contrib Theme Collection version: v4.0.8
29 Aug 22:05:08 - [info] Dashboard version 3.6.5 started at /endpoint/ui
29 Aug 22:05:09 - [info] Settings file  : /etc/node-red/config.js
29 Aug 22:05:09 - [info] Context store  : 'default' [module=memory]
29 Aug 22:05:09 - [info] User directory : /config/
29 Aug 22:05:09 - [warn] Projects disabled : editorTheme.projects.enabled=false
29 Aug 22:05:09 - [info] Flows file     : /config/flows.json
29 Aug 22:05:09 - [info] Server now running at http://127.0.0.1:46836/
29 Aug 22:05:09 - [info] Starting flows
[22:05:09] INFO: Starting NGinx...
29 Aug 22:05:10 - [info] Started flows
29 Aug 22:05:12 - [error] [ha-wait-until:WkLampen Aan?] InputError: Entity (input_boolean.woonkamerlampen) could not be found
29 Aug 22:05:12 - [error] [ha-wait-until:WkLampen Aan?] InputError: Entity (input_boolean.woonkamerlampen) could not be found
29 Aug 22:05:13 - [red] Uncaught Exception:
29 Aug 22:05:13 - [error] TypeError: Cannot read properties of null (reading 'last_changed')
    at __classPrivateFieldSet.done.done (/config/node_modules/node-red-contrib-home-assistant-websocket/dist/nodes/wait-until/WaitUntilController.js:115:53)
    at Timeout._onTimeout (/config/node_modules/node-red-contrib-home-assistant-websocket/dist/common/errors/inputErrorHandler.js:70:13)
    at listOnTimeout (node:internal/timers:569:17)
    at processTimers (node:internal/timers:512:7)
[22:05:13] 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
[22:05:13] 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
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: 18.0.5
 You are running the latest version of this add-on.
 System: Home Assistant OS 13.1  (aarch64 / odroid-n2)
 Home Assistant Core: 2024.8.3
 Home Assistant Supervisor: 2024.08.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
[22:05:17] INFO: Starting installation of custom NPM/Node-RED packages...
s6-rc: info: service init-nginx successfully started
npm warn config optional Use `--omit=optional` to exclude optional dependencies, or
npm warn config `--include=optional` to include them.
npm warn config
npm warn config       Default value does install optional deps unless otherwise omitted.
npm warn config only Use `--omit=dev` to omit dev dependencies from the install.

removed 1 package, changed 7 packages, and audited 620 packages in 9s

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

16 vulnerabilities (6 moderate, 10 high)

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.3
npm notice Changelog: https://github.com/npm/cli/releases/tag/v10.8.3
npm notice To update run: npm install -g [email protected]
npm notice
s6-rc: info: service init-customizations successfully started
s6-rc: info: service init-nodered: starting

I’m sorry, I now see the notices at the end, so they are not gone.

The errors in that log are from a previous load and the bottom of the current logs show that it hasn’t finished loading give it a minute.

Makes sense, the notices are gone but not the errors. If I open NR (in save-mode) I have access to the UI and if I change something and deploy then I get the same errors as in the log, stating that this entity is missing. Then NR will restart.
I also notice that the “BooleanLogicUltimate”-node is twice as big as it was before. To my knowledge, this was one of the nodes that I updated before the problem occurred. Does this change in size have a certain meaning?

The entity missing is not an error. It’s a new feature that tells you to have nodes that are using entities not found in Home Assistant.

https://github.com/zachowj/node-red-contrib-home-assistant-websocket/releases/tag/v0.68.0

Features

  • issues: Implement issue detection for Home Assistant nodes
  • Added functionality to check Home Assistant nodes for issues on deploy and at regular intervals.
  • Checks include validation of entity IDs, area IDs, device IDs, floor IDs, and label IDs.

Nice feature but in my case it’s introducing a big problem, it causes that NR refuses to start. Here some details of what I found so far: in save-mode starting NR I discovered two nodes that could not found their configured entity, both the same. These nodes are “wait-until”-nodes. Ones these are disabled, NR will start, even without save-mode. Also in non-save-mode I enabled these nodes and all seems to work, meaning that they have no problems with finding the entity. Restarting will again prevent NR from starting. I also tested the same with a different entity, also an “input_boolean”-switch, and this appeared to work, so NR starting in non-save-mode. So I can conclude that the problem is caused by a combination of a certain entity (no idea why it’s this) and the type of node (wait until), different node-types that use the same entity are also configured but are not causing problems. My next step will be a bug-report regarding the websocket and try to find a workaround.
For now, thank you so much for your help and quick responses, with your help I was able to got closer to the cause of this problem and I learned about things in NR I didn’t know before.