# Node red crashes

**URL:** https://discourse.nodered.org/t/node-red-crashes/53265
**Category:** General
**Created:** [5 November 2021 15:20 UTC](https://discourse.nodered.org/t/node-red-crashes/53265 "2021-11-05T15:20:00Z")
**Posts on this page:** 15
**Page:** 1

<div class="post-metadata">

### Author: ![RogierQ](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/rogierq/32/3211_2.png) [@RogierQ](https://discourse.nodered.org/u/RogierQ)
#### Post date: [5 November 2021 15:20 UTC](https://discourse.nodered.org/t/node-red-crashes/53265/1 "2021-11-05T15:20:00Z")

</div>

Hi!

every time node red crashes when doing nothing  
have no idea what or where  
i found this below in the log

```auto
Nov 5 15:11:49 bomb-game Node-RED[16879]: (node:16879) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or$
Nov 5 15:11:49 bomb-game Node-RED[16879]: (node:16879) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js $
Nov 5 15:11:49 bomb-game Node-RED[16879]: (node:16879) UnhandledPromiseRejectionWarning: Error: Huejay: timeout of 15000ms exceeded
Nov 5 15:11:49 bomb-game Node-RED[16879]: at /home/pi/.node-red/node_modules/huejay/lib/Transport.js:106:15
Nov 5 15:11:49 bomb-game Node-RED[16879]: at processTicksAndRejections (internal/process/task_queues.js:95:5)
Nov 5 15:11:49 bomb-game Node-RED[16879]: at runNextTicks (internal/process/task_queues.js:64:3)
Nov 5 15:11:49 bomb-game Node-RED[16879]: at listOnTimeout (internal/timers.js:526:9)
Nov 5 15:11:49 bomb-game Node-RED[16879]: at processTimers (internal/timers.js:500:7)
Nov 5 15:11:49 bomb-game Node-RED[16879]: (node:16879) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or$
Nov 5 15:11:49 bomb-game Node-RED[16879]: (node:16879) UnhandledPromiseRejectionWarning: Error: Huejay: timeout of 15000ms exceeded
Nov 5 15:11:49 bomb-game Node-RED[16879]: at /home/pi/.node-red/node_modules/huejay/lib/Transport.js:106:15
Nov 5 15:11:49 bomb-game Node-RED[16879]: at processTicksAndRejections (internal/process/task_queues.js:95:5)
Nov 5 15:11:49 bomb-game Node-RED[16879]: at runNextTicks (internal/process/task_queues.js:64:3)
Nov 5 15:11:49 bomb-game Node-RED[16879]: at listOnTimeout (internal/timers.js:526:9)
Nov 5 15:11:49 bomb-game Node-RED[16879]: at processTimers (internal/timers.js:500:7)
Nov 5 15:11:49 bomb-game Node-RED[16879]: (node:16879) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or$
Nov 5 15:14:36 bomb-game Node-RED[16879]: <--- Last few GCs --->
Nov 5 15:14:36 bomb-game Node-RED[16879]: [16879:0x3cb6bd8] 2690949 ms: Scavenge 2043.4 (2049.3) -> 2041.9 (2049.3) MB, 4.9 / 0.0 ms (average mu = 0.319, current mu = 0.294) task
Nov 5 15:14:36 bomb-game Node-RED[16879]: [16879:0x3cb6bd8] 2691031 ms: Scavenge 2043.5 (2049.3) -> 2042.0 (2049.3) MB, 4.8 / 0.0 ms (average mu = 0.319, current mu = 0.294) task
Nov 5 15:14:36 bomb-game Node-RED[16879]: [16879:0x3cb6bd8] 2691112 ms: Scavenge 2043.6 (2053.3) -> 2042.1 (2053.3) MB, 5.5 / 0.0 ms (average mu = 0.319, current mu = 0.294) task
Nov 5 15:14:36 bomb-game Node-RED[16879]: <--- JS stacktrace --->
Nov 5 15:14:36 bomb-game Node-RED[16879]: FATAL ERROR: Ineffective mark-compacts near heap limit Allocation failed - JavaScript heap out of memory
Nov 5 15:14:36 bomb-game systemd[1]: nodered.service: Main process exited, code=killed, status=6/ABRT
Nov 5 15:14:36 bomb-game systemd[1]: nodered.service: Failed with result 'signal'.
Nov 5 15:14:56 bomb-game systemd[1]: nodered.service: Service RestartSec=20s expired, scheduling restart.
Nov 5 15:14:56 bomb-game systemd[1]: nodered.service: Scheduled restart job, restart counter is at 6.
Nov 5 15:14:56 bomb-game systemd[1]: Stopped Node-RED graphical event wiring tool.
Nov 5 15:14:56 bomb-game systemd[1]: Started Node-RED graphical event wiring tool.
Nov 5 15:14:58 bomb-game Node-RED[20122]: 5 Nov 15:14:58 - [info]
Nov 5 15:14:58 bomb-game Node-RED[20122]: Welcome to Node-RED
Nov 5 15:14:58 bomb-game Node-RED[20122]: ===================
Nov 5 15:14:58 bomb-game Node-RED[20122]: 5 Nov 15:14:58 - [info] Node-RED version: v2.1.1
Nov 5 15:14:58 bomb-game Node-RED[20122]: 5 Nov 15:14:58 - [info] Node.js version: v14.18.1
Nov 5 15:14:58 bomb-game Node-RED[20122]: 5 Nov 15:14:58 - [info] Linux 5.10.17-v7l+ arm LE
Nov 5 15:14:58 bomb-game Node-RED[20122]: 5 Nov 15:14:58 - [info] Loading palette nodes
Nov 5 15:15:00 bomb-game Node-RED[20122]: 5 Nov 15:15:00 - [info] Dashboard version 3.0.4 started at /ui
Nov 5 15:15:00 bomb-game Node-RED[20122]: 5 Nov 15:15:00 - [info] Settings file : /home/pi/.node-red/settings.js
Nov 5 15:15:00 bomb-game Node-RED[20122]: 5 Nov 15:15:00 - [info] Context store : 'default' [module=memory]
Nov 5 15:15:00 bomb-game Node-RED[20122]: 5 Nov 15:15:00 - [info] User directory : /home/pi/.node-red
Nov 5 15:15:00 bomb-game Node-RED[20122]: 5 Nov 15:15:00 - [warn] Projects disabled : editorTheme.projects.enabled=false
Nov 5 15:15:00 bomb-game Node-RED[20122]: 5 Nov 15:15:00 - [info] Flows file : /home/pi/.node-red/flows.json
Nov 5 15:15:00 bomb-game Node-RED[20122]: 5 Nov 15:15:00 - [info] Server now running at http://127.0.0.1:1880/
Nov 5 15:15:00 bomb-game Node-RED[20122]: 5 Nov 15:15:00 - [warn]
Nov 5 15:15:00 bomb-game Node-RED[20122]: ---------------------------------------------------------------------

```

i guess it is about this line but no clue what it means

```auto
 FATAL ERROR: Ineffective mark-compacts near heap limit Allocation failed - JavaScript heap out of memory

```

i called mark but he also dont know 😉 😉

---

<div class="post-metadata">

### Author: ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)
#### Post date: [5 November 2021 16:01 UTC](https://discourse.nodered.org/t/node-red-crashes/53265/2 "2021-11-05T16:01:27Z")

</div>

The npm package huejay is crashing. Go into your .node-red folder and run  
`npm list huejay`  
which should tell you which node red node is using that, if you don't know already.

Make sure all your nodes are at the latest versions (you can check that in Manage Palette).

---

<div class="post-metadata">

### Author: ![RogierQ](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/rogierq/32/3211_2.png) [@RogierQ](https://discourse.nodered.org/u/RogierQ)
#### Post date: [5 November 2021 16:41 UTC](https://discourse.nodered.org/t/node-red-crashes/53265/3 "2021-11-05T16:41:47Z")

</div>

Thanks @Colin

npm list huejay gives me the result below, no idea what to do with that info  
all nodes are up to date

```auto
node-red-project@0.0.1 /home/pi/.node-red
└─┬ node-red-contrib-huemagic@3.0.0
  └── huejay@1.9.0 

```

---

<div class="post-metadata">

### Author: ![RogierQ](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/rogierq/32/3211_2.png) [@RogierQ](https://discourse.nodered.org/u/RogierQ)
#### Post date: [5 November 2021 18:41 UTC](https://discourse.nodered.org/t/node-red-crashes/53265/4 "2021-11-05T18:41:29Z")

</div>

It seems solved after deleting the hue switches. But not sure about that jet

---

<div class="post-metadata">

### Author: ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)
#### Post date: [5 November 2021 22:01 UTC](https://discourse.nodered.org/t/node-red-crashes/53265/5 "2021-11-05T22:01:44Z")

</div>

> [@RogierQ](#):
>
> `node-red-contrib-huemagic`

That means there is a bug in that node that crashes node-red. Unfortunately I think that node is no longer supported as there are many unaddressed issues on its github page, including other reports of crashing node-red.

---

<div class="post-metadata">

### Author: ![RogierQ](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/rogierq/32/3211_2.png) [@RogierQ](https://discourse.nodered.org/u/RogierQ)
#### Post date: [5 November 2021 22:10 UTC](https://discourse.nodered.org/t/node-red-crashes/53265/6 "2021-11-05T22:10:46Z")

</div>

o really? i loved huemagic, use it a lot....  
Thanks for explanation

---

<div class="post-metadata">

### Author: ![RogierQ](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/rogierq/32/3211_2.png) [@RogierQ](https://discourse.nodered.org/u/RogierQ)
#### Post date: [6 November 2021 11:43 UTC](https://discourse.nodered.org/t/node-red-crashes/53265/7 "2021-11-06T11:43:43Z")

</div>

UPDATE

Sorry @Colin Node Red still crashes also after deleting hue-magic

the error is below

```auto
Nov 6 11:17:01 bomb-game CRON[13528]: (root) CMD ( cd / && run-parts --report /etc/cron.hourly)
Nov 6 11:24:01 bomb-game rngd[361]: stats: bits received from HRNG source: 140064
Nov 6 11:24:01 bomb-game rngd[361]: stats: bits sent to kernel pool: 93824
Nov 6 11:24:01 bomb-game rngd[361]: stats: entropy added to kernel pool: 93824
Nov 6 11:24:01 bomb-game rngd[361]: stats: FIPS 140-2 successes: 7
Nov 6 11:24:01 bomb-game rngd[361]: stats: FIPS 140-2 failures: 0
Nov 6 11:24:01 bomb-game rngd[361]: stats: FIPS 140-2(2001-10-10) Monobit: 0
Nov 6 11:24:01 bomb-game rngd[361]: stats: FIPS 140-2(2001-10-10) Poker: 0
Nov 6 11:24:01 bomb-game rngd[361]: stats: FIPS 140-2(2001-10-10) Runs: 0
Nov 6 11:24:01 bomb-game rngd[361]: stats: FIPS 140-2(2001-10-10) Long run: 0
Nov 6 11:24:01 bomb-game rngd[361]: stats: FIPS 140-2(2001-10-10) Continuous run: 0
Nov 6 11:24:01 bomb-game rngd[361]: stats: HRNG source speed: (min=166.238; avg=331.951; max=510.688)Kibits/s
Nov 6 11:24:01 bomb-game rngd[361]: stats: FIPS tests speed: (min=8.930; avg=16.731; max=31.268)Mibits/s
Nov 6 11:24:01 bomb-game rngd[361]: stats: Lowest ready-buffers level: 2
Nov 6 11:24:01 bomb-game rngd[361]: stats: Entropy starvations: 0
Nov 6 11:24:01 bomb-game rngd[361]: stats: Time spent starving for entropy: (min=0; avg=0.000; max=0)us
Nov 6 11:28:56 bomb-game Node-RED[10846]: <--- Last few GCs --->
Nov 6 11:28:56 bomb-game Node-RED[10846]: [10846:0x3e44bd8] 2759787 ms: Scavenge 2044.4 (2049.9) -> 2042.9 (2049.9) MB, 4.8 / 0.0 ms (average mu = 0.307, current mu = 0.301) task
Nov 6 11:28:56 bomb-game Node-RED[10846]: [10846:0x3e44bd8] 2759879 ms: Scavenge 2044.5 (2049.9) -> 2043.0 (2049.9) MB, 4.8 / 0.0 ms (average mu = 0.307, current mu = 0.301) task
Nov 6 11:28:56 bomb-game Node-RED[10846]: [10846:0x3e44bd8] 2759970 ms: Scavenge 2044.6 (2053.9) -> 2043.1 (2053.9) MB, 5.4 / 0.0 ms (average mu = 0.307, current mu = 0.301) task
Nov 6 11:28:56 bomb-game Node-RED[10846]: <--- JS stacktrace --->
Nov 6 11:28:56 bomb-game Node-RED[10846]: FATAL ERROR: Ineffective mark-compacts near heap limit Allocation failed - JavaScript heap out of memory
Nov 6 11:28:57 bomb-game systemd[1]: nodered.service: Main process exited, code=killed, status=6/ABRT
Nov 6 11:28:57 bomb-game systemd[1]: nodered.service: Failed with result 'signal'.
Nov 6 11:29:17 bomb-game systemd[1]: nodered.service: Service RestartSec=20s expired, scheduling restart.
Nov 6 11:29:17 bomb-game systemd[1]: nodered.service: Scheduled restart job, restart counter is at 4.
Nov 6 11:29:17 bomb-game systemd[1]: Stopped Node-RED graphical event wiring tool.
Nov 6 11:29:17 bomb-game systemd[1]: Started Node-RED graphical event wiring tool.

```

---

<div class="post-metadata">

### Author: ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)
#### Post date: [6 November 2021 15:31 UTC](https://discourse.nodered.org/t/node-red-crashes/53265/8 "2021-11-06T15:31:49Z")

</div>

You have run out of memory, something you are doing is using memory and not releasing it. Are you doing something with images or video or large files or something similar?

---

<div class="post-metadata">

### Author: ![RogierQ](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/rogierq/32/3211_2.png) [@RogierQ](https://discourse.nodered.org/u/RogierQ)
#### Post date: [6 November 2021 17:22 UTC](https://discourse.nodered.org/t/node-red-crashes/53265/9 "2021-11-06T17:22:22Z")

</div>

No, it is very basic what it is at the moment.  
I also created a clean install and imported the node red json  
Again it crashes.  
There are a lot ping nodes in it, i disabled them and still same problem.

latest crash report below

```auto
6 Nov 17:17:41 - [info] [function:flows_*.json] Backup made
<--- Last few GCs --->
[5366:0x4074bd8] 2287594 ms: Scavenge (reduce) 2040.9 (2044.4) -> 2040.2 (2045.4) MB, 6.6 / 0.0 ms (average mu = 0.181, current mu = 0.145) task
[5366:0x4074bd8] 2287652 ms: Scavenge (reduce) 2041.0 (2044.4) -> 2040.2 (2045.4) MB, 6.6 / 0.0 ms (average mu = 0.181, current mu = 0.145) task
[5366:0x4074bd8] 2287711 ms: Scavenge (reduce) 2041.0 (2044.4) -> 2040.2 (2045.4) MB, 6.5 / 0.0 ms (average mu = 0.181, current mu = 0.145) task
<--- JS stacktrace --->
FATAL ERROR: Ineffective mark-compacts near heap limit Allocation failed - JavaScript heap out of memory
nodered.service: Main process exited, code=killed, status=6/ABRT
nodered.service: Failed with result 'signal'.
nodered.service: Service RestartSec=20s expired, scheduling restart.
nodered.service: Scheduled restart job, restart counter is at 2.
Stopped Node-RED graphical event wiring tool.
Started Node-RED graphical event wiring tool.
6 Nov 17:54:43 - [info]
Welcome to Node-RED
===================
6 Nov 17:54:43 - [info] Node-RED version: v2.1.3
6 Nov 17:54:43 - [info] Node.js version: v14.18.1
6 Nov 17:54:43 - [info] Linux 5.10.17-v7l+ arm LE

```

I can send you the json if you like to see what is giving the problem

---

<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: [6 November 2021 17:51 UTC](https://discourse.nodered.org/t/node-red-crashes/53265/10 "2021-11-06T17:51:00Z")

</div>

Show us a screenshot of your flows please

---

<div class="post-metadata">

### Author: ![RogierQ](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/rogierq/32/3211_2.png) [@RogierQ](https://discourse.nodered.org/u/RogierQ)
#### Post date: [6 November 2021 17:54 UTC](https://discourse.nodered.org/t/node-red-crashes/53265/11 "2021-11-06T17:54:41Z")

</div>

![Schermafbeelding 2021-11-06 om 18.53.20](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/a/8/a84d0de91f5ace3e897ebc8324f7a1c64e43d2ae.jpeg)  
 ![Schermafbeelding 2021-11-06 om 18.53.09](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/b/f/bf95024a35f229c076358be89e3c20af3fa1a1c1.png)  
 ![Schermafbeelding 2021-11-06 om 18.53.00](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/7/e/7ea7b535fcc002bda390730ed6f657681263b9f4.png)  
 ![Schermafbeelding 2021-11-06 om 18.52.50](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/2/a/2ad3fe465c3dd4c11f164deab3004f4036a5af4e.png)  
 ![Schermafbeelding 2021-11-06 om 18.52.43](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/0/0/00a0cef08a09e7ac9edc2e879029ccefa2d146b7.png)  
 ![Schermafbeelding 2021-11-06 om 18.52.30](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/b/6/b6edbc790f1a9b7b0486c444d295e79b10a7f15a.png)  
 ![Schermafbeelding 2021-11-06 om 18.51.47](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/f/3/f309eacc8192421393a2fca06ddb4055e469495e.png)

---

<div class="post-metadata">

### Author: ![zenofmud](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/zenofmud/32/316_2.png) [@zenofmud](https://discourse.nodered.org/u/zenofmud)
#### Post date: [7 November 2021 11:00 UTC](https://discourse.nodered.org/t/node-red-crashes/53265/12 "2021-11-07T11:00:29Z")

</div>

Wow that is a lot of MQTT nodes, each one making a connection to the broker. Is the broker running on the same Pi?

What model Pi is it and how much memory does it have?

1. For the **mqtt-in** `bomb/result/bombN`, the `JSON` nodes after it could be removed if in the `mqtt-in` node you set the `Output` option to `a parsed JSON object`.

2. if you change the **mqtt-in** to use the topic **bomb/result/#** you could have one mqtt-in node (for that batch of nodes)followed by a **switch** node to test the 'topic' and send the msg to the correct function node.

3. for the **mqtt-out** nodes, I would consolidate them too by having one **mqtt-out** node with no topic and have the incoming msg contain a msg.topic. To keep the flows neat, you could use a link node (or the new **link call** node) on the pages to the **mqtt-out** nodes

I think reducing the number of MQTT nodes will go quite aways to reducing your memory usage.

---

<div class="post-metadata">

### Author: ![RogierQ](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/rogierq/32/3211_2.png) [@RogierQ](https://discourse.nodered.org/u/RogierQ)
#### Post date: [7 November 2021 17:45 UTC](https://discourse.nodered.org/t/node-red-crashes/53265/13 "2021-11-07T17:45:29Z")

</div>

Thanks @zenofmud for taking time to scan my work.  
And thanks for you feedback, i learned some new nodes today 😉  
After some playing around the problem was solved before using your tips.  
No idea what it exactly was.

O and it is an pi4 with 4gb

---

<div class="post-metadata">

### Author: ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)
#### Post date: [7 November 2021 17:55 UTC](https://discourse.nodered.org/t/node-red-crashes/53265/14 "2021-11-07T17:55:39Z")

</div>

The important thing with MQTT nodes is to only have one config node for each server. So if you click on the Server drop-down it should only show one entry (or one for each broker if you connect to multiple brokers). Then you will only have one connection to the broker and it doesn't matter how many MQTT In/Out nodes you use.

---

<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: [6 January 2022 17:56 UTC](https://discourse.nodered.org/t/node-red-crashes/53265/15 "2022-01-06T17:56:04Z")

</div>

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