Node-Red container won't restart after adding a node

Node-Red Docker container won't restart after adding a node

I'm hoping that someone can help me, perhaps someone who uses Docker has had the same problem.

I was playing about adding a Node for IFTTT, and left a port for '80' in the config. Since doing this, the Container crashed and I cannot restart the Container. Is there a way to recover from this?

I get the following log....

Your flow credentials file is encrypted using a system-generated key.



If the system-generated key is lost for any reason, your credentials

file will not be recoverable, you will have to delete it and re-enter

your credentials.



You should set your own key using the 'credentialSecret' option in

your settings file. Node-RED will then re-encrypt your credentials

file using your chosen key the next time you deploy a change.

---------------------------------------------------------------------



7 Dec 20:08:17 - [info] Starting flows

7 Dec 20:08:17 - [info] Added IFTTT express routes.

7 Dec 20:08:17 - [info] [ifttt-broker:MyWebHook] IFTTT broker listening on port 80

7 Dec 20:08:18 - [info] Started flows

7 Dec 20:08:18 - [red] Uncaught Exception:

7 Dec 20:08:18 - Error: listen EACCES: permission denied 0.0.0.0:80

    at Server.setupListenHandle [as _listen2] (net.js:1263:19)

    at listenInCluster (net.js:1328:12)

    at Server.listen (net.js:1415:7)

    at Function.listen (/data/node_modules/express/lib/application.js:618:24)

    at new IFTTTBrokerNode (/data/node_modules/node-red-contrib-ifttt-broker/ifttt-broker.js:42:29)

    at Object.createNode (/usr/src/node-red/node_modules/@node-red/runtime/lib/nodes/flows/util.js:483:31)

    at Flow.start (/usr/src/node-red/node_modules/@node-red/runtime/lib/nodes/flows/Flow.js:167:44)

    at start (/usr/src/node-red/node_modules/@node-red/runtime/lib/nodes/flows/index.js:345:33)

    at tryCatchReject (/usr/src/node-red/node_modules/when/lib/makePromise.js:845:30)

    at runContinuation1 (/usr/src/node-red/node_modules/when/lib/makePromise.js:804:4)

npm ERR! code ELIFECYCLE

npm ERR! errno 1

npm ERR! node-red-docker@1.0.5 start: `node $NODE_OPTIONS node_modules/node-red/red.js $FLOWS "--userDir" "/data"`

npm ERR! Exit status 1

npm ERR! 

npm ERR! Failed at the node-red-docker@1.0.5 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!     /usr/src/node-red/.npm/_logs/2020-12-07T20_08_18_048Z-debug.log



> node-red-docker@1.0.5 start /usr/src/node-red

> node $NODE_OPTIONS node_modules/node-red/red.js $FLOWS "--userDir" "/data"



7 Dec 20:08:46 - [info] 



Welcome to Node-RED

===================



7 Dec 20:08:46 - [info] Node-RED version: v1.0.5

7 Dec 20:08:46 - [info] Node.js  version: v10.20.0

7 Dec 20:08:46 - [info] Linux 5.0.0-32-generic x64 LE

7 Dec 20:08:46 - [info] Loading palette nodes

7 Dec 20:08:47 - [info] Dashboard version 2.20.0 started at /ui

7 Dec 20:08:47 - [info] Settings file  : /data/settings.js

7 Dec 20:08:47 - [info] Context store  : 'default' [module=memory]

7 Dec 20:08:47 - [info] User directory : /data

7 Dec 20:08:47 - [warn] Projects disabled : editorTheme.projects.enabled=false

7 Dec 20:08:47 - [info] Flows file     : /data/flows.json

7 Dec 20:08:47 - [info] Server now running at http://127.0.0.1:1880/

7 Dec 20:08:47 - [warn]

I am not up to speed on docker but if you can add a startup parammeter you could add --safe to start up node-red in safe mode.

alternatively if you can access the file system, you could rename the xxx_flow.json file and restart - this way node-red wont load and run your flow.

Hi Steve, thanks for the reply - I didn't realise I had one!
I managed to find where the docker files where, I got it working again by deleting the ‘.flows.json’ file and renaming the ‘.flows.json.backup’ to ‘.flows.json'.