Node Red Entities Not Responding after v3+ upgrade, any advice? [Solved]

Since I did the Node Red update which uses Ingress my flows aren’t working anymore.

When something runs the debug log has errors about not being able to read.
Screenshot_3

Everything was working happily before the v3.0.0 update.

I have uninstalled Node-Red, Deleted the Config/Node-Red folder reinstalled and reimported my flow and nothing has changed.

Is there some kind of old permission file for node red pre v3.0.0 that might be hanging around which is blocking node red from accessing my entities in Home assistant?

Here is latest log
24 Apr 17:37:05 - [info] Starting flows
24 Apr 17:37:05 - [error] [server-state-changed:4567d933.1879d8] TypeError: Cannot read property ‘addListener’ of undefined
24 Apr 17:37:05 - [error] [server-state-changed:e1dbebb4.70c958] TypeError: Cannot read property ‘addListener’ of undefined
24 Apr 17:37:05 - [info] Started flows
[24/Apr/2019:17:37:05 +0800] 200 192.168.8.225, 172.30.32.1(172.30.32.2) POST /flows HTTP/1.1 (Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/73.0.3683.103 Safari/537.36)
24 Apr 17:37:06 - [error] [api-call-service:Garage Lights ON] TypeError: Cannot read property ‘connectionState’ of undefined
[24/Apr/2019:17:37:06 +0800] 200 192.168.8.225, 172.30.32.1(172.30.32.2) POST /inject/25568cff.1055a4 HTTP/1.1 (Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/73.0.3683.103 Safari/537.36)
24 Apr 17:37:07 - [error] [api-call-service:Garage Lights ON] TypeError: Cannot read property ‘connectionState’ of undefined
[24/Apr/2019:17:37:07 +0800] 200 192.168.8.225, 172.30.32.1(172.30.32.2) POST /inject/25568cff.1055a4 HTTP/1.1 (Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/73.0.3683.103 Safari/537.36)
(node:505) UnhandledPromiseRejectionWarning: TypeError: Cannot read property ‘getStates’ of undefined
at CurrentStateNode.onInput (/opt/node_modules/node-red-contrib-home-assistant-websocket/nodes/current-state/current-state.js:61:51)
at CurrentStateNode.preOnInput (/opt/node_modules/node-red-contrib-home-assistant-websocket/lib/base-node.js:440:18)
at CurrentStateNode.emit (events.js:182:13)
at CurrentStateNode.Node.receive (/opt/node_modules/@node-red/runtime/lib/nodes/Node.js:237:14)
at SwitchNode.Node.send (/opt/node_modules/@node-red/runtime/lib/nodes/Node.js:224:14)
at applyRules (/opt/node_modules/@node-red/nodes/core/logic/10-switch.js:441:42)
at applyRule (/opt/node_modules/@node-red/nodes/core/logic/10-switch.js:224:17)
at getV2 (/opt/node_modules/@node-red/nodes/core/logic/10-switch.js:199:17)
at getV2 (/opt/node_modules/@node-red/nodes/core/logic/10-switch.js:168:13)
at getV1 (/opt/node_modules/@node-red/nodes/core/logic/10-switch.js:181:13)
(node:505) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 27)
24 Apr 17:37:07 - [error] [api-call-service:Bedside Light ON] TypeError: Cannot read property ‘connectionState’ of undefined
(node:505) UnhandledPromiseRejectionWarning: TypeError: Cannot read property ‘getStates’ of undefined
at CurrentStateNode.onInput (/opt/node_modules/node-red-contrib-home-assistant-websocket/nodes/current-state/current-state.js:61:51)
at CurrentStateNode.preOnInput (/opt/node_modules/node-red-contrib-home-assistant-websocket/lib/base-node.js:440:18)
at CurrentStateNode.emit (events.js:182:13)
at CurrentStateNode.Node.receive (/opt/node_modules/@node-red/runtime/lib/nodes/Node.js:237:14)
at SwitchNode.Node.send (/opt/node_modules/@node-red/runtime/lib/nodes/Node.js:224:14)
at applyRules (/opt/node_modules/@node-red/nodes/core/logic/10-switch.js:441:42)
at applyRule (/opt/node_modules/@node-red/nodes/core/logic/10-switch.js:224:17)
at getV2 (/opt/node_modules/@node-red/nodes/core/logic/10-switch.js:199:17)
at getV2 (/opt/node_modules/@node-red/nodes/core/logic/10-switch.js:168:13)
at getV1 (/opt/node_modules/@node-red/nodes/core/logic/10-switch.js:181:13)
(node:505) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 28)
(node:505) UnhandledPromiseRejectionWarning: TypeError: Cannot read property ‘getStates’ of undefined
at CurrentStateNode.onInput (/opt/node_modules/node-red-contrib-home-assistant-websocket/nodes/current-state/current-state.js:61:51)
at CurrentStateNode.preOnInput (/opt/node_modules/node-red-contrib-home-assistant-websocket/lib/base-node.js:440:18)
at CurrentStateNode.emit (events.js:182:13)
at CurrentStateNode.Node.receive (/opt/node_modules/@node-red/runtime/lib/nodes/Node.js:237:14)
at SwitchNode.Node.send (/opt/node_modules/@node-red/runtime/lib/nodes/Node.js:224:14)
at applyRules (/opt/node_modules/@node-red/nodes/core/logic/10-switch.js:441:42)
at applyRule (/opt/node_modules/@node-red/nodes/core/logic/10-switch.js:224:17)
at getV2 (/opt/node_modules/@node-red/nodes/core/logic/10-switch.js:199:17)
at getV2 (/opt/node_modules/@node-red/nodes/core/logic/10-switch.js:168:13)
at getV1 (/opt/node_modules/@node-red/nodes/core/logic/10-switch.js:181:13)
(node:505) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 29)
[24/Apr/2019:17:37:26 +0800] 200 192.168.8.225, 172.30.32.1(172.30.32.2) GET /red/images/typedInput/09.png HTTP/1.1 (Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/73.0.3683.103 Safari/537.36)
[24/Apr/2019:17:37:26 +0800] 200 192.168.8.225, 172.30.32.1(172.30.32.2) GET /red/images/typedInput/az.png HTTP/1.1 (Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/73.0.3683.103 Safari/537.36)
[24/Apr/2019:17:37:26 +0800] 200 192.168.8.225, 172.30.32.1(172.30.32.2) GET /red/images/typedInput/json.png HTTP/1.1 (Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/73.0.3683.103 Safari/537.36)
[24/Apr/2019:17:37:26 +0800] 200 192.168.8.225, 172.30.32.1(172.30.32.2) GET /red/images/typedInput/bin.png HTTP/1.1 (Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/73.0.3683.103 Safari/537.36)
[24/Apr/2019:17:37:26 +0800] 200 192.168.8.225, 172.30.32.1(172.30.32.2) GET /red/images/typedInput/bool.png HTTP/1.1 (Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/73.0.3683.103 Safari/537.36)
[24/Apr/2019:17:37:26 +0800] 200 192.168.8.225, 172.30.32.1(172.30.32.2) GET /red/images/typedInput/env.png HTTP/1.1 (Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/73.0.3683.103 Safari/537.36)
24 Apr 17:37:37 - [info] Stopping flows
24 Apr 17:37:37 - [info] Stopped flows
24 Apr 17:37:37 - [info] Starting flows
24 Apr 17:37:37 - [error] [server-state-changed:4567d933.1879d8] TypeError: Cannot read property ‘addListener’ of undefined
24 Apr 17:37:37 - [error] [server-state-changed:e1dbebb4.70c958] TypeError: Cannot read property ‘addListener’ of undefined
24 Apr 17:37:37 - [info] Started flows
[24/Apr/2019:17:37:37 +0800] 200 192.168.8.225, 172.30.32.1(172.30.32.2) POST /flows HTTP/1.1 (Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/73.0.3683.103 Safari/537.36)
24 Apr 17:37:38 - [error] [api-call-service:Garage Lights ON] TypeError: Cannot read property ‘connectionState’ of undefined
[24/Apr/2019:17:37:38 +0800] 200 192.168.8.225, 172.30.32.1(172.30.32.2) POST /inject/25568cff.1055a4 HTTP/1.1 (Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/73.0.3683.103 Safari/537.36)
24 Apr 17:37:39 - [error] [api-call-service:Bedside Light ON] TypeError: Cannot read property ‘connectionState’ of undefined
(node:505) UnhandledPromiseRejectionWarning: TypeError: Cannot read property ‘getStates’ of undefined
at CurrentStateNode.onInput (/opt/node_modules/node-red-contrib-home-assistant-websocket/nodes/current-state/current-state.js:61:51)
at CurrentStateNode.preOnInput (/opt/node_modules/node-red-contrib-home-assistant-websocket/lib/base-node.js:440:18)
at CurrentStateNode.emit (events.js:182:13)
at CurrentStateNode.Node.receive (/opt/node_modules/@node-red/runtime/lib/nodes/Node.js:237:14)
at SwitchNode.Node.send (/opt/node_modules/@node-red/runtime/lib/nodes/Node.js:224:14)
at applyRules (/opt/node_modules/@node-red/nodes/core/logic/10-switch.js:441:42)
at applyRule (/opt/node_modules/@node-red/nodes/core/logic/10-switch.js:224:17)
at getV2 (/opt/node_modules/@node-red/nodes/core/logic/10-switch.js:199:17)
at getV2 (/opt/node_modules/@node-red/nodes/core/logic/10-switch.js:168:13)
at getV1 (/opt/node_modules/@node-red/nodes/core/logic/10-switch.js:181:13)
(node:505) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 30)
(node:505) UnhandledPromiseRejectionWarning: TypeError: Cannot read property ‘getStates’ of undefined
at CurrentStateNode.onInput (/opt/node_modules/node-red-contrib-home-assistant-websocket/nodes/current-state/current-state.js:61:51)
at CurrentStateNode.preOnInput (/opt/node_modules/node-red-contrib-home-assistant-websocket/lib/base-node.js:440:18)
at CurrentStateNode.emit (events.js:182:13)
at CurrentStateNode.Node.receive (/opt/node_modules/@node-red/runtime/lib/nodes/Node.js:237:14)
at SwitchNode.Node.send (/opt/node_modules/@node-red/runtime/lib/nodes/Node.js:224:14)
at applyRules (/opt/node_modules/@node-red/nodes/core/logic/10-switch.js:441:42)
at applyRule (/opt/node_modules/@node-red/nodes/core/logic/10-switch.js:224:17)
at getV2 (/opt/node_modules/@node-red/nodes/core/logic/10-switch.js:199:17)
at getV2 (/opt/node_modules/@node-red/nodes/core/logic/10-switch.js:168:13)
at getV1 (/opt/node_modules/@node-red/nodes/core/logic/10-switch.js:181:13)
(node:505) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 31)
(node:505) UnhandledPromiseRejectionWarning: TypeError: Cannot read property ‘getStates’ of undefined
at CurrentStateNode.onInput (/opt/node_modules/node-red-contrib-home-assistant-websocket/nodes/current-state/current-state.js:61:51)
at CurrentStateNode.preOnInput (/opt/node_modules/node-red-contrib-home-assistant-websocket/lib/base-node.js:440:18)
at CurrentStateNode.emit (events.js:182:13)
at CurrentStateNode.Node.receive (/opt/node_modules/@node-red/runtime/lib/nodes/Node.js:237:14)
at SwitchNode.Node.send (/opt/node_modules/@node-red/runtime/lib/nodes/Node.js:224:14)
at applyRules (/opt/node_modules/@node-red/nodes/core/logic/10-switch.js:441:42)
at applyRule (/opt/node_modules/@node-red/nodes/core/logic/10-switch.js:224:17)
at getV2 (/opt/node_modules/@node-red/nodes/core/logic/10-switch.js:199:17)
at getV2 (/opt/node_modules/@node-red/nodes/core/logic/10-switch.js:168:13)
at getV1 (/opt/node_modules/@node-red/nodes/core/logic/10-switch.js:181:13)

New things tried

  1. Wipe and restore to snapshot from 3 weeks ago. Re-import my current flow. Everything working.
  2. Update all addons except Node Red 2.0.2. Everything still working in Node Red.
  3. Update Node Red to latest version 3.0.2. Entities not turning on/off.

Debug window in Node Red 3.0.2

Node Red Log (note I renamed east_side_lights to east_lights about 2 weeks ago, the entity id on the call service is showing at the newer east_lights but the debug is showing the old entity id
[25/Apr/2019:10:21:59 +0800] 200 192.168.8.225, 172.30.32.1(172.30.32.2) POST /inject/134514ab.fb017b HTTP/1.1 (Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/73.0.3683.103 Safari/537.36)
25 Apr 10:22:18 - [info] Stopping flows
25 Apr 10:22:18 - [info] [server:Home Assistant] Closing WebSocket http://hassio/homeassistant
25 Apr 10:22:18 - [info] Stopped flows
25 Apr 10:22:18 - [info] Starting flows
25 Apr 10:22:19 - [info] Started flows
[25/Apr/2019:10:22:19 +0800] 200 192.168.8.225, 172.30.32.1(172.30.32.2) POST /flows HTTP/1.1 (Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/73.0.3683.103 Safari/537.36)
25 Apr 10:22:20 - [warn] [api-current-state:Already off?] entity could not be found in cache for entity_id: light.deck_table, sending empty payload
25 Apr 10:22:20 - [warn] [api-current-state:Already off?] entity could not be found in cache for entity_id: light.east_side_lights, sending empty payload
25 Apr 10:22:21 - [warn] [api-current-state:Already off?] entity could not be found in cache for entity_id: switch.plug_158d0002496bb9, sending empty payload
25 Apr 10:22:21 - [warn] [api-current-state:Already off?] entity could not be found in cache for entity_id: light.south_lights, sending empty payload
25 Apr 10:22:21 - [warn] [api-call-service:Garage Lights OFF] Call-Service attempted without connection to server.
[25/Apr/2019:10:22:21 +0800] 200 192.168.8.225, 172.30.32.1(172.30.32.2) POST /inject/134514ab.fb017b HTTP/1.1 (Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/73.0.3683.103 Safari/537.36)
25 Apr 10:22:24 - [info] [server:Home Assistant] WebSocket Connected to http://hassio/homeassistant
[25/Apr/2019:10:22:42 +0800] 200 192.168.8.225, 172.30.32.1(172.30.32.2) GET /red/images/typedInput/json.png HTTP/1.1 (Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/73.0.3683.103 Safari/537.36)
[25/Apr/2019:10:22:42 +0800] 200 192.168.8.225, 172.30.32.1(172.30.32.2) GET /homeassistant/31325ed1.2c0d02/entities HTTP/1.1 (Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/73.0.3683.103 Safari/537.36)
[25/Apr/2019:10:22:42 +0800] 200 192.168.8.225, 172.30.32.1(172.30.32.2) GET /homeassistant/31325ed1.2c0d02/services HTTP/1.1 (Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/73.0.3683.103 Safari/537.36)
[25/Apr/2019:10:22:44 +0800] 200 192.168.8.225, 172.30.32.1(172.30.32.2) GET /credentials/server/31325ed1.2c0d02 HTTP/1.1 (Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/73.0.3683.103 Safari/537.36)
[25/Apr/2019:10:23:37 +0800] 101 192.168.8.225, 172.30.32.1(172.30.32.2) GET /comms HTTP/1.1 (Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/73.0.3683.103 Safari/537.36)

I am still getting messages in the debug about entities not being found in the cache but everything seems to be back on track now.

Here was my steps to fixing.

  1. I initially backed up flow, uninstalled Node Red and deleted config/node-red folder, reinstalled 3.0.2 imported flows. This did not work.
  2. Open config raw in the Overview(lovelace), config UI, raw config editor and copy and pasted code into notepad as backup.
  3. Did a wipe and restore from the hass.io > snapshots from a snapshot 3 weeks ago which wipe out all traces of the current system bringing me back to a time when things worked pre Node Red 3+
  4. Re-imported the previous exported flow and deleted the old 3 week flow.
  5. Downloaded the most recent snapshot unzipped it and opened up config.yaml copy and pasted in the current (3 week old config yaml file that I restored to restore any changes I made in between those 3 weeks).
  6. Updated all my system to latest except Node Red.
  7. Made new snapshot (prior to updating to node red 3.0.2 so I can take one step back if it failed and try other things.
  8. Updated Node Red to 3.0.2 and then rebooted system and waited. Everything seems back on track.

Hope this helps someone/s.