Node red stopped due to interruption and reconnection of internet connection

I have installed node-red on a windows 11 PC which is running 24/7. Node-red is started by the autostart function of windows.

Problem is, node-red will closed automatically without any failure in flows or the installation itself.

Result of checking was, at the same time the internet connection was disconnected and re-established by the provider automatically during night time. That happened several times in the last weeks.

Is it possible that Windows make a reset of user rights as result of the new internet connection? The windows auto update function is disabled btw.

Is there any way to keep node-red running by using and "auto restarter" which is checking wheater node-red is running all time? In case node-red was stopped it should be restarted automatically.

No.

You need to view the Node-RED logs to see what is going wrong.

Yes, there are several ways on Windows. It is easier on Linux though.

  • Run node-red as a service by registering it using the nssm app.
  • Run it using the Windows scheduler with the appropriate auto-restart options.
  • Run it via PM2.
  • Run it behind IIS (as a reverse proxy) using iisnode

I don't run my live service using Windows. My Windows PC is a dev PC for Node-RED and I use PM2 which has the advantage of not only making the Node-RED logs easier to deal with but I can use its watch capabilities to auto-restart Node-RED when I change config or node package files.

1 Like

We do this - and its the easiest way IMO.

BUT! - ensure you deselect to "stop if the task is running for 3 days" - been burnt many times, leaving this checked

:rofl:

Too true.

1 Like

Yup - took us a few hours to work out why a task was stopping after so many days :grimacing:

If going do this route, we usually create a limited/local account, with "Logon on as a Batch Job" rights

2 Likes