Node RED delays after adding node, other weird issues

Thanks for clarifying. I did a completely clean install from the Home Assistant OS image for the Pi4 to an SD card using Balena Etcher and didn’t restore anything once booted and I logged in. Completely clean, stock image.

I then installed only the MQTT Addon and Node Red Addon all with default settings apart from setting Node Red to ssl:false. I don’t have HACS installed.

Because it’s a clean, stock image with nothing restored, it’s odd that it’s getting the “undefined” messages and there’s the delay in Node Red when manipulating nodes where it says “No connection”. There has to be a bug somewhere in the system/configs that has crept into recent versions of either Home Assistant or the Addons as these issues weren’t there before. It’s a shame I can’t remember when the issues started.

Seems related to this: Node Red losing websocket connection

Particularly this post describing a 5 second delay: Node Red losing websocket connection - #18 by Kermit

If you don’t have hacs, you manually installed the HA websocket then?

Hmmm… No I didn’t manually install HA Websocket as far as I know. Do I need to? I’m not familiar with this, sorry.

EDIT: I’ve seen this but didn’t install it as I didn’t think I needed to.

It’s sets up the websocket link to HA. This is probably the cause for your undefined errors.

Edit: the web socket to create entities apparently. Do you have an entity node available in your palette?

image

I do have “Device” and "Entity* Nodes in the palette like in your screenshot yes but I don’t use them in any of my flows.

Isn’t the Node Red Add-on self-contained though? I don’t see anything in the Add-on docs to say it needs the additional integration. I’ve always used the Node Red Add-on “as-is” and it’s worked fine. If I need to include this custom integration I’ll definitely do it but it’s strange it’s not mentioned by the official Node Red Add-on docs.

I don’t use any of the functionality mentioned by the custom add-on. Am I missing something here? Have I accidentally added something to the Node Red Add-on that requires the extra custom integration? I avoided it also partly because they mentioned it’s not fully stable. Come to think of it, I noticed it had been added on one of my previous HA installations.

Not sure what to do… Any advice would be appreciated and thanks for helping out so far :slightly_smiling_face:

FWIW it’s the same dev that built the add-on so his code is already part of the node red add-on. If the nodes are there I’d assume that node red would load them even if they are not used. There are 2 ref to the custom component on the add-on page. I’ve also had it installed from the beginning and never had issues with it.

Ah ok, I’ll give it a try and see if it improves the delay issues. Thanks again for your help.

EDIT: So I’ve added the custom integration and I’m still getting:

17 Jun 13:24:25 - [info] [server:Home Assistant] Connecting to undefined
17 Jun 13:24:26 - [info] [server:Home Assistant] Connected to undefined

In the Node Red logs.

I’m also still getting the super annoying delay when I add Nodes in them connecting to HA and pulling in available services along with delays on some of my automations.

Somethings definitely off with Node Red talking to HA with these current versions. Ah well… I’ll wait for updates and hope they resolve it.

You could wait for an update I dont think that’s your problem. No one else seems to be having this problem. It just may be a corrupt installation, it happens. You should remove everything and reinstall. Don’t restore/import any of your old flows. Build a couple of new small flows and see if the lag is still there.

I hear what you’re saying but there’s definitely something up with the connection between HA and Node Red these days which wasn’t there before and I’m not the only one.

Not so that it’s causing huge issues but just quirks and bugs/delays, glitches/pauses here and there which is actually the worst kind of problem/bug to fix.

The concern is that they may at some point start to cause bigger issues if ignored so hopefully they’ll be looked into by the generous folks who make these addons and HA itself. I’m not sure where to post reports on this so that they can be investigated more. Others having similar strange issues:

https://www.reddit.com/r/homeassistant/comments/noe5ah/node_red_keep_loosing_connection/

This is from Jan 2020 and despite the OP “fixing” it, others say it isn’t fully resolved:

For everyone that posts, there are many more who don’t and just carry on as best they can.

“Connecting to undefined” isn’t good and doesn’t bode well for stability even if it’s not breaking things.

Am I better off posting on Github for the Node Red Addon than here?

So you have removed everything reinstalled and there still is a problem? One of those threads is from 2019 the other 2020 and the last was recent but solved with a reinstall.

Yes I’ve done this a couple of times already. Even without importing my saved flows, I still get the “Connecting to undefined” message. It’s not currently a “problem” - just a curious glitch that I know from experience isn’t necessarily good.

After installing the latest HA update, node red didn’t worked anymore. I’ve uninstalled it and reinstalled again and now i have exactly the same issues.

It’s hard to help when you just post “me too”. What are your logs, which version, which os, what type of install etc.

I’m having the same issues with a recent Home Assistant setup. This is my setup:

  • Home Assistant 2021.6.6 on a RPi 4 using Home Assistant OS
  • Configured with duckdns and Let’s encrypt cert
  • NodeRed add on v9.1.4

I’ve reinstalled the add-on several times.
I’ve tried Chrome and Edge browers from different computers
The behavior seems to be similar each time. I drop an item on the workflow, make a change, and click “Done”. The workflow build area greys over, and the UI hangs.

I would appreciate any help or suggestions. Thanks

I’ve attached some logs:

up to date in 0.656s
found 0 vulnerabilities
[cont-init.d] node-red.sh: exited 0.
[cont-init.d] done.
[services.d] starting services
[services.d] done.
[12:59:27] TRACE: bashio::net.wait_for 46836 localhost 300
[12:59:27] INFO: Starting Node-RED...
> addon-node-red@ start /opt
> node $NODE_OPTIONS node_modules/node-red/red.js "--settings" "/etc/node-red/config.js"
27 Jun 12:59:30 - [info] 
Welcome to Node-RED
===================
27 Jun 12:59:30 - [info] Node-RED version: v1.3.5
27 Jun 12:59:30 - [info] Node.js  version: v14.16.1
27 Jun 12:59:30 - [info] Linux 5.10.17-v8 arm64 LE
27 Jun 12:59:30 - [info] Loading palette nodes
27 Jun 12:59:31 - [debug] Module: @node-red-contrib-themes/dark 1.0.1 /opt/node_modules/@node-red-contrib-themes/dark
27 Jun 12:59:31 - [debug] Module: @node-red-contrib-themes/midnight-red 1.5.1 /opt/node_modules/@node-red-contrib-themes/midnight-red
27 Jun 12:59:31 - [debug] Module: @node-red-contrib-themes/oled 1.2.1 /opt/node_modules/@node-red-contrib-themes/oled
27 Jun 12:59:31 - [debug] Module: @node-red-contrib-themes/solarized-dark 1.1.1 /opt/node_modules/@node-red-contrib-themes/solarized-dark
27 Jun 12:59:31 - [debug] Module: @node-red-contrib-themes/solarized-light 1.1.1 /opt/node_modules/@node-red-contrib-themes/solarized-light
27 Jun 12:59:31 - [debug] Module: node-red-contrib-actionflows 2.0.4 /opt/node_modules/node-red-contrib-actionflows
27 Jun 12:59:31 - [debug] Module: node-red-contrib-alexa-home-skill 0.1.19 /opt/node_modules/node-red-contrib-alexa-home-skill
27 Jun 12:59:31 - [debug] Module: node-red-contrib-bigtimer 2.7.5 /opt/node_modules/node-red-contrib-bigtimer
27 Jun 12:59:31 - [debug] Module: node-red-contrib-cast 0.2.17 /opt/node_modules/node-red-contrib-cast
27 Jun 12:59:31 - [debug] Module: node-red-contrib-counter 0.1.6 /opt/node_modules/node-red-contrib-counter
27 Jun 12:59:31 - [debug] Module: node-red-contrib-home-assistant-websocket 0.33.1 /opt/node_modules/node-red-contrib-home-assistant-websocket
27 Jun 12:59:31 - [debug] Module: node-red-contrib-http-request 0.1.14 /opt/node_modules/node-red-contrib-http-request
27 Jun 12:59:31 - [debug] Module: node-red-contrib-influxdb 0.6.1 /opt/node_modules/node-red-contrib-influxdb
27 Jun 12:59:31 - [debug] Module: node-red-contrib-interval-length 0.0.4 /opt/node_modules/node-red-contrib-interval-length
27 Jun 12:59:31 - [debug] Module: node-red-contrib-looptimer 0.0.8 /opt/node_modules/node-red-contrib-looptimer
27 Jun 12:59:31 - [debug] Module: node-red-contrib-modbus 5.14.0 /opt/node_modules/node-red-contrib-modbus
27 Jun 12:59:31 - [debug] Module: node-red-contrib-moment 4.0.0 /opt/node_modules/node-red-contrib-moment
27 Jun 12:59:31 - [debug] Module: node-red-contrib-persistent-fsm 1.1.0 /opt/node_modules/node-red-contrib-persistent-fsm
27 Jun 12:59:31 - [debug] Module: node-red-contrib-statistics 2.2.2 /opt/node_modules/node-red-contrib-statistics
27 Jun 12:59:31 - [debug] Module: node-red-contrib-stoptimer 0.0.7 /opt/node_modules/node-red-contrib-stoptimer
27 Jun 12:59:31 - [debug] Module: node-red-contrib-sunevents 3.0.3 /opt/node_modules/node-red-contrib-sunevents
27 Jun 12:59:31 - [debug] Module: node-red-contrib-time-range-switch 1.1.1 /opt/node_modules/node-red-contrib-time-range-switch
27 Jun 12:59:31 - [debug] Module: node-red-contrib-timecheck 1.1.0 /opt/node_modules/node-red-contrib-timecheck
27 Jun 12:59:31 - [debug] Module: node-red-contrib-traffic 0.2.1 /opt/node_modules/node-red-contrib-traffic
27 Jun 12:59:31 - [debug] Module: node-red-dashboard 2.29.1 /opt/node_modules/node-red-dashboard
27 Jun 12:59:31 - [debug] Module: node-red-node-base64 0.3.0 /opt/node_modules/node-red-node-base64
27 Jun 12:59:31 - [debug] Module: node-red-node-email 1.12.1 /opt/node_modules/node-red-node-email
27 Jun 12:59:31 - [debug] Module: node-red-node-feedparser 0.2.1 /opt/node_modules/node-red-node-feedparser
27 Jun 12:59:31 - [debug] Module: node-red-node-geofence 0.2.2 /opt/node_modules/node-red-node-geofence
27 Jun 12:59:31 - [debug] Module: node-red-node-msgpack 1.2.1 /opt/node_modules/node-red-node-msgpack
27 Jun 12:59:31 - [debug] Module: node-red-node-pi-gpio 1.2.3 /opt/node_modules/node-red-node-pi-gpio
27 Jun 12:59:31 - [debug] Module: node-red-node-ping 0.3.1 /opt/node_modules/node-red-node-ping
27 Jun 12:59:31 - [debug] Module: node-red-node-random 0.4.0 /opt/node_modules/node-red-node-random
27 Jun 12:59:31 - [debug] Module: node-red-node-rbe 0.5.0 /opt/node_modules/node-red-node-rbe
27 Jun 12:59:31 - [debug] Module: node-red-node-sentiment 0.1.6 /opt/node_modules/node-red-node-sentiment
27 Jun 12:59:31 - [debug] Module: node-red-node-serialport 0.14.1 /opt/node_modules/node-red-node-serialport
27 Jun 12:59:31 - [debug] Module: node-red-node-smooth 0.1.2 /opt/node_modules/node-red-node-smooth
27 Jun 12:59:31 - [debug] Module: node-red-node-suncalc 1.0.1 /opt/node_modules/node-red-node-suncalc
27 Jun 12:59:31 - [debug] Module: node-red-node-tail 0.3.1 /opt/node_modules/node-red-node-tail
27 Jun 12:59:31 - [debug] Module: node-red-node-twitter 1.2.0 /opt/node_modules/node-red-node-twitter
27 Jun 12:59:35 - [info] Dashboard version 2.29.1 started at /endpoint/ui
/bin/sh: /opt/node_modules/node-red-node-pi-gpio/testgpio.py: not found
27 Jun 12:59:36 - [warn] rpi-gpio : Raspberry Pi specific node set inactive
27 Jun 12:59:36 - [info] Settings file  : /etc/node-red/config.js
27 Jun 12:59:36 - [info] Context store  : 'default' [module=memory]
27 Jun 12:59:36 - [info] User directory : /config/node-red/
27 Jun 12:59:36 - [warn] Projects disabled : editorTheme.projects.enabled=false
27 Jun 12:59:36 - [info] Flows file     : /config/node-red/flows.json
27 Jun 12:59:36 - [debug] loaded flow revision: 78fc1b302dbb2b3ce0f02f020d39a87f
27 Jun 12:59:36 - [debug] red/runtime/nodes/credentials.load : user provided key
27 Jun 12:59:36 - [debug] red/runtime/nodes/credentials.load : keyType=user
27 Jun 12:59:36 - [trace] runtime event: {"id":"runtime-state","retain":true}
27 Jun 12:59:36 - [trace] runtime event: {"id":"runtime-deploy","payload":{"revision":"78fc1b302dbb2b3ce0f02f020d39a87f"},"retain":true}
27 Jun 12:59:36 - [info] Server now running at http://127.0.0.1:46836/
27 Jun 12:59:36 - [info] Starting flows
27 Jun 12:59:36 - [debug] red/nodes/flows.start : starting flow : global
27 Jun 12:59:36 - [debug] red/nodes/flows.start : starting flow : 189c1c98.dd7bc3
27 Jun 12:59:36 - [trace] [flow:global] start flow [global]
27 Jun 12:59:36 - [trace] [flow:global] ------------------|--------------|-----------------
27 Jun 12:59:36 - [trace] [flow:global]  id               | type         | alias
27 Jun 12:59:36 - [trace] [flow:global] ------------------|--------------|-----------------
27 Jun 12:59:36 - [trace] [flow:global]  a0e5b31a.bfd38   | server       | 
27 Jun 12:59:36 - [trace] [flow:global] ------------------|--------------|-----------------
27 Jun 12:59:36 - [trace] [flow:189c1c98.dd7bc3] start flow [189c1c98.dd7bc3]
27 Jun 12:59:36 - [trace] runtime event: {"id":"runtime-state","retain":true}
27 Jun 12:59:36 - [info] Started flows
[12:59:36] INFO: Starting NGinx...
27 Jun 12:59:41 - [info] [server:Home Assistant] Connecting to undefined
27 Jun 12:59:41 - [info] [server:Home Assistant] Connected to undefined
27 Jun 12:59:41 - [debug] [server:Home Assistant] States Loaded
27 Jun 12:59:41 - [debug] [server:Home Assistant] Services Loaded
27 Jun 12:59:41 - [debug] [server:Home Assistant] HA State: running
27 Jun 13:00:24 - [trace] comms.open dWd71s3UTRni8862W5cXyvs3yM9Ra1x3Qn21l3S8BZg=
27 Jun 13:06:02 - [trace] comms.close dWd71s3UTRni8862W5cXyvs3yM9Ra1x3Qn21l3S8BZg=
27 Jun 13:06:53 - [trace] comms.open zlqRzQxpsmjdOZRD379MUqNcUKfkGsHdr5BP8eVORrE=
27 Jun 13:07:01 - [trace] comms.close zlqRzQxpsmjdOZRD379MUqNcUKfkGsHdr5BP8eVORrE=
27 Jun 13:21:54 - [trace] comms.open ktd3p2WpcAPkQdBh7wpatQcblgF7v6EJsEqDVlxDHQg=
27 Jun 13:23:11 - [trace] comms.close ktd3p2WpcAPkQdBh7wpatQcblgF7v6EJsEqDVlxDHQg=

How’s your HD decent amount of space free? Have you checked to see if the nodered folder and container are actually deleted upon removal? Also the supervisor logs on the system page may or may not also give some clues.

Hi. Thanks for the reply.

There isn’t much in the supervisor logs that indicates a problem. A few info msg:

21-06-28 21:01:41 INFO (MainThread) [supervisor.host] Host information reload completed
21-06-28 21:02:00 INFO (MainThread) [supervisor.api.proxy] Home Assistant WebSocket API request initialize
21-06-28 21:02:00 INFO (MainThread) [supervisor.api.proxy] WebSocket access from a0d7b954_nodered
21-06-28 21:02:00 INFO (MainThread) [supervisor.api.proxy] Home Assistant WebSocket API request running

I have a 240GB SSD with 204.1 GB free.

How do you check that the container is deleted? I don’t know how to check for that.

I haven’t previously checked that the folder is gone after the delete. I just removed the add-on again, and I see that /root/config/node-red is still there. Is that the folder?

I deleted the folder, reinstalled the add-on, and tried a few basic things (drop an inject node on the flow1, modify some attributes, hit done. Same problem. Workspace greys up and hangs. Sometimes I get this error:

Could you expand on this?

I believe all settings and such is stored in the folder inside config so don’t worry about the container. Besides it works after the reinstall, it’s only after you try and change something.

Shot in the dark but it seems to be the answer to some recent behavioral issues. Replace 8123 with 1880 on you HA ip address. This is the default direct port to node red.

“Modify some attributes” means change some properties on the object. For the inject node, this would be the payload or topic, and then click done. I’ve found that I don’t actually have to change anything. I can just click done.

Shot in the dark but it seems to be the answer to some recent behavioral issues. Replace 8123 with 1880 on you HA ip address. This is the default direct port to node red.

This works!! I don’t see the Node-red UI in the HomeAssistant UI, but this is actually better because the Node-red UI can expand to the full window.

For others who are experiencing this problem, I have the following (TCP) port forwarding rules enabled:
8123 → 8123 on my home assistant server
443 → 8123 on my home assistant server
1880 → 1880 on my home assistant server

I access the home assistant UI using https://xxxx.duckdns.org and now Node-red from https://xxxx.duckdns.org:1880.

Thanks for the help

I’m having a similar issue but it doesn’t manifest in quite the same way.
I have a flow that does some things at a certain time, for example:
At Dusk → turn on LightABC & LightXYZ
At Dawn → turn off LightABC & LightXYZ
What’s strange is that after deployment, one of the two LightABC nodes on there says “no connection” initially but the other one is always fine. I have even copied and pasted the node so I know its the exact same config. After a while (longer than 10 seconds, more like 30 minutes) eventually everything says its happy. without any change action from me.
The relevant logs seem to be:

19 Jul 12:55:10 - [error] [api-call-service:Turn off Front Porch Light] Call-Service attempted without connection to server.
19 Jul 12:55:10 - [error] [api-call-service:Turn off Mud Room Light] Call-Service attempted without connection to server.
19 Jul 12:55:10 - [error] [api-call-service:Turn off Game Room N Light] Call-Service attempted without connection to server.
19 Jul 12:55:10 - [error] [api-call-service:Turn on Game Room N Light] Call-Service attempted without connection to server.

In a call service node, the server drop down list, are there multiple instances of home assistant? image