I was just making flow changes, and out of the blue when I pressed deploy, I got a server not responding message. I checked and the server is fine, but node-red isn't working anymore. When I try to stop it I get
Stopping Node-RED graphical event wiring tool...
nodered.service: State 'stop-sigterm' timed out. Killing.
nodered.service: Killing process 1542 (node-red) with signal SIGKILL.
nodered.service: Main process exited, code=killed, status=9/KILL
Stopped Node-RED graphical event wiring tool.
nodered.service: Unit entered failed state.
nodered.service: Failed with result 'timeout'.
It ends up stopped, and when I start it, everything looks like it's starting up, but I can't connect to it from my browser. What's my next step to bring it back to life?
18 Feb 20:03:13 - [info] Node-RED version: v0.19.5
18 Feb 20:03:13 - [info] Node.js version: v10.15.1
18 Feb 20:03:13 - [info] Linux 4.14.79-v7+ arm LE
18 Feb 20:03:14 - [info] Loading palette nodes
18 Feb 20:03:19 - [info] Dashboard version 2.13.2 started at /xxx/ui
18 Feb 20:03:19 - [info] Settings file : /home/user/.node-red/settings.js
18 Feb 20:03:19 - [info] Context store : 'default' [module=localfilesystem]
18 Feb 20:03:19 - [info] Context store : 'memory' [module=memory]
18 Feb 20:03:20 - [info] User directory : /home/user/.node-red
18 Feb 20:03:20 - [info] Server now running at https://127.0.0.1:nnn/xxx/
18 Feb 20:03:20 - [info] Active project : Automation
18 Feb 20:03:20 - [info] Flows file : /home/user/.node-red/projects/Automation/flows_home-assistant.json
18 Feb 20:03:20 - [info] Starting flows
18 Feb 20:03:20 - [info] Started flows
18 Feb 20:03:21 - [info] [server:Home Assistant] WebSocket Connected to https://xxx.duckdns.org:nnn
I was just playing around with a flow I' ve been working on for days. I'm working on a dashboard that sends out gets and posts to my Bose stereo. Nothing memorable right before the deploy that hung. I did apply an update to the websockets node that was installed. I have a connection to my Home Assistant instance that uses websockets. I haven't done anything with that part of my flow in a while. I restarted after that update and was working for a while before the problem. I have my project in git, and did a commit about an hour before this happened.
As far as I can tell, it doesn't come up. I can't connect to it fro my browser anymore. I just switched ports for a bit of added security. I'm not sure what websockets I have, and I don't know how to check with the system down.
Not only did I have a loop, but I had an infinite loop! And the icing on the cake is the fact that when my flow starts it has an injection node that calls that function immediately. Without that injection node the deploy would have returned successful, and NR would only have hung up when I manually called the function.
Some good lessons learned here for me.
node-red-stop will eventually stop NR, even when an infinite loop is running. It just takes a few minutes.
Once NR is stopped I can easily recover from the last flow saved in github.
Be very careful when using an injection node that is set to automatically inject after a deploy.