I noticed, that my instance is rebooting/reinitializing very often. Flow Variables are resetting at these times. So I created a routine that always sends a mail after Node Red is started. Now I can inspect whenever the instance is getting started.
I can see, that every night at 3.30 the instance starts. But I also have other restarts from time to time, that do not occur that regularily. Is there any routine that "restarts" the instance? Can I stop that?
Is there any way to save the settings during a restart/reboot? At the moment all contents of the flow variables resets to default values evertime. Thats unfortunate. I have a water-control running with node-red. In case I open a valve and node-red reboots afterwarts, it may not get closed anymore. Thats a problem.
Any hints on that?
Hello @Pinky ,
I think we are talking about two problems here:
- How to store the flow variables values "permanently".
- What causes your reboots.
Concerning Store the flows "permanently":
Please have a look at the documentation of context variables. There you can see, that a setting allows you to store the context variables also to the local filesystem. This should remain the values also during reboot:
Concerning your 2nd problem of regular restarts, you should first check your logs. If the restart is regulary at 3:30 am, I would assume that you have any job defined, who is doing that (maybe a backup routine)?
What hardware/OS are you running on?
Do you have anything in your flows that is scheduled for 03:30?
Do you have anything in your house (if it is in a house) that happens at that time?
If you are running on a Linux system such as on a Pi then you can look in the system log to see if there is any indication of why it is rebooting. This thread has a discussion on how to do that. Machine times between reboots/lockups reducing
Thanks for your answers.
The system is a Pi 4 with a clean setup.
-> There is no cronjob running
-> There is no node-red routine introducing the reboot
-> There is no third-party script or anything on the PI that could lead to the reboot. (clean install)
Thats the way I went so far bevore posting here.
I Installed an iobroker with node-red as a service. But the iobroker is also very clean and there is no routine scheduling a reboot. (None that I know of) And no backup-plan (yet).
I will search for the reboot-causes in syslog and work through your link now. Thanks for that, maybe I can find any hint there.
-> Did that.
Syslog shows this message the whole day in a loop (20-30seconds), so I don't think thats a reason for a reboot/restart of the node-red instance.
May 31 03:30:02 raspberrypi Node-RED: /usr/bin/env: „node-red-pi“: Datei oder Verzeichnis nicht gefunden
May 31 03:30:02 raspberrypi systemd: nodered.service: Main process exited, code=exited, status=127/n/a
May 31 03:30:02 raspberrypi systemd: nodered.service: Failed with result 'exit-code'.
May 31 03:30:22 raspberrypi systemd: nodered.service: Service RestartSec=20s expired, scheduling restart.
May 31 03:30:22 raspberrypi systemd: nodered.service: Scheduled restart job, restart counter is at 40390.
May 31 03:30:22 raspberrypi systemd: Stopped Node-RED graphical event wiring tool.
May 31 03:30:22 raspberrypi systemd: Started Node-RED graphical event wiring tool.
May 31 03:30:22 raspberrypi Node-RED: /usr/bin/env: „node-red-pi“: Datei oder Verzeichnis nicht gefunden
May 31 03:30:22 raspberrypi systemd: nodered.service: Main process exited, code=exited, status=127/n/a
May 31 03:30:22 raspberrypi systemd: nodered.service: Failed with result 'exit-code'.
At 3:30am there is also this message:
May 31 03:30:22 raspberrypi dhcpcd: eth0: Router Advertisement from fe80::3681:x:x
May 31 03:30:22 raspberrypi dhcpcd: wlan0: Router Advertisement from fe80::3681:x:x
Thats an indicator for something that has happened (something else than the things that happen the whole day) but I still can't see any solution from these lines.
Node red is restarting every 30 seconds then. Fix that problem first.
Did you install node-red using the recommended script? If not then I would do that first. Running on Raspberry Pi : Node-RED
Wow. I suspect you have a problem in your flows or even file system corruption causing node-red to crash.
If you installed using the official script them I would recommend doing the service and running node-red in a terminal to see what is happening.
In a terminal...
node-red-stop (stop the service)
node-red (start node-red manually)
Watch the terminal for exceptions.
If you can't make sense of it, post a text copy of the terminal output here.
thanks for the replies.
I figured out where the problem with the log-messages came from.
My node-red instance is installed as an iobroker-adapter. That means the node-red files get stored in another location than usual. So node-red is not installed with the usual install-script.
While installing the system I first installed iobroker and node-red in parallel. But unfortunatelly node-red was not able to access the iobroker-devices that way. So I installed node-red as an iobroker-adapter -> everything was fine.
Unfortunetelly the "other" installation was still active - half installted and not configured - causing the errors posted above. I uninstalled it -> now the logs are gone.
One problem is left: The restart-mails still occur. That means that every night at 3:30 the node-red instance reboots/restarts. I am not sure if the whole system reboots or if it is just the instance of node-red. (Syslog does not show any reboot)
-> There is no flow or anything that causes the reload.
Unfortunatelly the settings of the dashboard toggles reset everytime this happens. So the system "resets" this way everytime. Thats very unfortunate.
Any ideas what could happen here?
This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.