hassio-addons/addon-node-red

Startup fails after 7.1.0 update #663

ahertz posted onGitHub

Problem/Motivation

After updating to 7.1.0 this morning, Node Red fails to start in my HA instance. From the log, this appears to be a problem related to the node-red-contrib-function-npm node, but I wouldn't (naively) expect a bad node to keep the entire system from starting. I'm not at all sure this is the right place to file this bug, but I figured I'd post it here in case there's something to be done about it in this addon.

Expected behavior

Node Red starts up normally.

Actual behavior

Crashes with the following log:

[07:02:00] INFO: Starting Node-RED...
> addon-node-red@ start /opt
> node $NODE_OPTIONS node_modules/node-red/red.js "--settings" "/etc/node-red/config.js"
22 Aug 07:02:01 - [info] 
Welcome to Node-RED
===================
22 Aug 07:02:01 - [info] Node-RED version: v1.1.3
22 Aug 07:02:01 - [info] Node.js  version: v12.18.3
22 Aug 07:02:01 - [info] Linux 5.4.56 x64 LE
22 Aug 07:02:01 - [info] Loading palette nodes
22 Aug 07:02:04 - [info] Dashboard version 2.23.2 started at /endpoint/ui
/bin/sh: /opt/node_modules/node-red-node-pi-gpio/testgpio.py: not found
22 Aug 07:02:04 - [warn] rpi-gpio : Raspberry Pi specific node set inactive
22 Aug 07:02:04 - [info] Settings file  : /etc/node-red/config.js
22 Aug 07:02:04 - [info] Context store  : 'default' [module=memory]
22 Aug 07:02:04 - [info] User directory : /config/node-red/
22 Aug 07:02:04 - [warn] Projects disabled : editorTheme.projects.enabled=false
22 Aug 07:02:04 - [info] Flows file     : /config/node-red/flows.json
22 Aug 07:02:04 - [info] Server now running at http://127.0.0.1:46836/
22 Aug 07:02:04 - [info] Starting flows
22 Aug 07:02:05 - [info] Started flows
22 Aug 07:02:05 - [error] [api-current-state:Stop if already on] Entity could not be found in cache for entity_id:     switch.master_bath_toilet_fan
22 Aug 07:02:05 - [red] Uncaught Exception:
22 Aug 07:02:05 - TypeError: cb.apply is not a function
    at /config/node-red/node_modules/npm/node_modules/graceful-fs/polyfills.js:285:20
    at /config/node-red/node_modules/node-red-contrib-function-npm/node_modules/npm/node_modules/graceful-fs/polyfills.js:287:18
    at FSReqCallback.oncomplete (fs.js:169:5)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! addon-node-red@ start: `node $NODE_OPTIONS node_modules/node-red/red.js "--settings" "/etc/node-red/config.js"`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the addon-node-red@ start script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR!     /root/.npm/_logs/2020-08-22T11_02_05_731Z-debug.log

Steps to reproduce

(How can someone else make/see it happen)

Proposed changes

(If you have a proposed change, workaround or fix, describe the rationale behind it)


Looks like this is (mostly) my fault. I was running an old version of node-red-contrib-function-npm. Reverting to version 7.0.0, updating that node to the latest version, and then upgrading to 7.1.0 resolved the issue. I'm still surprised one bad node can kill the whole addon.

posted by ahertz over 4 years ago

Same here!

posted by artaxx81 over 4 years ago

It's an NPM package that is being installed, the challenge is that the nodes are installed via the Palette Manager, which in turn then adds them at a pinned version to the package.json.

You could do one of the following:

  • Ensure custom nodes are updated prior to upgrades
  • Install custom nodes using the addon configuration (the npm_packages option)
  • Edit the package.json file (although not recommended

In the situation above, Node-Red itself is throwing an exception, so I doubt there could be anything done to avoid this.

posted by sinclairpaul over 4 years ago

Fund this Issue

$0.00
Funded

Pull requests