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

NodeRed refuses to start #1519

Closed
Rainerxyz opened this issue Aug 30, 2024 · 1 comment · Fixed by #1517
Closed

NodeRed refuses to start #1519

Rainerxyz opened this issue Aug 30, 2024 · 1 comment · Fixed by #1517

Comments

@Rainerxyz
Copy link

Describe the bug

NodeRed refuses to start if the following is configured:

  1. A node whose "Output at startup" is active connected to a node that reads an entity-state.
  2. The nodes I tested for obtaining the entity-state are the "wait until" and "current state" nodes.
  3. Set the timeout of these node to a low value like 1 second.
    The logs will reflect the missing entities which is normal but the timeout's are causing the fatal behavior.
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

To Reproduce

  1. Make sure that NodeRed is in non-save-mode.
  2. Create the underneath flow.
  3. Restart NodeRed still in non-save-mode.

Expected behavior

As in previous versions, NodeRed should start without problems.

Screenshots

image

Example Flow

[{"id":"dfac819e3c8497e1","type":"inject","z":"1a05f4c480d4570e","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":true,"onceDelay":"1","topic":"","payload":"","payloadType":"date","x":190,"y":1240,"wires":[["3d32251441a21cf6","195f2e14912eb902"]]},{"id":"3d32251441a21cf6","type":"ha-wait-until","z":"1a05f4c480d4570e","name":"Test","server":"134b3028.ed8c4","version":3,"outputs":2,"entities":{"entity":["input_boolean.zonneschermentest"],"substring":[],"regex":[]},"property":"state","comparator":"is","value":"on","valueType":"str","timeout":"1","timeoutType":"num","timeoutUnits":"seconds","checkCurrentState":true,"blockInputOverrides":true,"outputProperties":[],"x":340,"y":1240,"wires":[["318a79177d87cca2"],[]]},{"id":"318a79177d87cca2","type":"debug","z":"1a05f4c480d4570e","name":"debug 5","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":500,"y":1240,"wires":[]},{"id":"195f2e14912eb902","type":"api-current-state","z":"1a05f4c480d4570e","name":"Test","server":"134b3028.ed8c4","version":3,"outputs":2,"halt_if":"on","halt_if_type":"str","halt_if_compare":"is","entity_id":"input_boolean.zonneschermentest","state_type":"str","blockInputOverrides":false,"outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"entityState"},{"property":"data","propertyType":"msg","value":"","valueType":"entity"}],"for":"1","forType":"num","forUnits":"seconds","override_topic":false,"state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","x":340,"y":1290,"wires":[["318a79177d87cca2"],[]]},{"id":"134b3028.ed8c4","type":"server","name":"Home Assistant","version":5,"addon":true,"rejectUnauthorizedCerts":true,"ha_boolean":"y|yes|true|on|home|open","connectionDelay":true,"cacheJson":true,"heartbeat":false,"heartbeatInterval":30,"areaSelector":"friendlyName","deviceSelector":"friendlyName","entitySelector":"friendlyName","statusSeparator":"at: ","statusYear":"hidden","statusMonth":"short","statusDay":"numeric","statusHourCycle":"h23","statusTimeFormat":"h:m","enableGlobalContextStore":true}]

Environment Information

Version: 0.68.7

Home Assistant version: 2024.8.3
Companion version: 0.0.0

Node-RED version: 4.0.2
Docker: yes
Add-on: no

Node.js version: v18.20.3 arm64 linux
OS: Linux 6.6.46-haos arm64

Additional context

No response

@Rainerxyz
Copy link
Author

Works great! Thanks a lot for the quick fix!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant