Unable to deploy flow or activate debug node- no error message

I seem to have an issue with NodeRed v18.0.5 running HA Core 2024.8.2, supervisor 2024.08.0, operating system 13.0.

All my flows are working and I cannot find any errors in the log. When I try to deploy a flow the icon will turn grey and nothing happens:
Deploy

Also I am unable to toggle debug nodes on/off or activate inject nodes. The cursor is not changing to a “hand” when I hover the cursor over the button. This is when accessing NodeRed from the sidebar button in Home Assistant. If I access Node Red directly in the browser using port 1880 (https) the toggle works and debug info is shown. Still unable to deploy any changes (stuck on grey, animated icon).

I have no init_commands set as others have had issues with. Tried restarting both NodeRed and the server itself. I am not sure when this issue started since flows are working and I have not accessed NodeRed for editing the last few months.

Any help greatly appreciated :slight_smile:

Configuration:

Here’s a log of the startup:


-----------------------------------------------------------
 Add-on: Node-RED
 Flow-based programming for the Internet of Things
-----------------------------------------------------------
 Add-on version: 18.0.5
 You are running the latest version of this add-on.
 System: Home Assistant OS 13.0  (amd64 / qemux86-64)
 Home Assistant Core: 2024.8.2
 Home Assistant Supervisor: 2024.08.0
-----------------------------------------------------------
 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
Log level is set to INFO
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
s6-rc: info: service init-nginx successfully started

up to date, audited 222 packages in 3s

24 packages are looking for funding
  run `npm fund` for details

22 vulnerabilities (1 low, 8 moderate, 13 high)

To address issues that do not require attention, run:
  npm audit fix

To address all issues (including breaking changes), run:
  npm audit fix --force

Run `npm audit` for details.
npm notice
npm notice New minor version of npm available! 10.7.0 -> 10.8.2
npm notice Changelog: https://github.com/npm/cli/releases/tag/v10.8.2
npm notice To update run: npm install -g [email protected]
npm notice
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
[00:24:16] INFO: Starting Node-RED...
s6-rc: info: service legacy-services successfully started

> start
> node $NODE_OPTIONS node_modules/node-red/red.js --settings /etc/node-red/config.js

19 Aug 00:24:17 - [info] 

Welcome to Node-RED
===================

19 Aug 00:24:17 - [info] Node-RED version: v4.0.2
19 Aug 00:24:17 - [info] Node.js  version: v18.20.3
19 Aug 00:24:17 - [info] Linux 6.6.44-haos x64 LE
19 Aug 00:24:17 - [info] Loading palette nodes
19 Aug 00:24:17 - [info] Node-RED Contrib Theme Collection version: v4.0.8
19 Aug 00:24:19 - [info] Dashboard version 3.6.5 started at /endpoint/ui
19 Aug 00:24:20 - [info] Settings file  : /etc/node-red/config.js
19 Aug 00:24:20 - [info] Context store  : 'default' [module=memory]
19 Aug 00:24:20 - [info] User directory : /config/
19 Aug 00:24:20 - [warn] Projects disabled : editorTheme.projects.enabled=false
19 Aug 00:24:20 - [info] Flows file     : /config/flows.json
19 Aug 00:24:20 - [info] Server now running at http://127.0.0.1:46836/
[00:24:20] INFO: Starting NGinx...
19 Aug 00:24:20 - [info] Starting flows
19 Aug 00:24:20 - [info] Started flows
19 Aug 00:24:20 - [info] [mqtt-broker:ddfd67f2e0801068] Connected to broker: mqtt://localhost:1883
19 Aug 00:24:25 - [info] [server:Home Assistant] Connecting to http://supervisor/core
19 Aug 00:24:25 - [info] [server:Home Assistant] Connected to http://supervisor/core
19 Aug 00:24:25 - [info] [server:Home Assistant] Connecting to http://supervisor/core
19 Aug 00:24:25 - [info] [server:Home Assistant] Connecting to http://supervisor/core
19 Aug 00:24:25 - [info] [server:Home Assistant] Connecting to http://supervisor/core
19 Aug 00:24:25 - [info] [server:Home Assistant] Connecting to http://supervisor/core
19 Aug 00:24:25 - [info] [server:Home Assistant] Connected to http://supervisor/core
19 Aug 00:24:25 - [info] [server:Home Assistant] Connected to http://supervisor/core
19 Aug 00:24:25 - [info] [server:Home Assistant] Connected to http://supervisor/core
19 Aug 00:24:25 - [info] [server:Home Assistant] Connected to http://supervisor/core

At a guess and as a starting point:

You are using Node-RED as an addon.
You appear to have five (5) Home Assistant servers set up, when you should only have one (1).

Each Home Assistant server uses the WebSocket connection with HA. The Node-RED editor (run as a web-page from within HA using the side-bar) also uses the WebSocket connection, with API calls back to Node-RED for deployment and for using the Inject and Debug nodes, as well as for updating node status.

If you have too many WebSocket connections the HA WebSocket becomes overloaded and stops working (correctly / at all), thus preventing the Node-RED editor from working. Using Node-RED outside of HA does not use the HA WebSocket but connects more directly, hence that approach will continue to work.

If you go to Node-RED debug window, and select the Home Assistant tab, you can check the Server list. There should be only one Home Assistant (server) with the number of nodes using that server on the right.

You can rename the server, as I have done here to help differentiate between two or more (in cases where you have a reason for multiple servers, such as different HA instances on different machines, or for temporary testing purposes).
You can click on the number to generate a list of configuration nodes connected to each server, which enables easy editing so as to consolidate all nodes to just the one server.

Nodes with 0 can be either deleted or disabled (as I have done here) which then reduces the load on the WebSocket, allowing not only the WebSocket nodes to function correctly, but also Node-RED editor (run from the side-bar) to function correctly.

If you do only have the one Home Assistant server, then the multiple connection attempts suggest a possible problem with server configuration (although ‘Using Node-RED as an addon’ should require no further configuration settings). Alternatively it could be a problem with one errant (contrib-) node that you have installed, and updating all nodes in the palette often cures such issues.

Hope this helps!

I do have a similar problem with deploy. From my main Laptop with W11 deploy is since a couple of days extremly slow (40 seconds).
Connecting and deploying from other hardware and browser works fine (deploy < 1 secs)

There has been Windows and HA updates - I tried to roll back but without success.
Any idea what I can do?

Have you cleared the cache of the problem browser? Can you try a different browser on the same machine with the problem browser?

Yes I tried different browsers and cleared the cache. I do have other node-red installations (HA and in ioBroker) all work with deploy from my Laptop.

My main HA installation uses the node-red addon and was working fine until some days ago. Everything is working - just deploy is extremly slow.
Connecting from other devices is fine and deploy very fast.

In the addon page, configuration tab, change the log level to trace. Save and restart NR. When it starts back up deploy something then go to the logs.

It’s easier to view them in settings, system, logs, top right drop down, choose NR. You should be able to see what happens when you deploy.

btw how are you accessing NR? Try using the direct port if you aren’t using it already. Your HA IP address with port 1880 instead of 8123.

I tried trace. The only difference I see compared to deploy from Android Tablet:
The tablet deploy is shown in log a second later. The Windows 11 deploy is shown just 40-50 seconds later. Nothing in log inbetween.

I tested on my Desktop - the same as Laptop. It might be due to recent Windows 11 updates ???

Using the direct port for access does not make any difference.

Windows firewall is definitely on the tip of my tongue. Just to make sure you are using the modified nodes only option when you deploy?

You can try scanning the port to see what the latency is, I don’t think it will show anything but ynk. Open a command shell and enter nmap -p 1880 192.Your.HA.IP

@Cregeland

If this is caused by multiple servers, this can happen when importing flows. Use this tool to avoid this problem in the future.

https://zachowj.github.io/node-red-contrib-home-assistant-websocket/scrubber/

I actually have same problem that I noticed during weekend when I tried to add some changes. I am able to load node red inside home assistant webpage, I am able to open it directly via IP and port, I can do anything inside, I was even able to update some palettes but I am unable to deploy any changes. I tried 3 different Windows computers + one virtual Linux and 4 different web browsers and cell phone. I was able to update it twice from my desktop and it took eternity (but not anymore) I was able to deploy form another computer and it also took a long time and I am able to deploy changes without any problems from my cellphone but most time I getting “Deploy failed: No response from server” I tried rollback everything that changed in last few days (Node Red, Nginx, HA Core) but I am not able to deploy even on older versions.
I set node red logging to trace but there is not a scratch from unsuccessful deploys.
I am actually pretty desperate. :-/

Here is my log:

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
s6-rc: info: service init-nginx successfully started

up to date, audited 265 packages in 7s

53 packages are looking for funding
  run `npm fund` for details

13 vulnerabilities (3 moderate, 8 high, 2 critical)

To address issues that do not require attention, run:
  npm audit fix

To address all issues possible (including breaking changes), run:
  npm audit fix --force

Some issues need review, and may require choosing
a different dependency.

Run `npm audit` for details.
npm notice
npm notice New minor version of npm available! 10.7.0 -> 10.8.2
npm notice Changelog: https://github.com/npm/cli/releases/tag/v10.8.2
npm notice To update run: npm install -g [email protected]
npm notice
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
[18:59:00] INFO: Starting Node-RED...

> start
> node $NODE_OPTIONS node_modules/node-red/red.js --settings /etc/node-red/config.js

19 Aug 18:59:04 - [info] 

Welcome to Node-RED
===================

19 Aug 18:59:04 - [info] Node-RED version: v4.0.2
19 Aug 18:59:04 - [info] Node.js  version: v18.20.3
19 Aug 18:59:04 - [info] Linux 6.6.44-haos x64 LE
19 Aug 18:59:05 - [info] Loading palette nodes
19 Aug 18:59:07 - [info] Node-RED Contrib Theme Collection version: v4.0.8
19 Aug 18:59:14 - [info] Dashboard version 3.6.5 started at /endpoint/ui
19 Aug 18:59:17 - [info] Settings file  : /etc/node-red/config.js
19 Aug 18:59:17 - [info] Context store  : 'default' [module=memory]
19 Aug 18:59:17 - [info] User directory : /config/
19 Aug 18:59:17 - [warn] Projects disabled : editorTheme.projects.enabled=false
19 Aug 18:59:17 - [info] Flows file     : /config/flows.json
19 Aug 18:59:17 - [info] Server now running at http://127.0.0.1:46836/
[18:59:17] INFO: Starting NGinx...
19 Aug 18:59:17 - [warn] 

---------------------------------------------------------------------
Your flow credentials file is encrypted using a system-generated key.

If the system-generated key is lost for any reason, your credentials
file will not be recoverable, you will have to delete it and re-enter
your credentials.

You should set your own key using the 'credentialSecret' option in
your settings file. Node-RED will then re-encrypt your credentials
file using your chosen key the next time you deploy a change.
---------------------------------------------------------------------

19 Aug 18:59:18 - [info] Starting flows
19 Aug 18:59:23 - [info] Started flows
(node:298) MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 init listeners added to [stateNode]. Use emitter.setMaxListeners() to increase limit
(Use `node --trace-warnings ...` to show where the warning was created)
(node:298) MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 change listeners added to [stateNode]. Use emitter.setMaxListeners() to increase limit
19 Aug 18:59:23 - [info] [server:Home Assistant (Odin)] Connecting to http://localhost:8123
19 Aug 18:59:23 - [error] [api-current-state:Workroom Temp] InputError: Entity could not be found in cache for entityId: sensor.env01_temperature
19 Aug 18:59:23 - [error] [api-current-state:Bedroom Temp] InputError: Entity could not be found in cache for entityId: sensor.env02_temperature
19 Aug 18:59:23 - [error] [api-current-state:Kitchen Temp] InputError: Entity could not be found in cache for entityId: sensor.env03_temperature
19 Aug 18:59:23 - [error] [api-current-state:Workroom Hum] InputError: Entity could not be found in cache for entityId: sensor.env01_humidity
19 Aug 18:59:23 - [error] [api-current-state:Bedroom Hum] InputError: Entity could not be found in cache for entityId: sensor.env02_humidity
19 Aug 18:59:23 - [error] [api-current-state:Kitchen Hum] InputError: Entity could not be found in cache for entityId: sensor.env03_humidity
19 Aug 18:59:23 - [error] [api-current-state:Get Weather State] InputError: Entity could not be found in cache for entityId: weather.odin
19 Aug 18:59:23 - [error] [api-current-state:9309431d931ff587] InputError: Entity could not be found in cache for entityId: sensor.any_pc_lastactive
19 Aug 18:59:23 - [error] [api-current-state:eefc858c2c4d44c9] InputError: Entity could not be found in cache for entityId: sensor.any_envy_lastactive
19 Aug 18:59:23 - [error] [ha-sensor:Nightsleep] NoConnectionError
19 Aug 18:59:23 - [info] [mqtt-broker:mqtt-odin] Connected to broker: http://localhost
19 Aug 18:59:23 - [error] [ha-sensor:day_phase] NoConnectionError
19 Aug 18:59:23 - [info] [server:Home Assistant (Odin)] Connected to http://localhost:8123

Edit: ok, now I’m not able to deploy from any device except my android phone… even on those PC where it tooks dozens of seconds now timeouted every time:-/

Thanks for your input. Port scanning gives 3 msec response. I tried to disable firewall without any change on deploy.

Thanks for your suggestion @Biscuit. I have 5 connections to the same server. The reason is likely that I had some help with a few flows that were imported from others - which may have created duplicates. To fix this - would I simply change the Home Assistant server reference on the relevant nodes so that all use the same one - and then try to deploy the updated flows again?

Yes.

Multiple Home Assistant servers (configuration nodes) is a common occurrence caused by importing other’s code without using the scrubber.

Having more than one working server rapidly increases the likelihood of issues, so consolidating back to one server is a very good idea.

The new-ish Home Assistant tab in the debug window is a great help, as we can see that you have many servers, and we can see how many nodes are using them, and we can easily get to both server configuration and the nodes.

First:
Audit the servers and check to see that they are all using the same HA and connection. This means that they are indeed duplicated.

Second:
Select one to remain, sensibly the one with the currently largest number of nodes connected. You may wish to edit the server name so it is very obvious which one you are going to pick for the lists later. A safer option is to rename all the unwanted servers, since anyone using the Global homeassistant context variable need the ‘homeassistant’ name for reference.

Third:
Starting with one server, click on the number to bring up the list of connected nodes, and then for each node in the list edit the HA server drop down selection to pick the server you wish to keep. Keep going until this list is empty and the connected nodes count is zero.

Finally:
When the count is zero, click on the name to edit the server configuration, and select ‘delete’ to remove it.

Deploy:
You will need to deploy at any point a change is made that you wish to keep. Clearly if you can, do so regularly. If you can’t I suggest making upto 10 changes and then deploying so as to save the editor changes back to Node-RED.

Temp Fix:
Since the issue may be the multiple servers, you could select the ones you want to delete, and disable the node configuration, then deploy. This makes many nodes fail, but does hopefully remove the immediate demand on the WebSocket which may make Node-RED work correct, thus allowing you to edit and deploy rapidly as you fix the issue.

There are other ways to address this - one is to disable one of the HA Server configuration nodes you don’t want to keep and deploying. This will cause all their connected nodes to ‘error’ and complain that they don’t have a working server - it is then a case of going through the flows looking for them and editing each one to select the server you want to keep from the list. Personally I prefer to work from the Home Assistant Tab but it is a matter of choice.

It is possible to edit the flow.json file itself, however this can be very dangerous, and as a starter you need to modify the name of the server you want to keep so as to differentiate it from the rest.

NOTE:
It is much easier to prevent this issue in the first place than it is to fix it later, so for anyone reading this I cannot emphasis enough, as Mikefila has said above, use the scrubber to remove Home Assistant server configuration nodes from imported code BEFORE you import! (Alternatively, I quickly hand-edit the pasted-in code and remove servers that way).
AND - if anyone posts any Node-RED code to the forum, they should get into the habit of using the scrubber as a matter of process BEFORE exporting please!

All this about multiple servers is excellent information and much appreciated, however it is a distraction from the current issue. I have a single server (and deploy modified-nodes-only) and yet my deploy time has shot up from a few seconds to close to a minute. Something has changed recently that is causing significant delay/slowness in the deployment process. At least for some subset of us.

And this is incredibly difficult to debug and fix.

There are three things going on here.

  • The Node-RED program, running on the HA machine if as an addon, with the NR server
  • The Node-RED Editor program, running in a web browser elsewhere
  • The WebSocket connection, which extends from the Node-RED editor (as JavaScript) back to the Node-RED server.

If Node-RED has memory / performance issues then it will slow down, thus impacting the Node-RED back-end server

If the browser has caching / memory issues, then it will slow down, thus impacting the editor

The connection (NR editor to NR server) on a free-standing Node-RED machine goes almost directly from the web browser (machine) to the NR server (different machine) however when NR is an addon, this must go via the Supervisor proxy and the HA WebSocket. If anything is impacting HA and the HA WebSocket, the supervisor, the proxy, or the connections between the docker containers, then the connection will slow down or fail.

There have been many posting about this issue, and the common theme is that there are no/effective solutions posted. I am sorry, but I can only address the multi-HA server issue as a) I know what it is b) I know it is a cause in some cases and c) I know how to fix it.

Where the deep issue has anything to do with the HA WebSocket, Supervisor Proxy, Docker Container setup I cannot contribute any useful input. I have been trying to read up on this specific area, but as yet there is far too much going on that I have not a clue about.

Over to anyone who can debug the Supervisor Proxy and HA WebSocket…

1 Like

Thank you for your excellent post with lots of good info. I am able to point all my nodes to the same HomeAssistant connection (I only have 1x HomeAssistant server).

The issue is that I am still not able to deploy these flows since the deploy icon is simply greyed out/looping. I have tried to only deploy changed flows but the nodes in the flows that now have new homeassistant connections are not even highlighted as changed (no small blue circle)

From the screen shot you posted, you do not have five connections to the same server - you have five different servers set up, four of which have configuration nodes using them.
Your NR start up logs show five different servers attempting connection, and your Home Assistant tab shows five, quite different, server configuration nodes (all called Home Assistant but they are different nodes and each a server).
That is a likely root cause of your issues.

Try going more directly to the Node-RED editor using

ha-ip-address:1880

where the 1880 is the port exposed by the addon as set in the Node-RED addon configuration page

You will need to log on using your Home Assistant logon user and password as this is not using the Supervisor ingress path.

Thank you for your help. I am logged on using port 1880 with HA logon. I am now able to deploy 1 or 2 nodes. I change only 1 or 2 nodes to the one server node that will remain then run a “modified node deployment”. This takes a long time - 3 minutes for 1 node. If I try to do all nodes at once it will eventually give an error - no response from server.

Forgive my lack of knowledge here - but just so I get this right:

  • I have 1 physical server running proxmox that hosts a single Home Assistant server.
  • I have installed NodeRed addon that I am configuring using the UI presented through HomeAssistant - or now directly on port 1880.
  • By importing flows I have unfortunately created additonal instances of the NodeRed addon - or is it multiple, independent NodeRed server instances - but still only 1 add-on installed?

Sorry for the basic questions - I’m still quite new to this :slight_smile:

Your suggestion to disable flows using servers that will be deleted might increase the performance. I am just a little worried about what happens if the deployment fails when I have chosen to disable a flow. Flows are working in HA so no downtime on any automations etc right now. But if a deployment fails when disabling - or fails when trying to enable again I might have bigger issues on my hand quickly :slight_smile:

Ok, in my case it is definatelly some network problem because when I use my cellphone as a proxy (cellphone on my wifi network and tethering via USB to PC) I can deploy everything without problem. But have no idea what happened because i did nothing with my home network.

For what it’s worth, I made a small change on a single flow using my windows desktop via Firefox browser, and the deploy took almost a minute. I made the same change using my iPhone companion app and it deployed almost instantly. I have no clue what to try next, but I’m open to suggestions!