Node-red crashing sendEvent.destination.node.receive is not a function

Nodred v.3.0.2 (Home assistant version) crashing, not very often, but about once in a couple of days

19 Aug 09:18:58 - [red] Uncaught Exception:
19 Aug 09:18:58 - [error] TypeError: sendEvent.destination.node.receive is not a function
    at Immediate.<anonymous> (/opt/node_modules/@node-red/runtime/lib/flows/Flow.js:831:52)
    at processImmediate (node:internal/timers:466:21)
    at process.topLevelDomainCallback (node:domain:152:15)
    at process.callbackTrampoline (node:internal/async_hooks:128:24)

no idea where to start looking. will try increasing log level back to debug and seeing if I can identify the flow with the issue.

i would say:

Home assistant

The home assistant node(s) that is.

@bakman2 any specific node type, i have lots of flows

I'm having the exact same issue with a new install of Node-red (v3.0.2) on a separate Raspberry Pi (Bullseye arm64) from Home Assistant (2022.8.6). I imported my flows from the HA Node-red addon but it seems to have happened after I added Subflows.
Node-red throws the exception and then restarts multiple times before becoming stable again or I just reboot the system.

My issue seems to have been duplicate Port labels Output names contained in separate subflows. I turned on trace logging and ran node-red-log but it didn't get me close. I went in and visually inspected each subflow, I noticed I had 2 Port labels named the same. Deleted the Port labels and Node-red has been stable.

Just to be clear are port labels what you name output connectors? And do they have to be unique across all the subflows or just in that flow?

I did confirm that I dont have any duplicate output labels.. not sure that is what is causing my issue.

Issues raised here: Node Red crashing with sendEvent.destination.node.receive · Issue #3848 · node-red/node-red · GitHub and here: supervisor doesn't restart node-red · Issue #3812 · home-assistant/supervisor · GitHub

Please try to stick to one place otherwise it gets confusing.

@Steve-Mcl understood, but there were multiple issues causing this and it is packaged up and used differently that stock node-red.

  • crash for an unknown reason
  • home assistant supervisor watchdog doesn't restart it. I suspect its been crashing and since the watchdog stopped working it more more apparent
  • it was packed up as home assistant addon, so I wasn't sure it was addon issue not reporting the crash up to the supervisor.

The watchdog bug has been fixed, which should restart a crashed node-red.

@Steve-Mcl I was getting the exact issue of Node-red crashing with sendEvent.destination.node.receive in my Node-red logs as @vajonam. My issue seems to be remediated and the last thing I did was reviewed each of my subflows and removed any custom Port labels.

Thanks for the info. IMO, this seems coincidental to me. I cannot immediately see how removing the port labels would fix this but then, you never know. So I will keep it in mind while other clues are gathered. Thanks either way.

I agree. I could not find any clues that led to the exact issue, even with trace logging turned on.
Because it happened after I converted some of my common node sets into subflows, I started there.

1 Like

Do you have the node-red-contib-kodi node? Not sure but looks like that crashed it node-red too! opened an issue with that project but looks like that hasn't been maintained in a few years.

not sure if related... if unrelated i will delete the post.

23 Aug 10:07:34 - [error] TypeError: Cannot read properties of null (reading 'schema')
    at bindNotificationListeners (/config/node-red/node_modules/node-red-contrib-kodi/kodi.js:233:36)
    at /config/node-red/node_modules/node-red-contrib-kodi/kodi.js:253:13
    at constructor.<anonymous> (/config/node-red/node_modules/node-red-contrib-kodi/kodi.js:53:21)
    at constructor.<anonymous> (/config/node-red/node_modules/machina/lib/machina.js:235:15)
    at /config/node-red/node_modules/machina/node_modules/lodash/index.js:2874:23
    at /config/node-red/node_modules/machina/node_modules/lodash/index.js:3049:15
    at Function.<anonymous> (/config/node-red/node_modules/machina/node_modules/lodash/index.js:3346:13)
    at constructor.emit (/config/node-red/node_modules/machina/lib/machina.js:233:6)
    at constructor._onEnter (/config/node-red/node_modules/node-red-contrib-kodi/lib/connectionFSM.js:91:34)
    at constructor.transition (/config/node-red/node_modules/machina/lib/machina.js:433:27)
    at constructor.Fsm.<computed> [as transition] (/config/node-red/node_modules/machina/lib/machina.js:580:60)
    at /config/node-red/node_modules/node-red-contrib-kodi/lib/connectionFSM.js:111:34
    at runMicrotasks (<anonymous>)
    at processTicksAndRejections (node:internal/process/task_queues:96:5)

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.