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

**URL:** <https://discourse.nodered.org/t/node-red-crashing-sendevent-destination-node-receive-is-not-a-function/66674>\
**Category:** General\
**Created:** [19 August 2022 14:07 UTC](https://discourse.nodered.org/t/node-red-crashing-sendevent-destination-node-receive-is-not-a-function/66674 "2022-08-19T14:07:27Z")\
**Posts on this page:** 14\
**Page:** 1

<div class="post-metadata">

**Author:** ![vajonam](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/vajonam/32/36588_2.png) [@vajonam](https://discourse.nodered.org/u/vajonam)\
**Post date:** [19 August 2022 14:07 UTC](https://discourse.nodered.org/t/node-red-crashing-sendevent-destination-node-receive-is-not-a-function/66674/1 "2022-08-19T14:07:27Z")

</div>

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

```auto
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.

---

<div class="post-metadata">

**Author:** ![bakman2](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/bakman2/32/6207_2.png) [@bakman2](https://discourse.nodered.org/u/bakman2)\
**Post date:** [19 August 2022 15:44 UTC](https://discourse.nodered.org/t/node-red-crashing-sendevent-destination-node-receive-is-not-a-function/66674/2 "2022-08-19T15:44:13Z")

</div>

> [@vajonam](#):
>
> no idea where to start looking

i would say:

> Home assistant

The home assistant node(s) that is.

---

<div class="post-metadata">

**Author:** ![vajonam](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/vajonam/32/36588_2.png) [@vajonam](https://discourse.nodered.org/u/vajonam)\
**Post date:** [21 August 2022 15:33 UTC](https://discourse.nodered.org/t/node-red-crashing-sendevent-destination-node-receive-is-not-a-function/66674/3 "2022-08-21T15:33:32Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Rodney-Smith](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/rodney-smith/32/66680_2.png) [@Rodney-Smith](https://discourse.nodered.org/u/Rodney-Smith)\
**Post date:** [22 August 2022 22:41 UTC](https://discourse.nodered.org/t/node-red-crashing-sendevent-destination-node-receive-is-not-a-function/66674/4 "2022-08-22T22:41:34Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Rodney-Smith](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/rodney-smith/32/66680_2.png) [@Rodney-Smith](https://discourse.nodered.org/u/Rodney-Smith)\
**Post date:** [23 August 2022 00:12 UTC](https://discourse.nodered.org/t/node-red-crashing-sendevent-destination-node-receive-is-not-a-function/66674/5 "2022-08-23T00:12:04Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![vajonam](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/vajonam/32/36588_2.png) [@vajonam](https://discourse.nodered.org/u/vajonam)\
**Post date:** [23 August 2022 11:39 UTC](https://discourse.nodered.org/t/node-red-crashing-sendevent-destination-node-receive-is-not-a-function/66674/6 "2022-08-23T11:39:48Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![vajonam](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/vajonam/32/36588_2.png) [@vajonam](https://discourse.nodered.org/u/vajonam)\
**Post date:** [23 August 2022 12:16 UTC](https://discourse.nodered.org/t/node-red-crashing-sendevent-destination-node-receive-is-not-a-function/66674/7 "2022-08-23T12:16:36Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Steve-Mcl](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/steve-mcl/32/4826_2.png) [@Steve-Mcl](https://discourse.nodered.org/u/Steve-Mcl)\
**Post date:** [23 August 2022 13:47 UTC](https://discourse.nodered.org/t/node-red-crashing-sendevent-destination-node-receive-is-not-a-function/66674/8 "2022-08-23T13:47:09Z")

</div>

Issues raised here: [Node Red crashing with sendEvent.destination.node.receive · Issue #3848 · node-red/node-red · GitHub](https://github.com/node-red/node-red/issues/3848) and here: [supervisor doesn't restart node-red · Issue #3812 · home-assistant/supervisor · GitHub](https://github.com/home-assistant/supervisor/issues/3812)

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

---

<div class="post-metadata">

**Author:** ![vajonam](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/vajonam/32/36588_2.png) [@vajonam](https://discourse.nodered.org/u/vajonam)\
**Post date:** [23 August 2022 13:52 UTC](https://discourse.nodered.org/t/node-red-crashing-sendevent-destination-node-receive-is-not-a-function/66674/9 "2022-08-23T13:52:19Z")

</div>

@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.

---

<div class="post-metadata">

**Author:** ![Rodney-Smith](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/rodney-smith/32/66680_2.png) [@Rodney-Smith](https://discourse.nodered.org/u/Rodney-Smith)\
**Post date:** [23 August 2022 15:03 UTC](https://discourse.nodered.org/t/node-red-crashing-sendevent-destination-node-receive-is-not-a-function/66674/10 "2022-08-23T15:03:36Z")

</div>

@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.

---

<div class="post-metadata">

**Author:** ![Steve-Mcl](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/steve-mcl/32/4826_2.png) [@Steve-Mcl](https://discourse.nodered.org/u/Steve-Mcl)\
**Post date:** [23 August 2022 15:07 UTC](https://discourse.nodered.org/t/node-red-crashing-sendevent-destination-node-receive-is-not-a-function/66674/11 "2022-08-23T15:07:53Z")

</div>

> [@Rodney-Smith](#):
>
> 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.

---

<div class="post-metadata">

**Author:** ![Rodney-Smith](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/rodney-smith/32/66680_2.png) [@Rodney-Smith](https://discourse.nodered.org/u/Rodney-Smith)\
**Post date:** [23 August 2022 15:13 UTC](https://discourse.nodered.org/t/node-red-crashing-sendevent-destination-node-receive-is-not-a-function/66674/12 "2022-08-23T15:13:28Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![vajonam](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/vajonam/32/36588_2.png) [@vajonam](https://discourse.nodered.org/u/vajonam)\
**Post date:** [23 August 2022 16:23 UTC](https://discourse.nodered.org/t/node-red-crashing-sendevent-destination-node-receive-is-not-a-function/66674/13 "2022-08-23T16:23:26Z")

</div>

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.

```auto
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)

```

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)\
**Post date:** [22 October 2022 16:24 UTC](https://discourse.nodered.org/t/node-red-crashing-sendevent-destination-node-receive-is-not-a-function/66674/14 "2022-10-22T16:24:13Z")

</div>

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