Node-Red odd behavior

For the past few days I have had a very odd behavior of Node Red on my machine.
When I start node red, I am not able to inject or see anything on the debug.

Both types of nodes are enabled, but they look grayed out somehow.
image
Same for the debug but with light green.

The flow deploys successfully. Even when I open the dialog for the inject node, and I press inject now, it says it has injected, but again, noting happens. Even inject at startup is not working. No functionality whatsoever, but they all deploy.

Same behavior on all of my flows, so not specific to one.

This started happening this week (and yes, I am not sure about the update, I am running the latest but had it on update automatically, so not sure when it started).

I went to extreme measures today, I uninstalled Node Red, deleted the folder rom config and redid a fresh install. It worked then. Imported all my flows, deployed, everything fine.
Closed, and about an hour later, came back to keep working, and the behavior is back, can’t inject or do anything, like all the functionality is frozen.

Anyone seen this lately

They look undeployed to me.
Try to deploy again and make sure you do a full deploy by clicking the down arrow in the deploy button.
Else try looking at the logs for the NodeRed addon.

@WallyR I tried that, you can see in the screen shot the Deploy is grayed out, and the nodes have no status under any of them as they usually do, so none are working really. It’s like it is frozen.

So I looked at the logs,

s6-rc: info: service s6rc-oneshot-runner: starting
s6-rc: info: service s6rc-oneshot-runner successfully started
s6-rc: info: service base-addon-banner: starting
-----------------------------------------------------------
 Add-on: Node-RED
 Flow-based programming for the Internet of Things
-----------------------------------------------------------
 Add-on version: 14.0.1
 You are running the latest version of this add-on.
 System: Home Assistant OS 9.4  (amd64 / qemux86-64)
 Home Assistant Core: 2023.1.7
 Home Assistant Supervisor: 2023.01.1
-----------------------------------------------------------
 Please, share the above information when looking for help
 or support in, e.g., GitHub, forums or the Discord chat.
-----------------------------------------------------------
s6-rc: info: service base-addon-banner successfully started
s6-rc: info: service fix-attrs: starting
s6-rc: info: service base-addon-log-level: starting
s6-rc: info: service fix-attrs successfully started
s6-rc: info: service base-addon-log-level successfully started
s6-rc: info: service legacy-cont-init: starting
s6-rc: info: service legacy-cont-init successfully started
s6-rc: info: service init-nginx: starting
s6-rc: info: service init-customizations: starting
s6-rc: info: service init-customizations successfully started
s6-rc: info: service init-nodered: starting
patching file nodes/ui_base.html
Hunk #1 succeeded at 1164 (offset 633 lines).
s6-rc: info: service init-nginx successfully started
up to date, audited 102 packages in 2s
5 packages are looking for funding
  run `npm fund` for details
2 high severity vulnerabilities
Some issues need review, and may require choosing
a different dependency.
Run `npm audit` for details.
s6-rc: info: service init-nodered successfully started
s6-rc: info: service nodered: starting
s6-rc: info: service nodered successfully started
s6-rc: info: service nginx: starting
s6-rc: info: service nginx successfully started
s6-rc: info: service legacy-services: starting
s6-rc: info: service legacy-services successfully started
[08:18:17] INFO: Starting Node-RED...
> start
> node $NODE_OPTIONS node_modules/node-red/red.js --settings /etc/node-red/config.js
26 Jan 08:18:19 - [info] 
Welcome to Node-RED
===================
26 Jan 08:18:19 - [info] Node-RED version: v3.0.2
26 Jan 08:18:19 - [info] Node.js  version: v18.12.1
26 Jan 08:18:19 - [info] Linux 5.15.80 x64 LE
26 Jan 08:18:20 - [info] Loading palette nodes
26 Jan 08:18:23 - [info] Dashboard version 3.3.0 started at /endpoint/ui
26 Jan 08:18:24 - [info] Settings file  : /etc/node-red/config.js
26 Jan 08:18:24 - [info] Context store  : 'default' [module=memory]
26 Jan 08:18:24 - [info] User directory : /config/node-red/
26 Jan 08:18:24 - [warn] Projects disabled : editorTheme.projects.enabled=false
26 Jan 08:18:24 - [info] Flows file     : /config/node-red/flows.json
26 Jan 08:18:24 - [info] Server now running at http://127.0.0.1:46836/
26 Jan 08:18:24 - [info] Starting flows
[08:18:25] INFO: Starting NGinx...
26 Jan 08:18:25 - [info] Started flows
26 Jan 08:18:25 - [info] [mqtt-broker:HA MQTT] Connected to broker: mqtt://192.168.86.4:1883
26 Jan 08:18:29 - [info] [server:Home Assistant] Connecting to http://supervisor/core
26 Jan 08:18:29 - [info] [server:Home Assistant] Connecting to http://supervisor/core
26 Jan 08:18:29 - [info] [server:Home Assistant] Connecting to http://supervisor/core
26 Jan 08:18:29 - [info] [server:Home Assistant] Connecting to http://supervisor/core
26 Jan 08:18:29 - [info] [server:Home Assistant] Connected to http://supervisor/core
26 Jan 08:18:29 - [info] [server:Home Assistant] Connected to http://supervisor/core
26 Jan 08:18:29 - [info] [server:Home Assistant] Connected to http://supervisor/core
26 Jan 08:18:29 - [info] [server:Home Assistant] Connected to http://supervisor/core
26 Jan 08:19:50 - [info] Stopping flows
26 Jan 08:19:50 - [info] [server:Home Assistant] Closing connection to http://supervisor/core
26 Jan 08:19:50 - [info] [server:Home Assistant] Closing connection to http://supervisor/core
26 Jan 08:19:50 - [info] [server:Home Assistant] Closing connection to http://supervisor/core
26 Jan 08:19:50 - [info] [server:Home Assistant] Closing connection to http://supervisor/core
26 Jan 08:19:50 - [info] Stopped flows
26 Jan 08:19:50 - [info] Starting flows
26 Jan 08:19:51 - [info] Started flows
26 Jan 08:19:51 - [info] [mqtt-broker:HA MQTT] Connected to broker: mqtt://192.168.86.4:1883
26 Jan 08:19:55 - [info] [server:Home Assistant] Connecting to http://supervisor/core
26 Jan 08:19:56 - [info] [server:Home Assistant] Connecting to http://supervisor/core
26 Jan 08:19:56 - [info] [server:Home Assistant] Connecting to http://supervisor/core
26 Jan 08:19:56 - [info] [server:Home Assistant] Connecting to http://supervisor/core
26 Jan 08:19:56 - [info] [server:Home Assistant] Connected to http://supervisor/core
26 Jan 08:19:56 - [info] [server:Home Assistant] Connected to http://supervisor/core
26 Jan 08:19:56 - [info] [server:Home Assistant] Connected to http://supervisor/core
26 Jan 08:19:56 - [info] [server:Home Assistant] Connected to http://supervisor/core

Nothing jumps at me. I see the flows are started, connects to the mqtt broker, but nothing on the UI flows works as expected.
So I turned on safe mode and restarted, and everything works as expected. All nodes are active, and no warnings or error upon deployment. Here are the logs:

s6-rc: info: service s6rc-oneshot-runner: starting
s6-rc: info: service s6rc-oneshot-runner successfully started
s6-rc: info: service base-addon-banner: starting
-----------------------------------------------------------
 Add-on: Node-RED
 Flow-based programming for the Internet of Things
-----------------------------------------------------------
 Add-on version: 14.0.1
 You are running the latest version of this add-on.
 System: Home Assistant OS 9.4  (amd64 / qemux86-64)
 Home Assistant Core: 2023.1.7
 Home Assistant Supervisor: 2023.01.1
-----------------------------------------------------------
 Please, share the above information when looking for help
 or support in, e.g., GitHub, forums or the Discord chat.
-----------------------------------------------------------
s6-rc: info: service base-addon-banner successfully started
s6-rc: info: service fix-attrs: starting
s6-rc: info: service base-addon-log-level: starting
s6-rc: info: service fix-attrs successfully started
s6-rc: info: service base-addon-log-level successfully started
s6-rc: info: service legacy-cont-init: starting
s6-rc: info: service legacy-cont-init successfully started
s6-rc: info: service init-nginx: starting
s6-rc: info: service init-customizations: starting
s6-rc: info: service init-customizations successfully started
s6-rc: info: service init-nodered: starting
patching file nodes/ui_base.html
Hunk #1 succeeded at 1164 (offset 633 lines).
s6-rc: info: service init-nginx successfully started
up to date, audited 102 packages in 2s
5 packages are looking for funding
  run `npm fund` for details
2 high severity vulnerabilities
Some issues need review, and may require choosing
a different dependency.
Run `npm audit` for details.
s6-rc: info: service init-nodered successfully started
s6-rc: info: service nodered: starting
s6-rc: info: service nodered successfully started
s6-rc: info: service nginx: starting
s6-rc: info: service nginx successfully started
s6-rc: info: service legacy-services: starting
s6-rc: info: service legacy-services successfully started
[08:24:29] INFO: Setting safe mode startup
[08:24:29] INFO: Starting Node-RED...
> start
> node $NODE_OPTIONS node_modules/node-red/red.js --safe --settings /etc/node-red/config.js
26 Jan 08:24:31 - [info] 
Welcome to Node-RED
===================
26 Jan 08:24:31 - [info] Node-RED version: v3.0.2
26 Jan 08:24:31 - [info] Node.js  version: v18.12.1
26 Jan 08:24:31 - [info] Linux 5.15.80 x64 LE
26 Jan 08:24:32 - [info] Loading palette nodes
26 Jan 08:24:35 - [info] Dashboard version 3.3.0 started at /endpoint/ui
26 Jan 08:24:36 - [info] Settings file  : /etc/node-red/config.js
26 Jan 08:24:36 - [info] Context store  : 'default' [module=memory]
26 Jan 08:24:36 - [info] User directory : /config/node-red/
26 Jan 08:24:36 - [warn] Projects disabled : editorTheme.projects.enabled=false
26 Jan 08:24:36 - [info] Flows file     : /config/node-red/flows.json
26 Jan 08:24:36 - [info] Server now running at http://127.0.0.1:46836/
26 Jan 08:24:36 - [info] *****************************************************************
26 Jan 08:24:36 - [info] Flows stopped in safe mode. Deploy to start.
26 Jan 08:24:36 - [info] *****************************************************************
[08:24:36] INFO: Starting NGinx...

I am at a loss. Am I missing something obvious in the logs?
I saw the npm warnings but I am not sure how to fix them. Which terminal do I use to access?

Doin research on it, I found the following: Node red error messages at startup - #5 by code-in-progress, not sure if I this is my issue and therefore I cannot ignore. How do I go about fixing these npm issues if that could be the cause?

The npm issues can usually be fixed by going to the pallet and look for modules with updates and the click the update button.

There were a couple, so I updated. Still gives me the npm logs, and does not work.
Only work in safe mode so far.

I am at a loss…

I just checked my logs and I have a few warnings about critical updates too, but everything is running, so I do not think that is the cause.
I am a bit surprised that it have 4 lines with connection to http://supervisor/core in the logs.
Could you open up the Configuration Node panel in the upper right corner of NR and see how many server and mqtt-broker nodes you have there?

Here it is:
image

Looking at the numbers, each flow page has its own Home Assistant server node. and the number is the number of how many HA nodes are used. Seems logical, but not necessarily right (how does yours look like?).
I just click and drag the nodes I need. Never did more on the config other than the mqtt server.

Do you actually have 4 HA servers?
One should be enough per HA server.
At least try to rename them 1,2,3 and 4, so we might be able to see if it is a specific one of them that fails.
Maybe its an access token that have been corrupted or the lifetime have been reached or maybe it is the influence each other in some way.

Actually I do not. I only have 1 server running HA.
It seems that it is bringing one in for each flow page.

I never added these as servers, I added the entity nodes, and it seems they drag them in.

I will look into the token and the servers. Hope to have some documentation out there. It worked out of box for me until now, so will need to dig into how to get token assigned, etc. and the server situation.

So you have a single instance of the server on your machine? for all flow pages?

Start by giving the 3 of the servers a new name. Just add 1 2 3 after it. These will be the ones that will go, so it is smartest the leave the one with the most connections at the original name.
Next click on the number of one of the renamed server.
Now with the renamed servers listed hold your mouse over one of them and look at the flows.
If a node has a red marking around then doubleclick it and correct the server to the unrenamed one.
Remember to deploy regularly.
Continue until all renamed servers are at 0 and then doubleclick them and choose delete and then deploy again.

1 Like

ok, problem 1 solved. I deleted 3 servers, and readded all the HA nodes to the remaining one.

Now it all works…
I will keep watching it over the next few days…but this seems like it was it!
I realized the source of this was when I imported flows from another machine to this one, it must have imported its own HA server, even if both were named the same.

So when I deleted them, it disassociated the server from the nodes, and I went ahead and added all of them again, and now it is running.
Had to restart Node-Red, just FYI for anyone facing the same.

Just make sure to redo all nodes you import…

image

Happy to know you are back in business again.
And yes when you import flows then a home assistant setup usually appear as an extra, so be sure to check that regularly and delete unwanted setups.

1 Like