Why my Node Red flows are all broken suddenly?

Hi !

I’ve just opened Node Red. Why are my flows not running ? There are no statuses, timestamps buttons are disabled.

What’s happening ? Even efter trying to add a new flow, it stays inactive. Some flows seem to work (I just got a notification from a flow) but their timestamp or statuses are not updated in Node Red.

(yes I’ve rebuilt All and redeployed).

Thanks !

All your flows are continuing to run. Node-RED executes all flows from the runtime. This is still working - if you are using Node-RED as an add-on, go to the HA add-on page and check the CPU and memory use (and the logs).

Your Node-RED editor, however, runs in your browser but needs to communicate back to Node-RED runtime (via WebSocket) for the Inject button, the Debug node, Deployment, and all node status messages to operate.

Since Node-RED is in two parts, the bit that has broken is the WebSocket link between runtime and editor.

Please see any of the recent and long running posts about this particular issue. Solving it is more challenging, but you can start by accessing Node-RED editor directly via ip:1880 (you will probably need to enter your HA user and password to get in) or you can use the ‘Open web UI’ option in the add-on page.

Reasons for the issue include having multiple HA WebSocket servers when you should only have one.

1 Like

It’s true that I’ve noticed, I’ve got 3 HA websockets in my Nodered configuration. Don’t know where they come from. I’m gonna check how I can remove the ones not relevant. Thanks for your answer, appreciated !

I had the same problem a few weeks ago, I tried reinstalling node-red, clearing the browser cache, changing the port, going back to a previous version of the webhook, nothing. It seemed to have disappeared but after a while it came back, then I realized that I had a node that referred to an entity that no longer exists, after deleting that node everything went back to normal. I don’t know if this is your case too, but I would take a look at the various nodes!

I’ve not touched Node Red for the last 3 to 4 months. It’s really crap if it breaks down for no reason.

And you’re right, I now have a live access to the editor (ip:1880). So it should be fine for now. Thanks !

I have Node-RED as an add-on in my Home Assistant Blue. I keep HA updated, and I update the NR add-on, the HA WebSocket nodes, and the NR Companion to keep them in sync and up to date. I also keep all my other palette nodes up to date, and delete any extra HA Servers (which come from importing other code that has not been scrubbed first).

Home Assistant changes monthly. The way Node-RED editor has to run in an iFrame, inside the HA dashboard webpage, and tunnel back to the add-on docker container via the HA Supervisor reverse proxy API WebSocket means the link can be fragile.

I also run Node-RED on a Raspberry Pi. I have to manage that myself, but in general terms it has never broken, and if it does it is up to me to fix it.

If you want stable self-managed Node-RED, with full direct access to the editor, set up something like a Raspberry Pi and connect it back to HA using a long-life token.

Node-RED not running as an add-on. Full screen editing, access to my two HA instances, self-managed.

Same issue here since this morning.
How can I check if I have multiple websocket running ?

Node-RED > debug window (RHS) >

option 1: config node tab > look for ‘server’ > you should have one HomeAssistant
option 2: Home Assistant tab > server sub tab > you should have one HomeAssistant

Indeed two home assistant servers.
On one all the nodes are connected. none on the other.

This must have come there after an update or so.
Would it be safe to just delete the instance that no node is using ?
What would be the best location to do this ?

Even stranger.
Didn’t do anything than just checking your proposal and the flows update again and give debug info.

The Node-RED editor (runs in your browser) needs to connect via WebSocket to the Node-RED runtime and server. With NR as an add-on, this has to go back through the Supervisor reverse proxy and HA-API. Anything that is badly behaved or places excessive demands on the HA WebSocket will cause the connection to falter or fail completely. This upsets the NR editor no end.

Even if you have no nodes connected, two HA server configurations will still attempt to connect - if you look at the Node-RED logs (see the logs in the add-on page) just after NR restarts, you will see ‘attempting to connect’ and ‘connected’ for one, most likely two servers. If they are both up and running, they are probably competing for the same WebSocket, particularly as the HA server will (if you have set it up to do this) pull down the HA state to Global Context at every HA event. It is still busy and doing stuff. Just delete it (from anywhere you can get at it) but, clearly, make sure you delete the one that has no nodes connected.

There are open issues (here and here) that describes this problem on the Node Red addon.

yesterday I removed the home assistent entry with no nodes. Today it is back with again the same behavior not to have any debug info. Even after deleting the home assistant entry, the debug info is not working. Also inject nodes don’t look to work.

After a while the debug info came back and again some time later it started giving errors that it couldn’t read certain state values.

Restarted home assistant.
Only one home assistant entry in node red but on the normal node red again no debug info and inject nodes don’t look to work.
afbeelding

Are you using direct access? Use your ha ip with 1880 instead of 8123. If prompted for a user/password, use your HA user/password.

the direct access has no issues so is only related when accessing via home assistant

As it’s been mentioned previously, this is a long running issue that sporadically pops up. 1880 is usually unaffected, I’ve been using 1880 for years now. If you want to be able to have a link off your side bar, you can create a webpage dashboard and use the NR address.

This may not work with https though. For https you maybe able to use a button card to link out to the NR direct address.

Just FYI, I’ve managed to remove two extra instances of my Home Assistant server under Node Red. I had to locate each faulty node and reassign it to the correct HA instance. I had less than 10 so it was quite easy.

Now after a full system reboot, seems like everything runs fine.

Thanks again for all the tips above. I’ve had this exact same issue something like one year ago and I reinstalled all my flows, it took me a whole evening.