Unable to start Node-red upon boot

I've decided to completely reimage the SD card and hope for the best. I can't get ZeroTier to work either. There's something very, very weird going on with this installation. I'm really sorry for wasting your time as for whatever reason(??) it looks like it's this install that must surely be at fault. Somehow. Thank you.

Well hopefully some of the changes we made will benefit others also - so not a problem.
Let us know how you get on.

1 Like

Hi ! I've just read all of @dceejay and @dclear msg here, trying to find out a similar problem here. Running on raspberry pi 4b, I updated nodejs, npm to latest version and them when I reinstalled node-red, it can't start on boot anymore. I did all this updates because I couldn't use the node "tf coco ssd", I only have successful deploy with "cocossd" Uninstalled and installed so many times today :(.

"Error: /root/.node-red/node_modules/@tensorflow/tfjs-node/lib/napi-v7/tfjs_binding.node: wrong ELF class: ELFCLASS64" - Serching for other topic in this forum...

but meanwhile:

pi@raspberrypi:~$ node-red restart                    
20 Nov 14:51:23 - [info] 

Welcome to Node-RED
===================

20 Nov 14:51:23 - [info] Node-RED version: v2.1.3
20 Nov 14:51:23 - [info] Node.js  version: v14.15.4
20 Nov 14:51:23 - [info] Linux 5.10.63-v7l+ arm LE
20 Nov 14:51:24 - [info] Loading palette nodes
20 Nov 14:51:25 - [info] Settings file  : /home/pi/.node-red/settings.js
20 Nov 14:51:25 - [info] Context store  : 'default' [module=memory]
20 Nov 14:51:25 - [info] User directory : /home/pi/.node-red
20 Nov 14:51:25 - [warn] Projects disabled : editorTheme.projects.enabled=false
20 Nov 14:51:25 - [info] Flows file     : /home/pi/.node-red/restart
20 Nov 14:51:25 - [info] Creating new flow file
20 Nov 14:51:25 - [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.
---------------------------------------------------------------------

20 Nov 14:51:25 - [error] Uncaught Exception:
20 Nov 14:51:25 - [error] Error: listen EADDRINUSE: address already in use 0.0.0.0:1880
    at Server.setupListenHandle [as _listen2] (net.js:1318:16)
    at listenInCluster (net.js:1366:12)
    at doListen (net.js:1503:7)
    at processTicksAndRejections (internal/process/task_queues.js:81:21)

And trying to start automatic service on boot:

pi@raspberrypi:~$ sudo systemctl enable nodered.service
Failed to enable unit: Unit file nodered.service does not exist.
pi@raspberrypi:~$ sudo systemctl status nodered
Unit nodered.service could not be found.

pi@raspberrypi:~$ which node-red
/usr/local/bin/node-red

The msg EADDRINUSE: address already in use 0.0.0.0:1880 means you already have a node-red running.

What happens if you open browser and point at the IP of the Pi and enter ip_address_of_the_pi:1880

1 Like

Thanks! I've just close the browser and this EADRRINUSE didnt shows on node-red start. Could you imagine what's going on with my systemctl ?

Closing the browser will not have changed that. Something else must have done it.

I think that you did not use the recommended script for installing node-red.

1 Like

Thanks for helping me. This is the last startup I've made, Today i'm going to try reinstall again.

pi@raspberrypi:~$ sudo node-red restart
21 Nov 10:37:00 - [info] 

Welcome to Node-RED
===================

21 Nov 10:37:00 - [info] Node-RED version: v2.1.3
21 Nov 10:37:00 - [info] Node.js  version: v14.15.4
21 Nov 10:37:00 - [info] Linux 5.10.63-v7l+ arm LE
21 Nov 10:37:02 - [info] Loading palette nodes
Platform node has already been set. Overwriting the platform with [object Object].
21 Nov 10:37:08 - [info] Dashboard version 3.1.2 started at /ui
21 Nov 10:37:09 - [info] Settings file  : /root/.node-red/settings.js
21 Nov 10:37:09 - [info] Context store  : 'default' [module=memory]
21 Nov 10:37:09 - [info] User directory : /root/.node-red
21 Nov 10:37:09 - [warn] Projects disabled : editorTheme.projects.enabled=false
21 Nov 10:37:09 - [info] Flows file     : /root/.node-red/restart
21 Nov 10:37:09 - [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.
---------------------------------------------------------------------

21 Nov 10:37:09 - [info] Server now running at http://127.0.0.1:1880/
21 Nov 10:37:09 - [info] Starting flows
21 Nov 10:37:09 - [info] Started flows
21 Nov 10:37:10 - [info] nora: authenticated, uid: pjk7bxJQBwMz5S0nBAStM9qCUBa2
21 Nov 10:37:10 - [info] nora: teste - disconnected

============================
Hi there Ć°. Looks like you are running TensorFlow.js in Node.js. To speed things up dramatically, install our node backend, which binds to TensorFlow C++, by running npm i @tensorflow/tfjs-node, or npm i @tensorflow/tfjs-node-gpu if you have CUDA. Then call require('@tensorflow/tfjs-node'); (-gpu suffix for CUDA) at the start of your program. Visit https://github.com/tensorflow/tfjs-node for more details.
============================
21 Nov 10:37:21 - [info] nora: teste - connected
21 Nov 10:37:33 - [info] nora: teste - synced 1 device(s)
21 Nov 10:49:15 - [info] Stopping flows
21 Nov 10:49:15 - [info] Stopped flows
21 Nov 10:49:15 - [info] Starting flows
21 Nov 10:49:15 - [info] nora: teste - connected
21 Nov 10:49:15 - [info] Started flows
21 Nov 10:49:29 - [info] nora: teste - synced 1 device(s)

how did you do the install? It looks like you installed it as root. Why?

1 Like

I think followed wrong tutorial to get the latest node.js. But now hopefully @Colin just have help me. Its solved. Thank you all


Running Node-RED install for user pi at /home/pi on raspbian


This can take 20-30 minutes on the slower Pi versions - please wait.

  Stop Node-RED                       \u2714
  Remove old version of Node-RED      \u2714
  Node option not specified           :   --node12, --node14, or --node16
  Leave existing Node.js              :   v16.13.0   Npm 8.1.0
  Clean npm cache                     -
  Install Node-RED core               \u2714   2.1.3
  Move global nodes to local          -
  Leave existing nodes                -
  Install extra Pi nodes              \u2714
  Add shortcut commands               \u2714
  Update systemd script               \u2714
                                      

Any errors will be logged to   /var/log/nodered-install.log
All done.
You can now start Node-RED with the command  node-red-start
  or using the icon under   Menu / Programming / Node-RED
Then point your browser to localhost:1880 or http://{your_pi_ip-address}:1880

Started :  dom nov 21 11:58:29 -03 2021 
Finished:  dom nov 21 11:59:57 -03 2021
pi@raspberrypi:~$ sudo node-red-start

Start Node-RED
 
Once Node-RED has started, point a browser at http://192.168.16.115:1880
On Pi Node-RED works better with the Firefox or Chrome browser
 
Use   sudo systemctl enable nodered.service  to autostart Node-RED at every boot
Use   sudo systemctl disable nodered.service to disable autostart on boot
 
To find more nodes and example flows - go to http://flows.nodered.org
 
Starting as root systemd service.
21 Nov 12:00:17 - [info]
Welcome to Node-RED
===================
21 Nov 12:00:17 - [info] Node-RED version: v2.1.3
21 Nov 12:00:17 - [info] Node.js  version: v16.13.0
21 Nov 12:00:17 - [info] Linux 5.10.63-v7l+ arm LE
21 Nov 12:00:18 - [info] Loading palette nodes
21 Nov 12:00:20 - [info] Settings file  : /home/pi/.node-red/settings.js
21 Nov 12:00:20 - [info] Context store  : 'default' [module=memory]
21 Nov 12:00:20 - [info] User directory : /home/pi/.node-red
21 Nov 12:00:20 - [warn] Projects disabled : editorTheme.projects.enabled=false
21 Nov 12:00:20 - [info] Flows file     : /home/pi/.node-red/flows.json
21 Nov 12:00:20 - [info] Server now running at http://127.0.0.1:1880/
21 Nov 12:00:20 - [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.
---------------------------------------------------------------------
21 Nov 12:00:20 - [info] Starting flows
21 Nov 12:00:20 - [info] Started flows
^C
pi@raspberrypi:~$ sudo systemctl enable nodered.service                        
pi@raspberrypi:~$