addon-node-red icon indicating copy to clipboard operation
addon-node-red copied to clipboard

Node-Red add-on 18.0.0 won't start.

Open SteveRMann opened this issue 1 year ago • 20 comments

I updated Node-Red add on (18.0.0) and now Node-red won’t start. Here is the log output.

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

/opt/node_modules/@node-red/util/lib/util.js:772
                })
                 ^

SyntaxError: Unexpected token ')'
    at internalCompileFunction (node:internal/vm:76:18)
    at wrapSafe (node:internal/modules/cjs/loader:1283:20)
    at Module._compile (node:internal/modules/cjs/loader:1328:27)
    at Module._extensions..js (node:internal/modules/cjs/loader:1422:10)
    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.<anonymous> (/opt/node_modules/@node-red/util/index.js:19:14)
    at Module._compile (node:internal/modules/cjs/loader:1364:14)

Node.js v18.20.3
[12:35:56] 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
[12:35:56] 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 nodered successfully stopped

SteveRMann avatar Jun 23 '24 03:06 SteveRMann

Exactly same issue here

doxxuni avatar Jun 23 '24 04:06 doxxuni

Exactly the same issue happended at my installation. I had to revert to 17.0.13 (restore automatical created backup before node-red upgrade) to get it running again.

Ventusfahrer avatar Jun 23 '24 08:06 Ventusfahrer

Same here. Restored backup to 17.0.13 made It work again.

nrsf avatar Jun 23 '24 10:06 nrsf

Same problem here. Tried to install Node Red 18 twice, still no luck. This is my log from Node Red 18:

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.0
 You are running the latest version of this add-on.
 System: Home Assistant OS 12.4  (amd64 / generic-x86-64)
 Home Assistant Core: 2024.6.4
 Home Assistant Supervisor: 2024.06.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 207 packages in 5s

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

13 vulnerabilities (1 low, 11 moderate, 1 high)

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 minor version of npm available! 10.7.0 -> 10.8.1
npm notice Changelog: https://github.com/npm/cli/releases/tag/v10.8.1
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
[13:42:57] INFO: Starting Node-RED...

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

/opt/node_modules/@node-red/util/lib/util.js:772
                })
                 ^

SyntaxError: Unexpected token ')'
    at internalCompileFunction (node:internal/vm:76:18)
    at wrapSafe (node:internal/modules/cjs/loader:1283:20)
    at Module._compile (node:internal/modules/cjs/loader:1328:27)
    at Module._extensions..js (node:internal/modules/cjs/loader:1422:10)
    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.<anonymous> (/opt/node_modules/@node-red/util/index.js:19:14)
    at Module._compile (node:internal/modules/cjs/loader:1364:14)

Node.js v18.20.3
[13:42:58] 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
[13:42:58] 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 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

thbrd avatar Jun 23 '24 11:06 thbrd

Does it start when safe mode is turned on?

frenck avatar Jun 23 '24 11:06 frenck

UPDATE While Checking the configuration, the update to version 18 enabled SLL again. Disabling the SSL function will start Node Red again for me.

Is it a problem to run Node Red local without SSL? I think its not but want to be sure :)

thbrd avatar Jun 23 '24 12:06 thbrd

How do I turn on safe mode?

jmsblah avatar Jun 23 '24 12:06 jmsblah

UPDATE

While Checking the configuration, the update to version 18 enabled SLL again. Disabling the SSL function will start Node Red again for me.

Is it a problem to run Node Red local without SSL? I think its not but want to be sure :)

Mine would work with SSL enabled in the previous version, not sure why I had it enabled tho.

jmsblah avatar Jun 23 '24 12:06 jmsblah

In the addon configuration I still had an initialization command for an old work around. Once I removed the command, the error went away. This was the command I removed:

sed -i "772,775d" /opt/node_modules/@node-red/util/lib/util.js

renlor16 avatar Jun 23 '24 12:06 renlor16

In the addon configuration I still had an initialization command for an old work around. Once I removed the command, the error went away. This was the command I removed:

sed -i "772,775d" /opt/node_modules/@node-red/util/lib/util.js

Very true, same for me. Thanks.

jmsblah avatar Jun 23 '24 12:06 jmsblah

In the addon configuration I still had an initialization command for an old work around. Once I removed the command, the error went away. This was the command I removed:

sed -i "772,775d" /opt/node_modules/@node-red/util/lib/util.js

Removing this also fixed my issue. Thank you!

Spross1 avatar Jun 23 '24 13:06 Spross1

In the addon configuration I still had an initialization command for an old work around. Once I removed the command, the error went away. This was the command I removed:

sed -i "772,775d" /opt/node_modules/@node-red/util/lib/util.js

Thanks, your post tweaks my memory about this fix. I will give that a try.

Boh1 avatar Jun 23 '24 18:06 Boh1

Thank you! It resolver the problema for me.

Em dom., 23 de jun. de 2024 09:42, renlor16 @.***> escreveu:

In the addon configuration I still had an initialization command for an old work around. Once I removed the command, the error went away. This was the command I removed:

sed -i "772,775d" @.***/util/lib/util.js

— Reply to this email directly, view it on GitHub https://github.com/hassio-addons/addon-node-red/issues/1898#issuecomment-2184974428, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACFJFQBK7N7OCECVT2UDSILZI27FDAVCNFSM6AAAAABJX6RNNOVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCOBUHE3TINBSHA . You are receiving this because you are subscribed to this thread.Message ID: @.***>

nrsf avatar Jun 23 '24 20:06 nrsf

Unfortunately my instance of node red will not start. I didn't have the JS work around implemented and no matter what I do with ssl or safe mode, it just spins. Is this a confirmed issue and if so, is a fix in the works? I don't want to restore if I don't have to.

aeicherly avatar Jun 24 '24 16:06 aeicherly

@aeicherly It will be hard to help you if you don't share any logs, configuration information or anything like that. Also, have you tried enabling safe mode? Did it make a difference?

frenck avatar Jun 24 '24 16:06 frenck

@aeicherly It will be hard to help you if you don't share any logs, configuration information or anything like that. Also, have you tried enabling safe mode? Did it make a difference?

Running in safe mode did not help. s6-rc-compile: fatal: invalid /etc/s6-overlay/s6-rc.d/init-customizations/type: must be oneshot, longrun, or bundle s6-rc: fatal: unable to take locks: No such file or directory s6-linux-init-shutdownd: warning: /run/s6/basedir/scripts/rc.shutdown exited 111

aeicherly avatar Jun 24 '24 16:06 aeicherly

@aeicherly It will be hard to help you if you don't share any logs, configuration information or anything like that. Also, have you tried enabling safe mode? Did it make a difference?

Running in safe mode did not help. s6-rc-compile: fatal: invalid /etc/s6-overlay/s6-rc.d/init-customizations/type: must be oneshot, longrun, or bundle s6-rc: fatal: unable to take locks: No such file or directory s6-linux-init-shutdownd: warning: /run/s6/basedir/scripts/rc.shutdown exited 111

My issue has been resolved with 18.0.1. Thanks!

aeicherly avatar Jun 27 '24 14:06 aeicherly

In the addon configuration I still had an initialization command for an old work around. Once I removed the command, the error went away. This was the command I removed:

sed -i "772,775d" /opt/node_modules/@node-red/util/lib/util.js

I remember doing this, but I don't remember where how, do you have the directions somewhere still? or a link to it :)

Ladybrinx avatar Jul 01 '24 19:07 Ladybrinx

In the addon configuration I still had an initialization command for an old work around. Once I removed the command, the error went away. This was the command I removed: sed -i "772,775d" /opt/node_modules/@node-red/util/lib/util.js

I remember doing this, but I don't remember where how, do you have the directions somewhere still? or a link to it :)

In the Node Red add-on (assuming that you are using the HA add-on), go to the Configuration tab and look for and remove that command text.

Restart the add-on for good measure and you should be golden.

Boh1 avatar Jul 01 '24 19:07 Boh1

I did find it after that, and then it started working, sorry I forgot to update here, but thank you! I'm so happy to have my automations working again!

Ladybrinx avatar Jul 01 '24 20:07 Ladybrinx

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[bot] avatar Aug 01 '24 08:08 github-actions[bot]