node-RED won't start, Failed with result 'exit-code'

Oh sorry, I removed it using a gui. rm removes files and folders but you need the -r option to remove a folder. The f does 'force'. Try using rm -rf node-red-node-pi-neopixel

The folder is deleted but node-red can't accomplish the startup sequence...

I'm making progress, I did the upgrade again (bash <(curl -sL https://raw.githubusercontent.com/node-red/linux-installers/master/deb/update-nodejs-and-nodered), and then started with node-red test.flow -safe and now I see a lot of warnings and port 1880 is apparently already used?

pi@Rpi4:~/.node-red $ node-red test.flow -safe
12 Jul 23:12:12 - [info]

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

12 Jul 23:12:12 - [info] Node-RED version: v2.2.2
12 Jul 23:12:12 - [info] Node.js  version: v12.22.12
12 Jul 23:12:12 - [info] Linux 5.10.103-v7l+ arm LE
12 Jul 23:12:12 - [info] Loading palette nodes
12 Jul 23:12:18 - [info] Worldmap version 2.13.2
12 Jul 23:12:19 - [info] Dashboard version 2.28.2 started at /ui
Traceback (most recent call last):
  File "<string>", line 1, in <module>
ImportError: No module named rpi_ws281x
12 Jul 23:12:20 - [warn] rpi-neopixels : rpi-gpio.errors.ignorenode
12 Jul 23:12:20 - [warn] ------------------------------------------------------
12 Jul 23:12:20 - [warn] [node-red-node-rbe/rbe] 'rbe' already registered by module node-red
12 Jul 23:12:20 - [warn] [node-red-contrib-google-translate-fixed/google-translate] 'google-translate' already registered by module node-red-contrib-google-translate
12 Jul 23:12:20 - [warn] [node-red-node-group/group] Error: This module is not required for Node-RED 1.1.0 or later (line:9)
12 Jul 23:12:20 - [warn] ------------------------------------------------------
12 Jul 23:12:20 - [warn] Missing node modules:
12 Jul 23:12:20 - [warn]  - node-red-contrib-actionflows (2.0.4): actionflows, actionflows_in, actionflows_out
12 Jul 23:12:20 - [warn]  - node-red-contrib-binary (0.1.3): binary
12 Jul 23:12:20 - [warn]  - node-red-contrib-covid19 (1.1.0): COVID-19
12 Jul 23:12:20 - [warn]  - node-red-contrib-date-converter (0.0.3): date-converter
12 Jul 23:12:20 - [warn]  - node-red-contrib-dht-sensor (1.0.4): rpi-dht22
12 Jul 23:12:20 - [warn]  - node-red-contrib-ds18b20-sensor (1.3.6): rpi-ds18b20
12 Jul 23:12:20 - [warn]  - node-red-contrib-gpio (0.14.0): gpio in, gpio out, node-led, nodebot, johnny5
12 Jul 23:12:20 - [warn]  - node-red-contrib-image-output (0.6.3): image
12 Jul 23:12:20 - [warn]  - node-red-contrib-loop-processing (0.3.1): counter-loop, array-loop, while-loop
12 Jul 23:12:20 - [warn]  - node-red-contrib-lora-data-decrypt (0.0.1): lora-decrypt
12 Jul 23:12:20 - [warn]  - node-red-contrib-lorawan (0.0.4): lorawan-rx, lorawan-tx, lorawan-config
12 Jul 23:12:20 - [warn]  - node-red-contrib-luftkvalitet (0.0.5): luftkvalitet-latest, luftkvalitet-historical, luftkvalitet-daily, luftkvalitet-lookup
12 Jul 23:12:20 - [warn]  - node-red-contrib-message-counter (1.0.1): Message Counter
12 Jul 23:12:20 - [warn]  - node-red-contrib-mqtt-broker (0.2.9): mosca in
12 Jul 23:12:20 - [warn]  - node-red-contrib-openaq (0.0.5): openaq-cities, openaq-countries, openaq-fetches, openaq-latest, openaq-locations, openaq-measurements, openaq-parameters, openaq-sources
12 Jul 23:12:20 - [warn]  - node-red-contrib-play-audio-file (0.0.1): play_audio_file
12 Jul 23:12:20 - [warn]  - node-red-contrib-python-function (0.0.4): python-function
12 Jul 23:12:20 - [warn]  - node-red-contrib-rfxcom (2.9.1): rfxtrx-port, rfx-lights-in, rfx-lights-out, rfx-blinds-in, rfx-blinds-out, rfx-doorbell-in, rfx-doorbell-out, rfx-meter, rfx-sensor, rfx-trv-out, rfx-heat-out, rfx-detector-in, rfx-alarm-out, PT2262-device-list, rfx-PT2262-in, rfx-PT2262-out
12 Jul 23:12:20 - [warn]  - node-red-contrib-termux-api (0.0.5): termux-battery-status, termux-camera-info, termux-clipboard-get, termux-contact-list, termux-telephony-cellinfo, termux-telephony-deviceinfo, termux-tts-engines, termux-camera-photo, termux-clipboard-set, termux-dialog, termux-download, termux-location, termux-tts-speak, termux-vibrate, termux-sms-inbox, termux-toast, termux-sms-send, termux-share, termux-notification, termux-wifi-connectioninfo, termux-wifi-scaninfo
12 Jul 23:12:20 - [warn]  - node-red-contrib-timed-counter (0.0.4): timed-counter
12 Jul 23:12:20 - [warn]  - node-red-contrib-tuya (0.1.0): tuya
12 Jul 23:12:20 - [warn]  - node-red-contrib-tuya-smart (1.2.0): tuya-smart
12 Jul 23:12:20 - [warn]  - node-red-contrib-unificationengine (0.0.18): unificationengine, google-credentials, google-api-config, linkedin-credentials, linkedin-api-config, facebook-credentials, facebook-api-config, twitternode-credentials, twitternode-api-config, weibo-credentials, weibo-api-config, sms-credentials, sms-api-config, whatsapp-credentials, whatsapp-api-config, smtp-credentials, smtp-api-config, telegram-credentials, telegram-api-config, viberpa-credentials, viberpa-api-config, kik-credentials, kik-api-config, line-credentials, line-api-config, sendgrid-credentials, sendgrid-api-config, threema-credentials, threema-api-config, fbmessenger-credentials, fbmessenger-api-config, skype-credentials, skype-api-config, kakaostory-credentials, kakaostory-api-config, fbworkplace-credentials, fbworkplace-api-config, viber-credentials, viber-api-config, tumblr-credentials, tumblr-api-config, wechat-credentials, wechat-api-config
12 Jul 23:12:20 - [warn]  - node-red-contrib-viseo-ms-authentication (0.0.2): ms-luis-config, ms-config
12 Jul 23:12:20 - [warn]  - node-red-contrib-viseo-ms-speech (0.2.0): ms-speech-text
12 Jul 23:12:20 - [warn]  - node-red-contrib-weekday (0.1.0): weekday
12 Jul 23:12:20 - [warn]  - node-red-contrib-youtube (0.0.10): google-credentials-youtube, youtube-download, youtube-upload
12 Jul 23:12:20 - [warn]  - node-red-node-arduino (0.3.1): arduino in, arduino out, arduino-board
12 Jul 23:12:20 - [warn]  - node-red-node-openweathermap (0.2.2): openweathermap, openweathermap in
12 Jul 23:12:20 - [warn]  - node-red-node-pi-gpiod (0.0.13): pi-gpiod in, pi-gpiod out
12 Jul 23:12:20 - [warn]  - node-red-node-pi-sense-hat (0.0.18): rpi-sensehat in, rpi-sensehat out
12 Jul 23:12:20 - [warn]  - node-red-node-youtube (0.0.5): google-config, YouTube PlayListItems, YouTube PlayLists, YouTube Channels
12 Jul 23:12:20 - [warn]  - sense-neuralnetwork (1.0.2): neural-network, reinforced-agent
12 Jul 23:12:20 - [info] Removing modules from config
12 Jul 23:12:20 - [info] Settings file  : /home/pi/.node-red/settings.js
12 Jul 23:12:20 - [info] HTTP Static    : /home/pi/node-red-static
12 Jul 23:12:20 - [info] Context store  : 'default' [module=memory]
12 Jul 23:12:20 - [info] User directory : /home/pi/.node-red
12 Jul 23:12:20 - [warn] Projects disabled : editorTheme.projects.enabled=false
12 Jul 23:12:20 - [info] Flows file     : /home/pi/.node-red/test.flow
12 Jul 23:12:20 - [info] Creating new flow file
12 Jul 23:12: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.
---------------------------------------------------------------------

12 Jul 23:12:20 - [error] Unable to listen on http://127.0.0.1:1880/
12 Jul 23:12:20 - [error] Error: port in use

That means that Node-RED is already running. You probably ran sudo systemctl enable nodered.service at some point and that causes Node-RED to autostart at boot.

You should be good now, have you tried to get into the editor?

After a shutdown and removing the power supply, the Port in use message has disappeared.
With the command node-red test.flow -safe starts node-RED and I can get to the GUI.

When I want node-RED to load my flows, I still get the startup loop:

Welcome to Node-RED
===================
12 Jul 23:32:59 - [info] Node-RED version: v2.2.2
12 Jul 23:32:59 - [info] Node.js  version: v12.22.12
12 Jul 23:32:59 - [info] Linux 5.10.103-v7l+ arm LE
12 Jul 23:32:59 - [info] Loading palette nodes
12 Jul 23:33:05 - [info] Worldmap version 2.13.2
12 Jul 23:33:06 - [info] Dashboard version 2.28.2 started at /ui
Traceback (most recent call last):
  File "<string>", line 1, in <module>
ImportError: No module named rpi_ws281x
12 Jul 23:33:06 - [warn] rpi-neopixels : rpi-gpio.errors.ignorenode
12 Jul 23:33:07 - [warn] ------------------------------------------------------
12 Jul 23:33:07 - [warn] [node-red-node-rbe/rbe] 'rbe' already registered by module node-red
12 Jul 23:33:07 - [warn] [node-red-contrib-google-translate-fixed/google-translate] 'google-translate' already registered by module node-red-contrib-google-translate
12 Jul 23:33:07 - [warn] [node-red-node-group/group] Error: This module is not required for Node-RED 1.1.0 or later (line:9)
12 Jul 23:33:07 - [warn] ------------------------------------------------------
12 Jul 23:33:07 - [info] Settings file  : /home/pi/.node-red/settings.js
12 Jul 23:33:07 - [info] HTTP Static    : /home/pi/node-red-static
12 Jul 23:33:07 - [info] Context store  : 'default' [module=memory]
12 Jul 23:33:07 - [info] User directory : /home/pi/.node-red
12 Jul 23:33:07 - [warn] Projects disabled : editorTheme.projects.enabled=false
12 Jul 23:33:07 - [warn] Flows file name not set. Generating name using hostname.
12 Jul 23:33:07 - [info] Flows file     : /home/pi/.node-red/flows_Rpi4.json
12 Jul 23:33:07 - [error] Unable to listen on http://127.0.0.1:1880/
12 Jul 23:33:07 - [error] Error: port in use
nodered.service: Main process exited, code=exited, status=1/FAILURE
nodered.service: Failed with result 'exit-code'.
nodered.service: Service RestartSec=100ms expired, scheduling restart.
nodered.service: Scheduled restart job, restart counter is at 7.
Stopped Node-RED graphical event wiring tool.
Started Node-RED graphical event wiring tool.
12 Jul 23:33:09 - [info]
Welcome to Node-RED
===================
12 Jul 23:33:09 - [info] Node-RED version: v2.2.2**strong text**

12 Jul 23:33:07 - [error] Unable to listen on http://127.0.0.1:1880/
12 Jul 23:33:07 - [error] Error: port in use

It didn't start because it's already running.

Do this, run node-red-stop
then run sudo systemctl disable nodered.service
then run node-red flows_Rpi4.json --safe ?
and what does the log show.

You also might want to read the documentation at Running on Raspberry Pi : Node-RED

Okay, here is my output:

pi@Rpi4:~/.node-red $ node-red flows_Rpi4.json --safe
13 Jul 10:36:52 - [info]

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

13 Jul 10:36:52 - [info] Node-RED version: v2.2.2
13 Jul 10:36:52 - [info] Node.js  version: v12.22.12
13 Jul 10:36:52 - [info] Linux 5.10.103-v7l+ arm LE
13 Jul 10:36:53 - [info] Loading palette nodes
13 Jul 10:37:06 - [info] Worldmap version 2.13.2
13 Jul 10:37:09 - [info] Dashboard version 2.28.2 started at /ui
Traceback (most recent call last):
  File "<string>", line 1, in <module>
ImportError: No module named rpi_ws281x
13 Jul 10:37:09 - [warn] rpi-neopixels : rpi-gpio.errors.ignorenode
13 Jul 10:37:11 - [warn] ------------------------------------------------------
13 Jul 10:37:11 - [warn] [node-red-node-rbe/rbe] 'rbe' already registered by module node-red
13 Jul 10:37:11 - [warn] [node-red-contrib-google-translate-fixed/google-translate] 'google-translate' already registered by module node-red-contrib-google-translate
13 Jul 10:37:11 - [warn] [node-red-node-group/group] Error: This module is not required for Node-RED 1.1.0 or later (line:9)
13 Jul 10:37:11 - [warn] ------------------------------------------------------
13 Jul 10:37:11 - [info] Settings file  : /home/pi/.node-red/settings.js
13 Jul 10:37:11 - [info] HTTP Static    : /home/pi/node-red-static
13 Jul 10:37:11 - [info] Context store  : 'default' [module=memory]
13 Jul 10:37:11 - [info] User directory : /home/pi/.node-red
13 Jul 10:37:11 - [warn] Projects disabled : editorTheme.projects.enabled=false
13 Jul 10:37:11 - [info] Flows file     : /home/pi/.node-red/flows_Rpi4.json
13 Jul 10:37:12 - [info] Server now running at http://127.0.0.1:1880/
13 Jul 10:37:12 - [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.
---------------------------------------------------------------------

13 Jul 10:37:12 - [info] *****************************************************************
13 Jul 10:37:12 - [info] Flows stopped in safe mode. Deploy to start.
13 Jul 10:37:12 - [info] *****************************************************************


The server starts but the dashboard is not available
I can now see my tabs with flows.
What is the recommended next step?

Try a deploy, stop NR and start it again and see what the log looks like.

That's it Paul!

I can deploy a flow, restarted node-red and now the Dashboard is available.
I will clean up several Tabs/flows and try to eliminate the node-red startup warnings.

Thank you for spending your time :+1:

1 Like

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.