# Prevent Node-RED crash/restart-loop on network issues

**URL:** <https://discourse.nodered.org/t/prevent-node-red-crash-restart-loop-on-network-issues/100651>\
**Category:** Feature Requests\
**Tags:** docker\
**Created:** [25 March 2026 16:01 UTC](https://discourse.nodered.org/t/prevent-node-red-crash-restart-loop-on-network-issues/100651 "2026-03-25T16:01:09Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Semmu](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/semmu/32/31164_2.png) [@Semmu](https://discourse.nodered.org/u/Semmu)\
**Post date:** [25 March 2026 16:01 UTC](https://discourse.nodered.org/t/prevent-node-red-crash-restart-loop-on-network-issues/100651/1 "2026-03-25T16:01:09Z")

</div>

Hello lovely folks,

I would like to request a feature to make Node-RED a bit more robust and stable.

Currently when NR faces a network exception for whatever reason (e.g. temporary network outage, DNS lookup problems, etc.) the whole thing shuts down, because the exception bubbles up to the top, resulting in a boot-loop in my case (running NR via docker compose). The only way to fix it is to stop the container, edit the flows file by hand (disabling it altogether), restart NR, then re-enable almost everything.

In my case 2 contrib nodes cause the problem: [node-red-contrib-spotify (node) - Node-RED](https://flows.nodered.org/node/node-red-contrib-spotify) and [node-red-node-openweathermap (node) - Node-RED](https://flows.nodered.org/node/node-red-node-openweathermap). Both of them do some network requests (immediately on startup, or on a schedule), which can fail, resulting in said boot-loop. Example logs of boot-loop:

```auto
[...]
25 Mar 16:23:43 - [info] Starting flows
25 Mar 16:23:44 - [info] Started flows
25 Mar 16:23:44 - [info] [zigbee2mqtt-server:5a4167ca1a055afa] MQTT Connected
25 Mar 16:23:44 - [info] [mqtt-broker:mosquitto] Connected to broker: nodered@mqtt://mosquitto:1883
25 Mar 16:23:44 - [info] [zigbee2mqtt-server:5a4167ca1a055afa] MQTT Subscribed to: "zigbee2mqtt/#"
[...]
[red] Uncaught Exception:
25 Mar 16:23:59 - [error] Error: getaddrinfo EAI_AGAIN accounts.spotify.com
    at GetAddrInfoReqWrap.onlookupall [as oncomplete] (node:dns:122:26)
25 Mar 16:24:05 - [info]

Welcome to Node-RED
===================

25 Mar 16:24:05 - [info] Node-RED version: v4.1.1
25 Mar 16:24:05 - [info] Node.js version: v22.20.0
[...]

```

Unfortunately this happens very frequently, since my ISP tends to have outages during storms or when [it heckin wimdy](https://knowyourmeme.com/photos/2313453-it-fucken-wimdy), so I would really appreciate if NR would catch these exceptions and deal with them somehow (periodically re-init these contrib nodes/plugins or something similar, but most importantly prevent a full crash).

The alternative solution would be to catch these exceptions on the contrib node level, but I don't think it's feasible to update all contrib packages, so it would be much more robust to handle them on the NR side.

I searched on the forum for possible solutions, didn't find anything applicable, but I see this problem affects others as well.

- [Node-red crash when network is down? - General - Node-RED Forum](https://discourse.nodered.org/t/node-red-crash-when-network-is-down/11034)
- [Restart loop after a mistyped IP address - General - Node-RED Forum](https://discourse.nodered.org/t/restart-loop-after-a-mistyped-ip-address/86702)
- [Help needed, Node-red crashed! - General - Node-RED Forum](https://discourse.nodered.org/t/help-needed-node-red-crashed/64462/8)
- And this 4 years old contrib node bugreport, with no activity in sight: [Wrong ip value causes node red to crash · Issue #8 · inwaar/node-red-contrib-gree-hvac](https://github.com/inwaar/node-red-contrib-gree-hvac/issues/8)

What do you think? I would really appreciate if we had a way to catch and handle these network exceptions and prevent NR from crashing completely.

Thanks in advance!

---

<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:** [25 March 2026 16:46 UTC](https://discourse.nodered.org/t/prevent-node-red-crash-restart-loop-on-network-issues/100651/2 "2026-03-25T16:46:28Z")

</div>

> [@Semmu](#):
>
> he alternative solution would be to catch these exceptions on the contrib node level

That is absolutely the way it must be done. Only the node can know what it should do when it has an issue like that. No node should ever leave a uncaught error of that ilk.  
Submit bug reports on those nodes to get them fixed.

---

<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:** [25 March 2026 17:12 UTC](https://discourse.nodered.org/t/prevent-node-red-crash-restart-loop-on-network-issues/100651/3 "2026-03-25T17:12:48Z")

</div>

Are you sure the weathermap node is crashing node red? That surprises me. Can you post an example of that. Show the full stack trace from the log please.

Why do you need to edit the flow to get it going again? Exactly what do you do to make it stop crashing?  
If you do need to edit the flow then you can start node-red in safe mode so that it doesn't start the flows. I don't use docker, but I am sure a search for how to start node-red in safe mode in docker will tell you.

---

<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:** [24 May 2026 17:13 UTC](https://discourse.nodered.org/t/prevent-node-red-crash-restart-loop-on-network-issues/100651/4 "2026-05-24T17:13:10Z")

</div>

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