Raspberry 4 reboots just after starting node-red

I issue a node-red-start on raspberry pi 4 32G SD, and I get a "not running on a pi"
on a freshly initialied sd from the bash command in node-red documentation.
I get a warning :
Not running on a Pi - Ignoring node !!
it is running on a Pi.

(fileServer listening on ip 192.168.1.91 and port 8098 . it is the ip of the raspberry running nodered. )

and finally it sends a message and reboots !!!

I am a bit clueless... I cannot isolate the problem easily, I would try disabling the flows on by one, but I cannot run the server!

I re imported a project which worked fine.. and this occured after a minor change.

thanks for any lead.

pi@raspoutine:~ $ node-red-start

Start Node-RED
 
Once Node-RED has started, point a browser at http://192.168.1.91:1880
On Pi Node-RED works better with the Firefox or Chrome browser
 
Use   node-red-stop                          to stop Node-RED
Use   node-red-start                         to start Node-RED again
Use   node-red-log                           to view the recent log output
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 a systemd service.
4 Mar 16:59:04 - [info]
Welcome to Node-RED
===================
4 Mar 16:59:04 - [info] Node-RED version: v3.1.6
4 Mar 16:59:04 - [info] Node.js  version: v18.19.1
4 Mar 16:59:04 - [info] Linux 6.1.0-rpi8-rpi-v8 arm64 LE
4 Mar 16:59:05 - [info] Loading palette nodes
4 Mar 16:59:10 - [info] Dashboard version 2.29.1 started at /ui
4 Mar 16:59:11 - [warn] Info : mcp3xxx : Not running on a Pi - Ignoring node
4 Mar 16:59:12 - [warn] ------------------------------------------------------
4 Mar 16:59:12 - [warn] [node-red-node-sqlite/sqlite] Error: Cannot find module '/home/pi/.node-red/node_modules/sqlite3/lib/binding/node-v108-linux-arm64/node_sqlite3.node'
Require stack:
- /home/pi/.node-red/node_modules/sqlite3/lib/sqlite3-binding.js
- /home/pi/.node-red/node_modules/sqlite3/lib/sqlite3.js
- /home/pi/.node-red/node_modules/node-red-node-sqlite/sqlite.js
- /usr/lib/node_modules/node-red/node_modules/@node-red/registry/lib/loader.js
- /usr/lib/node_modules/node-red/node_modules/@node-red/registry/lib/index.js
- /usr/lib/node_modules/node-red/node_modules/@node-red/runtime/lib/nodes/index.js
- /usr/lib/node_modules/node-red/node_modules/@node-red/runtime/lib/index.js
- /usr/lib/node_modules/node-red/lib/red.js
- /usr/lib/node_modules/node-red/red.js
4 Mar 16:59:12 - [warn] ------------------------------------------------------
4 Mar 16:59:12 - [info] Settings file  : /home/pi/.node-red/settings.js
4 Mar 16:59:12 - [info] HTTP Static    : /home/pi/node-red-static > /
4 Mar 16:59:12 - [info] Context store  : 'default' [module=memory]
4 Mar 16:59:12 - [info] User directory : /home/pi/.node-red
4 Mar 16:59:12 - [info] Projects directory: /home/pi/.node-red/projects
4 Mar 16:59:12 - [info] Server now running at http://127.0.0.1:1880/
4 Mar 16:59:13 - [info] Active project : Divan
4 Mar 16:59:13 - [info] Flows file     : /home/pi/.node-red/projects/Divan/flows_raspoutine.json
4 Mar 16:59:13 - [info] Starting flows
fileServer listening on ip 192.168.1.91 and port 8098

Broadcast message from root@raspoutine (Mon 2024-03-04 16:59:14 EST):

The system will reboot now!


Broadcast message from root@raspoutine (Mon 2024-03-04 16:59:14 EST):

The system will reboot now!

Connection to raspoutine closed by remote host.
Connection to raspoutine closed.

Are you running node-red as root/sudo?

Have you opened firewall port and/or port forwarded to expose node-red to the internet?

This message smells like an intruder.

You can run Node-red in safe mode node-red --safe which will run the editor but not start any flows.
That should allow you to look for a cause of the reboot.
Probably a good place to start is Search Flows to find Exec nodes.

It might be wise to investigate with the Pi disconnected from your network.

1 Like

Great suggestion. I will try that !!
I use vnc (headless raspberry), so I need my local network..
Thanks!

It is run as pi user. when I : ps -aux | grep node-red
pi 2235 34.3 1.9 5181028 153272 pts/0 Sl+ 18:45 0:08 node-red
... Maybe a node was installed as root...
anyway it is a good lead --- thanks

Not on this one, (port forwarded only on another one (raspberry) which is protected).

Intriguing... (intruder...)
Thanks..

Have you got the pi setup to require a password for sudo? If not then do so. Otherwise a flow can inject any command it likes, possibly destroying your system.

Hi Colin,
it is in fact setup NOT to require a password.
so I set it up requiring a password.

sudo nano /etc/sudoers.d/010_pi-nopasswd
There's only one line:
pi ALL=(ALL) NOPASSWD: ALL
Changed it to
pi ALL=(ALL) PASSWD: ALL

now
sudo -p [password] [command]
works fine
thanks.

Thanks to all, found offending flow !

Can you share what was causing the reboot?
It might help other people.