# Node Red crashes every 30 minutes

**URL:** <https://discourse.nodered.org/t/node-red-crashes-every-30-minutes/73275>\
**Category:** General\
**Created:** [6 January 2023 07:21 UTC](https://discourse.nodered.org/t/node-red-crashes-every-30-minutes/73275 "2023-01-06T07:21:22Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![Hotte93](https://avatars.discourse-cdn.com/v4/letter/h/b2d939/32.png) [@Hotte93](https://discourse.nodered.org/u/Hotte93)\
**Post date:** [6 January 2023 07:21 UTC](https://discourse.nodered.org/t/node-red-crashes-every-30-minutes/73275/1 "2023-01-06T07:21:22Z")

</div>

Hello everyone,  
I have a problem with my Node Red software. Namely, the system resets itself every 30 minutes.  
To check what the problem is, I looked at the logs. But these do not give any information about the error.

 ![unbekannt neu](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/6/b/6b32d0b5f03413aa1cd68cb541adcdd14d70b93e.jpeg)

I then opened the task manager and waited for the reset. This shows an extreme load of red.js at this moment. I suspect that at that moment there is not enough memory available for the program and therefore it kills itself.

 ![Unbenannt1](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/8/9/89037ee613c14eb859512b56c13497a6dd8f6d6d.jpeg)

So far, unfortunately, I can not explain where the error lies. Also related errors in the forum could not help me because I do not see an explicit node which triggers the error.

Therefore to you the question. Can you explain what it is that he always has this memory requirement after 30 minutes? Are there any automatic saving processes running in the background?

When I run node red in safe mode no crashes are generated.

I use mostly MQTT, multiple function nodes and 3 InfluxDB nodes to store the data. Furthermore still tasmota and several ui nodes.

My current node.js verison is v16.16.0

Thanks in advance for your help!

---

<div class="post-metadata">

**Author:** ![Trying\_to\_learn](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/trying_to_learn/32/28400_2.png) [@Trying\_to\_learn](https://discourse.nodered.org/u/Trying_to_learn)\
**Post date:** [6 January 2023 07:23 UTC](https://discourse.nodered.org/t/node-red-crashes-every-30-minutes/73275/2 "2023-01-06T07:23:56Z")

</div>

It may help a lot of people if you actually post the log and not a screenshot of it.

copy the text to the clipboard then paste it here.

BEFORE `pasting` it:  
Press the `</>` button. You will see this on the screen.

```auto
type or paste code here

```

And paste the text where the `type or paste code here` is.

Also after trying to read the log:  
You seem to have a 30 minute restart job running somewhere.  
You may need to elaborate on what is happening on the machine.

---

<div class="post-metadata">

**Author:** ![Hotte93](https://avatars.discourse-cdn.com/v4/letter/h/b2d939/32.png) [@Hotte93](https://discourse.nodered.org/u/Hotte93)\
**Post date:** [6 January 2023 07:36 UTC](https://discourse.nodered.org/t/node-red-crashes-every-30-minutes/73275/3 "2023-01-06T07:36:21Z")

</div>

Thanks for your answer!

I will replace the screenshots tonight. I am currently not near the system.

Yes, that is exactly what I suspect. However, I haven't made any changes to Node Red in weeks. Also no other features or updates for the Raspberry PI have been installed.

---

<div class="post-metadata">

**Author:** ![Trying\_to\_learn](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/trying_to_learn/32/28400_2.png) [@Trying\_to\_learn](https://discourse.nodered.org/u/Trying_to_learn)\
**Post date:** [6 January 2023 07:37 UTC](https://discourse.nodered.org/t/node-red-crashes-every-30-minutes/73275/4 "2023-01-06T07:37:12Z")

</div>

No problems.

It is I did notice something about _scheduled restart_ in/on the screen shot.

(oh, something else)

Ok, it is a RasPi.  
What is it (the node-red side of things) doing? In the bigger picture.  
How many tabs do you have in the whole scheme of things?  
And sorry but have you scanned all of them and made sure there aren't any sneaky nodes hiding and causing this to happen?

---

<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:** [6 January 2023 09:01 UTC](https://discourse.nodered.org/t/node-red-crashes-every-30-minutes/73275/5 "2023-01-06T09:01:12Z")

</div>

> multiple function nodes and 3 InfluxDB nodes to store the data

and what are those function nodes doing ? and how often ? Do you have loops in your flows ?

---

<div class="post-metadata">

**Author:** ![TotallyInformation](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/totallyinformation/32/31_2.png) [@TotallyInformation](https://discourse.nodered.org/u/TotallyInformation)\
**Post date:** [6 January 2023 11:19 UTC](https://discourse.nodered.org/t/node-red-crashes-every-30-minutes/73275/6 "2023-01-06T11:19:20Z")

</div>

To me, that says that something external sent a kill signal to the node-red process.

> [@Hotte93](#):
>
> This shows an extreme load of red.js at this moment. I suspect that at that moment there is not enough memory available for the program and therefore it kills itself.

Seems to have plenty of memory but the CPU load is very high and you have multiple threads running which also implies a heavy load within your flows or maybe a node that is calling out of node-red and getting too many rapid calls (e.g. many messages kicking off an exec node).

> [@Hotte93](#):
>
> Therefore to you the question. Can you explain what it is that he always has this memory requirement after 30 minutes? Are there any automatic saving processes running in the background?

Node-RED is a node.js app - Node.js uses a "Garbage Collection" periodic process to recover unused application memory. You are starting node-red with `--max-old-space` which, given you are using a 4GB RAM Pi, is not necessary, it is far better to take that off and let Node.js manage its own memory.

---

<div class="post-metadata">

**Author:** ![Hotte93](https://avatars.discourse-cdn.com/v4/letter/h/b2d939/32.png) [@Hotte93](https://discourse.nodered.org/u/Hotte93)\
**Post date:** [6 January 2023 11:22 UTC](https://discourse.nodered.org/t/node-red-crashes-every-30-minutes/73275/7 "2023-01-06T11:22:12Z")

</div>

Thanks for your answer 🙂 There are about 15 MQTT nodes. Data is retrieved from sensors (3) every 5 minutes and written to an InfluxDB.  
Functions are used to change data types or to pass data only for desired input variables. They do not execute any code longer than 5 lines (number about 20).  
There are 2 loops that are triggered every 5 hours and run for a maximum of 5-20 minutes.  
Other than that I use 2 bigtimer nodes and 2 tasmota for 2 sockets.

But I will give you a more detailed list tonight

What amazes me is that the system ran stable for weeks after the last change. There must be a memory full somewhere here or?

---

<div class="post-metadata">

**Author:** ![Hotte93](https://avatars.discourse-cdn.com/v4/letter/h/b2d939/32.png) [@Hotte93](https://discourse.nodered.org/u/Hotte93)\
**Post date:** [6 January 2023 11:33 UTC](https://discourse.nodered.org/t/node-red-crashes-every-30-minutes/73275/8 "2023-01-06T11:33:42Z")

</div>

Thanks for your answer!  
So should I disable node by node and see how it affects the CPU load?  
If Node.js but after a certain time recovered I do not understand why this error occurs only now. Then it should have happened right after the last change.

Okay then can I just comment out the --max-old-space in the node config file?

---

<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 January 2023 11:35 UTC](https://discourse.nodered.org/t/node-red-crashes-every-30-minutes/73275/9 "2023-01-06T11:35:42Z")

</div>

> [@Hotte93](#):
>
> There are 2 loops that are triggered every 5 hours and run for a maximum of 5-20 minutes

Loops are normally the reason for CPU issues.

Can you show up what you are doing?

---

<div class="post-metadata">

**Author:** ![TotallyInformation](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/totallyinformation/32/31_2.png) [@TotallyInformation](https://discourse.nodered.org/u/TotallyInformation)\
**Post date:** [6 January 2023 11:53 UTC](https://discourse.nodered.org/t/node-red-crashes-every-30-minutes/73275/10 "2023-01-06T11:53:41Z")

</div>

> [@Hotte93](#):
>
> Okay then can I just comment out the --max-old-space in the node config file?

Yes, get rid of it.

> [@Hotte93](#):
>
> If Node.js but after a certain time recovered I do not understand why this error occurs only now. Then it should have happened right after the last change.

You might simply be reaching a threshold where you are triggering things faster.

> [@Hotte93](#):
>
> So should I disable node by node and see how it affects the CPU load?

You'll need to be a bit more thoughtful than that. I'd firstly stop inputs to flows one-by-one. Then if a flow is identified as a problem, try enabling it but limiting the throughput.

---

<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 January 2023 13:31 UTC](https://discourse.nodered.org/t/node-red-crashes-every-30-minutes/73275/11 "2023-01-06T13:31:59Z")

</div>

> [@Hotte93](#):
>
> There are 2 loops that are triggered every 5 hours and run for a maximum of 5-20 minutes.

My guess would be that those are hogging the processor for some reason. It could be something else in node red doing that though.

---

<div class="post-metadata">

**Author:** ![Hotte93](https://avatars.discourse-cdn.com/v4/letter/h/b2d939/32.png) [@Hotte93](https://discourse.nodered.org/u/Hotte93)\
**Post date:** [8 January 2023 11:10 UTC](https://discourse.nodered.org/t/node-red-crashes-every-30-minutes/73275/12 "2023-01-08T11:10:19Z")

</div>

Hello together,  
sorry for my late response.

Briefly for information. The system has been stable again for 2 days now. I had unused Blynk nodes in the system that I deleted and I updated the InfluxDB version. Then I restarted the system and it was stable. However, the Tasmota nodes have been offline since then, which I can't explain.

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/5/4/54b8ae0d59d5c314d56621938a674c3b4b17027b.png)

Here is an overview of the nodes I use:

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/0/a/0a08503c1612f49065c2bce996057d0628e11db8.png)

In addition, I seem to have 49 function nodes in the system. These are only used to eliminate time colons or as an if condition for switching.

Here are 2 more systems that are called cyclically. However, nothing else runs as long as the logical AND node does not switch through.

The first system switches on a socket every 10 hours and measures the current with a time delay; if this falls below a certain value, the socket is switched off (charging monitoring of a laptop).

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/c/7/c7ce4acedcd3ffc603c7b7e56a853755d9707490.png)

The second system ensures that an LED matrix with the current time is switched on when switching via the UI. The current time is then sent to the matrix every 6 seconds. However, the LED matrix was not switched on at the time of the crash.

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/8/1/81995df607389f8bcb8ce9af59d6a9378d456ce9.png)

---

<div class="post-metadata">

**Author:** ![TotallyInformation](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/totallyinformation/32/31_2.png) [@TotallyInformation](https://discourse.nodered.org/u/TotallyInformation)\
**Post date:** [8 January 2023 11:34 UTC](https://discourse.nodered.org/t/node-red-crashes-every-30-minutes/73275/13 "2023-01-08T11:34:25Z")

</div>

What are these nodes? Are the Home Assistant?  
 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/6/4/64384fab8a68d58bdf4de628ca8faeaabb2adb2d.png)

---

<div class="post-metadata">

**Author:** ![Hotte93](https://avatars.discourse-cdn.com/v4/letter/h/b2d939/32.png) [@Hotte93](https://discourse.nodered.org/u/Hotte93)\
**Post date:** [8 January 2023 11:56 UTC](https://discourse.nodered.org/t/node-red-crashes-every-30-minutes/73275/14 "2023-01-08T11:56:51Z")

</div>

Thats a Tasmota sensor Node

---

<div class="post-metadata">

**Author:** ![TotallyInformation](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/totallyinformation/32/31_2.png) [@TotallyInformation](https://discourse.nodered.org/u/TotallyInformation)\
**Post date:** [8 January 2023 13:09 UTC](https://discourse.nodered.org/t/node-red-crashes-every-30-minutes/73275/15 "2023-01-08T13:09:05Z")

</div>

Why do you need a special node when Tasmota outputs to MQTT? Try removing those nodes and use MQTT instead.

---

<div class="post-metadata">

**Author:** ![Hotte93](https://avatars.discourse-cdn.com/v4/letter/h/b2d939/32.png) [@Hotte93](https://discourse.nodered.org/u/Hotte93)\
**Post date:** [9 January 2023 07:27 UTC](https://discourse.nodered.org/t/node-red-crashes-every-30-minutes/73275/16 "2023-01-09T07:27:00Z")

</div>

Good Morning,

I have now replaced the special Tasmota node with an MQTT node. But what are you hoping for? Do you think the problem is with the Tasmota node?

---

<div class="post-metadata">

**Author:** ![TotallyInformation](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/totallyinformation/32/31_2.png) [@TotallyInformation](https://discourse.nodered.org/u/TotallyInformation)\
**Post date:** [9 January 2023 09:38 UTC](https://discourse.nodered.org/t/node-red-crashes-every-30-minutes/73275/17 "2023-01-09T09:38:16Z")

</div>

> Once you eliminate the impossible, whatever remains, no matter how improbable, must be the truth.  
> [Arthur Conan Doyle](https://www.brainyquote.com/quotes/arthur_conan_doyle_134512)

It is more about eliminating things that are over complex. I don't _know_ that the tasmota node is a problem but it is a complexity you don't need so worth eliminating up front. A quick win is all.

---

<div class="post-metadata">

**Author:** ![Hotte93](https://avatars.discourse-cdn.com/v4/letter/h/b2d939/32.png) [@Hotte93](https://discourse.nodered.org/u/Hotte93)\
**Post date:** [9 January 2023 19:56 UTC](https://discourse.nodered.org/t/node-red-crashes-every-30-minutes/73275/18 "2023-01-09T19:56:01Z")

</div>

Yes that sounds logical in any case

---

<div class="post-metadata">

**Author:** ![Trying\_to\_learn](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/trying_to_learn/32/28400_2.png) [@Trying\_to\_learn](https://discourse.nodered.org/u/Trying_to_learn)\
**Post date:** [10 January 2023 05:03 UTC](https://discourse.nodered.org/t/node-red-crashes-every-30-minutes/73275/19 "2023-01-10T05:03:28Z")

</div>

Just chipping in.

And I don't have any grudges with the person who made the `tasmota` node.

But I've not have much luck with it when I used it way back when.

Using `MQTT` nodes may be a good find to help find out where the problem is.

---

<div class="post-metadata">

**Author:** ![mudwalker](https://avatars.discourse-cdn.com/v4/letter/m/47e85d/32.png) [@mudwalker](https://discourse.nodered.org/u/mudwalker)\
**Post date:** [10 January 2023 10:58 UTC](https://discourse.nodered.org/t/node-red-crashes-every-30-minutes/73275/20 "2023-01-10T10:58:03Z")

</div>

Just another bit of information, I use the NR MQTT nodes with Tasmota devices and have never seen a problem.

I always feel that adding nodes to talk a specific protocol when NR is quite capable of doing the same job in a 'standard' mode adds a layer that is not required and adds another point of possible failure. But then, that is me!

[Next page](https://discourse.nodered.org/t/node-red-crashes-every-30-minutes/73275.md?page=2)
