Node-RED keeps crashing

Hi,

I am using HA with Node-RED since years now. Since a few versions i have Node-RED crashing after a while. I could not find any reason so far.

Unfortunatly, the log in the add-on gets cleared after the add-on goes down. Also I do not know the time when the service goes down.

Can anyone help me and point to where I can find a log-file where i can look for a reason?

I am on a RPI4 with 4 GB of ram
Supervisor is on 2020.12.7
Home Assistant OS is on 5.9

1 Like

The log shouldn’t be clearing just because it crashed, I can still get to the last logs of my stopped add-ons without issue. They should only clear when the add-on starts up again.

Do you have “watchdog” turned on? If so you need to turn that off. That way next time it crashes you can go check out what happened then start it up manually.

Mike,

Thank you for the answer. I had to disable the watchdog, since it kept crashing my whole instance.

Maybe I am looking into the wrong direction, but i cannot find any logs. From the UI there is only the log, that blanks out once the add-on stops.

I assume you don’t have log_level set to suppress almost everything right? Make sure you have log_level set to debug or at least info in the configuration.

Other then that I’m not really sure, logs show up there for me. I don’t have a lot of Node RED crashes but had some when trying to leverage a custom npm package incorrectly and I was able to debug it with the logs.

I notice you have an “app configuration” option in the bottom left of your navigation which i only see when I use the mobile app but that looks like too big a screen for the mobile app. What app are you using there? Maybe try going to the website with a browser to see if the app has a problem with the something about that screen?

Another option is you could try the portainer add-on. If you browse the list of containers in there you can find the node red one and see its logs by clicking this icon:

I can do that even for stopped containers so it should still show up. But for me that shows me the same thing as I see in that tab so I’m not sure that will help in your case.

Is the error occurring during start-up by the way or does it start running fine and then crash at some point?

This is an iPad Pro wit the HA App. But the issue is consistent across all clients.

My HA logger is set to critical, however i would expect at least a critical or fatal when the addon goes down.

I like the approach with portainer. I’ve started Node-RED and wait for the next crash now…

critical is the most severe, it’s above fatal. Here’s the available log levels in order of most to least severe.

I also just ran a test and forced my node red to crash by listing a junk npm package in the config, here’s what I got:

I did get a fatal level message but no critical one and then it shut down. I would lower it to at least fatal if not error. Maybe try fatal first but you might only get one message that way, if its not informative enough you’ll probably need to drop another level.

Logging is set to info. I also have set up portainer. However, that revealed that not just the addon is stopped but the host is rebooting. I will monitor this for the next hours, to see if this is caused by the addon or the host itself is instable.

Oh that is very different. And yea that does probably clear out the logs.

In retrospect, I should’ve asked about this more. That sounds very wrong and like something that definitely shouldn’t happen. Debugging what is wrong in HA OS itself is a bit beyond me if that’s the situation you’re in. Fortunately that is definitely a supported install so hopefully one of the devs can help you out.

I might suggest taking this to the homeassistant_os channel in the HA discord. That’s a more direct support channel then the forum and I think you might need that in this case.

Hi, i finnaly could solve the issue by de-installing the NodeRed and start with a fresh install.

I do not know what caused the issue, but the fresh install did fix it.