Node-red stopped working?

Hello, I've had Node-red running happily running for a long time but suddenly it's stopped. It appears to be running with over 100% usage report from TOP but no GUI or anything working - any ideas please?

top - 09:41:05 up 3 min, 2 users, load average: 1.06, 0.72, 0.31
Tasks: 163 total, 2 running, 161 sleeping, 0 stopped, 0 zombie
%Cpu(s): 0.4 us, 0.2 sy, 25.0 ni, 74.4 id, 0.0 wa, 0.0 hi, 0.0 si, 0.0 st
KiB Mem: 750636 total, 718816 used, 31820 free, 58152 buffers
KiB Swap: 102396 total, 1052 used, 101344 free. 151652 cached Mem

PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
455 pi 25 5 302276 181596 18100 R 99.6 24.2 3:11.88 node-red
1502 pi 20 0 5268 2540 2148 R 0.7 0.3 0:00.16 top
4 root 20 0 0 0 0 S 0.3 0.0 0:00.22 kworker/0:0
128 root 20 0 0 0 0 S 0.3 0.0 0:00.02 kworker/u8:2
518 mosquit+ 20 0 5092 3608 3212 S 0.3 0.5 0:00.35 mosquitto
605 root 20 0 16052 9068 7648 S 0.3 1.2 0:00.28 vncserver-x11-c
1485 pi 20 0 9380 3324 2676 S 0.3 0.4 0:00.02 sshd
1 root 20 0 5688 4088 2804 S 0.0 0.5 0:08.01 systemd
2 root 20 0 0 0 0 S 0.0 0.0 0:00.00 kthreadd
3 root 20 0 0 0 0 S 0.0 0.0 0:00.03 ksoftirqd/0
5 root 0 -20 0 0 0 S 0.0 0.0 0:00.00 kworker/0:0H
6 root 20 0 0 0 0 S 0.0 0.0 0:00.00 kworker/u8:0
7 root 20 0 0 0 0 S 0.0 0.0 0:00.25 rcu_sched
8 root 20 0 0 0 0 S 0.0 0.0 0:00.00 rcu_bh
9 root rt 0 0 0 0 S 0.0 0.0 0:00.02 migration/0
10 root 0 -20 0 0 0 S 0.0 0.0 0:00.00 lru-add-drain
11 root 20 0 0 0 0 S 0.0 0.0 0:00.00 cpuhp/0
12 root 20 0 0 0 0 S 0.0 0.0 0:00.00 cpuhp/1
13 root rt 0 0 0 0 S 0.0 0.0 0:00.01 migration/1
14 root 20 0 0 0 0 S 0.0 0.0 0:00.02 ksoftirqd/1
15 root 20 0 0 0 0 S 0.0 0.0 0:00.00 kworker/1:0
16 root 0 -20 0 0 0 S 0.0 0.0 0:00.00 kworker/1:0H
17 root 20 0 0 0 0 S 0.0 0.0 0:00.00 cpuhp/2
18 root rt 0 0 0 0 S 0.0 0.0 0:00.01 migration/2
19 root 20 0 0 0 0 S 0.0 0.0 0:00.01 ksoftirqd/2
20 root 20 0 0 0 0 S 0.0 0.0 0:00.00 kworker/2:0
21 root 0 -20 0 0 0 S 0.0 0.0 0:00.00 kworker/2:0H
22 root 20 0 0 0 0 S 0.0 0.0 0:00.00 cpuhp/3
23 root rt 0 0 0 0 S 0.0 0.0 0:00.01 migration/3
24 root 20 0 0 0 0 S 0.0 0.0 0:00.02 ksoftirqd/3
25 root 20 0 0 0 0 S 0.0 0.0 0:00.07 kworker/3:0
26 root 0 -20 0 0 0 S 0.0 0.0 0:00.00 kworker/3:0H
27 root 20 0 0 0 0 S 0.0 0.0 0:00.00 kdevtmpfs
28 root 0 -20 0 0 0 S 0.0 0.0 0:00.00 netns
29 root 20 0 0 0 0 S 0.0 0.0 0:00.00 khungtaskd
30 root 20 0 0 0 0 S 0.0 0.0 0:00.00 oom_reaper

pi@raspberrypi:~ $ node-red start
1 Jun 09:41:29 - [info]

Welcome to Node-RED

1 Jun 09:41:29 - [info] Node-RED version: v0.18.7
1 Jun 09:41:29 - [info] Node.js version: v6.14.4
1 Jun 09:41:29 - [info] Linux 4.9.35-v7+ arm LE
1 Jun 09:41:32 - [info] Loading palette nodes
1 Jun 09:41:39 - [warn] [chart request] Deprecated call to RED.runtime.nodes.registerType - node-set name must be provided as first argument
1 Jun 09:41:39 - [warn] [chart response] Deprecated call to RED.runtime.nodes.registerType - node-set name must be provided as first argument
1 Jun 09:41:40 - [info] Dashboard up and running
1 Jun 09:41:52 - [info] Worldmap version 1.5.30
1 Jun 09:41:52 - [info] Dashboard version 2.14.0 started at /ui
1 Jun 09:41:55 - [info] Settings file : /home/pi/.node-red/settings.js
1 Jun 09:41:55 - [info] User directory : /home/pi/.node-red
1 Jun 09:41:55 - [warn] Projects disabled : set editorTheme.projects.enabled=true to enable
1 Jun 09:41:55 - [info] Flows file : /home/pi/.node-red/start
1 Jun 09:41:55 - [info] Creating new flow file
1 Jun 09:41:55 - [warn]


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.

1 Jun 09:41:55 - [info] Starting flows
1 Jun 09:41:55 - [info] Started flows
1 Jun 09:41:56 - [red] Uncaught Exception:
1 Jun 09:41:56 - Error: listen EADDRINUSE 0.0.0.0:1880
at Object.exports._errnoException (util.js:1020:11)
at exports._exceptionWithHostPort (util.js:1043:20)
at Server._listen2 (net.js:1271:14)
at listen (net.js:1307:10)
at net.js:1417:9
at _combinedTickCallback (internal/process/next_tick.js:83:11)
at process._tickCallback (internal/process/next_tick.js:104:9)
pi@raspberrypi:~ $

1 Like

The

EADDRINUSE 0.0.0.0:1880

suggests something is already using the port that Node-RED uses. Usually this is node-Red :slight_smile: you need to stop node-RED using

node-red-stop before using the start command

Have you recently added a new node or upgraded a node? You are using a quite old version of Node-RED with a no-linger-supported version of nodejs.
If you can it would be worth upgrading using the script on the raspberry pi page in the docs and seeing if that fixes your issue

1 Like

No updates or anything, it appeared to go down around 01:30 this morning - all on it's own - it sends data to another PI with Grafana.

I issued an stop node-red and got this :-

pi@raspberrypi:~ $ node-red stop
1 Jun 09:59:09 - [info]

Welcome to Node-RED

1 Jun 09:59:09 - [info] Node-RED version: v0.18.7
1 Jun 09:59:09 - [info] Node.js version: v6.14.4
1 Jun 09:59:09 - [info] Linux 4.9.35-v7+ arm LE
1 Jun 09:59:11 - [info] Loading palette nodes
1 Jun 09:59:17 - [warn] [chart request] Deprecated call to RED.runtime.nodes.registerType - node-set name must be provided as first argument
1 Jun 09:59:17 - [warn] [chart response] Deprecated call to RED.runtime.nodes.registerType - node-set name must be provided as first argument
1 Jun 09:59:18 - [info] Dashboard up and running
1 Jun 09:59:28 - [info] Worldmap version 1.5.30
1 Jun 09:59:29 - [info] Dashboard version 2.14.0 started at /ui
1 Jun 09:59:31 - [info] Settings file : /home/pi/.node-red/settings.js
1 Jun 09:59:31 - [info] User directory : /home/pi/.node-red
1 Jun 09:59:31 - [warn] Projects disabled : set editorTheme.projects.enabled=true to enable
1 Jun 09:59:31 - [info] Flows file : /home/pi/.node-red/stop
1 Jun 09:59:31 - [info] Creating new flow file
1 Jun 09:59:31 - [warn]


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.

1 Jun 09:59:31 - [info] Starting flows
1 Jun 09:59:31 - [info] Started flows
1 Jun 09:59:31 - [red] Uncaught Exception:
1 Jun 09:59:31 - Error: listen EADDRINUSE 0.0.0.0:1880
at Object.exports._errnoException (util.js:1020:11)
at exports._exceptionWithHostPort (util.js:1043:20)
at Server._listen2 (net.js:1271:14)
at listen (net.js:1307:10)
at net.js:1417:9
at _combinedTickCallback (internal/process/next_tick.js:83:11)
at process._tickCallback (internal/process/next_tick.js:104:9)
pi@raspberrypi:~ $

I also have Pi-hole running but that's using the IP but on /admin - it's been running on the same pi for years

Something strange there because it has started node-red with a flow file override called "stop" which clearly doesn't exist.

Caused by using the command

node-red stop

rather the stop command

node-red-stop
2 Likes

my guess is he tried to stop node red using node-red stop

This resulted in not only NOT stopping existing node-red instance but actually starting another and attempting to load a flow called stop. A clue here is port 1880 already in use.

If the op had written node-red-stop it would have stopped node-red instead of trying to launch again

NOTE: this is assuming linux/RPi (windows doesnt do node-red-stop)

2 Likes

I think that's what I did, a node-red stop rather than node-red-stop, I incorrectly assumed they were the same thing. But I still have the issue

I reloaded an old image file I had - that appears ok. Then I reloaded the flows file and that started the problem so it must be a problem within a flow. I can't see why it would wrong during the night with no input from me.?

It's horrible when you get the sinking feeling when you've lost weeks of work messing, fine tuning and it goes wrong !:cry:

After experimenting all day I have my flows back - however, not running - this is the error

Flows stopped due to missing node types.

  • twitter-credentials
  • twitter out

I removed a Twitter node and the credentials node but still get the error ?

You still have some twitter related nodes in the flow. When you deploy do you see an Unused Config Nodes message? If so then delete those. If you still get the error then use the Search feature to search for twitter.

Use search 'ctrl+f' and search Twitter. You'll find remnants typically config nodes. Delete and deploy.

1 Like

I deleted the one Twitter node and the credentials. I think I deleted Twitter with an undelete( sudo npm uninstall -g node-red-node-twitter --save) but I still have a greyed out node-red-node-twitter in the pallet. (If I hit update it fails)

40

Did you install it using -g? Normally one would not do that. What do you see in the terminal if you run
npm uninstall node-red-node-twitter
I hope you made a backup of your flows file before you started experimenting in order to avoid the risk of losing everything that you mentioned earlier.

The twitter node was originally part of the "core" Node-RED nodes and was therefore loaded as a global node. The version that is installed no longer works as twitter changed its API.

The upgrade script I suggested you ran in the first reply in this thread would get you onto a supported version of nodejs, upgrade Node-RED to the latest version and upgrade all the nodes.

Ah yes, I had forgotten that. As you say, the best thing is to run the upgrade script. After making sure everything important is backed up of course.

Yes I have two images, one the non working one and the other a quite old one.
I've used the the old image and the backup file of the flows form the none working one, at least I can see my non running flows.

What gets me is when I reload the old flows they work, but the non working one doesn't, even with the Twitter node greyed out in both instances. The new non working flow I can't find any reference to Twitter using ctrl-f.

Whats the best way to update sudo apt-get update sudo apt-get dist-upgrade ?

One thought just crossed my mind. Would downloading a new PI install then reinstall my flows work. The PI has has and still does many things on it an email server, ads-b, pi-hole, transmission, + loads of downloaded files. (32gb SD)

Nope, the best way to upgrade is

1 Like

This one ?,

#!/bin/bash

echo ""
echo "Updating/Upgrading Raspbian"
apt-get -y update
apt-get -y upgrade
apt-get -y dist-upgrade
apt-get -y install rpi-update
rpi-update
echo "Updating/Upgrading completed"
echo ""

The one in the Install/Upgrade section of the page “running on Raspberry Pi” in the docs

just in case - https://nodered.org/docs/hardware/raspberrypi

1 Like