hassio-addons / addon-node-red

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

Node-Red does not start in Homeassistant OS 12.2 #1880

Closed JuliusH93 closed 1 week ago

JuliusH93 commented 1 month ago

Problem/Motivation

I upgraded to Homeassistant OS 12.2 and also updated the addon to the newest version 17.0.12.

Homeassistant Version:

Core 2024.4.4 Supervisor 2024.04.4 Operating System 12.2 Frontend 20240404.2

Expected behavior

The addon should start like it did before the update.

Actual behavior

There is an error loading a config while starting the addon. Logs:


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 / odroid-c4) Home Assistant Core: 2024.4.4 Home Assistant Supervisor: 2024.04.4

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 npm ERR! code EJSONPARSE npm ERR! path /config/package.json npm ERR! JSON.parse Unexpected end of JSON input while parsing empty string npm ERR! JSON.parse Failed to parse JSON data. npm ERR! JSON.parse Note: package.json must be actual JSON, not just JavaScript.

npm ERR! A complete log of this run can be found in: /root/.npm/_logs/2024-05-01T19_26_56_925Z-debug-0.log [21:26:58] WARNING: Failed un-installing conflicting packages 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:26:58] INFO: Setting safe mode startup [21:26:58] INFO: Starting Node-RED...

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

Error loading settings file: /etc/node-red/config.js SyntaxError: Error parsing /config/package.json: Unexpected end of JSON input at parse () at read (node:internal/modules/package_json_reader:79:16) at readPackage (node:internal/modules/package_json_reader:140:10) at Object.readPackageScope (node:internal/modules/package_json_reader:157:19) at Module._extensions..js (node:internal/modules/cjs/loader:1388:35) at Module.load (node:internal/modules/cjs/loader:1203:32) at Module._load (node:internal/modules/cjs/loader:1019:12) at Module.require (node:internal/modules/cjs/loader:1231:19) at require (node:internal/modules/helpers:177:18) at Object. (/etc/node-red/config.js:1:16) { path: '/config/package.json' } [21:27:02] 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:27:02] INFO: Service NGINX exited with code 256 (by signal 15) s6-rc: info: service nginx successfully stopped s6-rc: info: service init-nginx: stopping s6-rc: info: service nodered: stopping s6-rc: info: service init-nginx successfully stopped s6-rc: info: service nodered successfully stopped s6-rc: info: service init-nodered: stopping 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

Node red gets started with /etc/node-red/config.js as the settings file but i cannot find this path on my system.

Any help is highly appreciate since I have no idea how to fix this issue and get my flows running again.

berndeee commented 1 month ago

I've also been having issues since updating to Core 2024.4.4. Node-RED is now throwing "InputError: Integration not loaded." I need help! Thx

grafik

Feuerhamster commented 1 month ago

Same issue for me. Got the same errors as @berndeee

sinclairpaul commented 1 month ago

Two different issues here.

@JuliusH93 - There is an issue with the package.json by the looks of it, I would suggest checking the syntax with an editor such as Studo Code.

Others please don't randomly attach issues, your problem is with the Integration which you can find at https://github.com/zachowj/hass-node-red

berndeee commented 1 month ago

Same issue for me. Got the same errors as @berndeee

@Feuerhamster look at this https://community.home-assistant.io/t/node-red-error-after-updating-homeassistant-to-version-2024-5-0/724520

JuliusH93 commented 1 month ago

For some reason the update to Homeassistant 12.2 seemed to have corrupted the node-red config files.

I have now exported the flows from a backup prio to the update, completely removed the addon from the updated version with deleting all folders i could find (including the on in addon_configs) and reinstalled the addon again.

Now it is working and in could reimport the flows without any problems :)

For me the issue can be closed but is it normal that the update corrupted the node-red installation?

pfwei1029 commented 1 month ago

@JuliusH93 I met totally same problem. How did you solved this issue?

github-actions[bot] commented 2 weeks ago

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!