# Node Red crashes and exits with 1

**URL:** <https://discourse.nodered.org/t/node-red-crashes-and-exits-with-1/70176>\
**Category:** General\
**Created:** [6 November 2022 16:33 UTC](https://discourse.nodered.org/t/node-red-crashes-and-exits-with-1/70176 "2022-11-06T16:33:56Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![Mikee1234K](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/mikee1234k/32/70283_2.png) [@Mikee1234K](https://discourse.nodered.org/u/Mikee1234K)\
**Post date:** [6 November 2022 16:33 UTC](https://discourse.nodered.org/t/node-red-crashes-and-exits-with-1/70176/1 "2022-11-06T16:33:56Z")

</div>

I am running Node Red in Docker for Windows. It has been working fine for some time, and I was changing some flows when it crashed. Looking in the docker log it keeps starting then exiting immediately with 1. It starts up ok in safe mode, but I dont know whats causing the crash. I deleted everything I did before it crashed (I had a backup of my flows) and restarted. Sill crashing. I deleted and re installed node red from docker. Added all the pallets, then imported my flows... crashing again  
I am running out of ideas  
This is the docker log  
node-red.0  
2022-11-06 16:06:52.123 info Starting node-red: --max-old-space-size=256 C:\iobroker\node\_modules\node-red/red.js -v --settings C:\iobroker\node\_modules\iobroker.node-red/userdata/settings.js

node-red.0  
2022-11-06 16:06:47.119 info node-red exited with 1

node-red.0  
2022-11-06 16:06:43.721 warn 6 Nov 16:06:43 - [warn] No active project : using default flows file

node-red.0  
2022-11-06 16:06:30.669 info Starting node-red: --max-old-space-size=256 C:\iobroker\node\_modules\node-red/red.js -v --settings C:\iobroker\node\_modules\iobroker.node-red/userdata/settings.js

node-red.0  
2022-11-06 16:06:30.547 info starting. Version 4.0.0 in C:/iobroker/node\_modules/iobroker.node-red, node: v16.14.2, js-controller: 4.0.21

---

<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 2022 16:49 UTC](https://discourse.nodered.org/t/node-red-crashes-and-exits-with-1/70176/2 "2022-11-06T16:49:17Z")

</div>

Welcome to the forum @Mikee1234K

Try setting the log level to Trace in settings.js

---

<div class="post-metadata">

**Author:** ![Mikee1234K](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/mikee1234k/32/70283_2.png) [@Mikee1234K](https://discourse.nodered.org/u/Mikee1234K)\
**Post date:** [6 November 2022 16:55 UTC](https://discourse.nodered.org/t/node-red-crashes-and-exits-with-1/70176/3 "2022-11-06T16:55:01Z")

</div>

I did do that, but where is the log file located ?

I edited the settings.js part to this (I think that was right ?)

// Configure the logging output  
logging: {  
// Only console logging is currently supported  
console: {  
// Level of logging to be recorded. Options are:  
// fatal - only those errors which make the application unusable should be recorded  
// error - record errors which are deemed fatal for a particular request + fatal errors  
// warn - record problems which are non fatal + errors + fatal errors  
// info - record information about the general running of the application + warn + error + fatal errors  
// debug - record information which is more verbose than info + info + warn + error + fatal errors  
trace - record very detailed logging + debug + info + warn + error + fatal errors  
off - turn off all logging (doesn't affect metrics or audit)  
level: "info",  
// Whether or not to include metric events in the log output  
metrics: false,  
// Whether or not to include audit events in the log output  
audit: false

---

<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 2022 18:03 UTC](https://discourse.nodered.org/t/node-red-crashes-and-exits-with-1/70176/4 "2022-11-06T18:03:57Z")

</div>

> [@Mikee1234K](#):
>
> where is the log file located

You posted it earlier.

> [@Mikee1234K](#):
>
> level: "info",

Set that to trace.

---

<div class="post-metadata">

**Author:** ![Mikee1234K](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/mikee1234k/32/70283_2.png) [@Mikee1234K](https://discourse.nodered.org/u/Mikee1234K)\
**Post date:** [6 November 2022 18:20 UTC](https://discourse.nodered.org/t/node-red-crashes-and-exits-with-1/70176/5 "2022-11-06T18:20:58Z")

</div>

I have done it. (I edited the wrong entry first of all). But I still cannot find the log file.  
Also, I am running node red in IOBroker on Windows 10 Pro. Not docker.

---

<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 2022 21:38 UTC](https://discourse.nodered.org/t/node-red-crashes-and-exits-with-1/70176/6 "2022-11-06T21:38:46Z")

</div>

> [@Mikee1234K](#):
>
> But I still cannot find the log file

You posted the log in your first post

---

<div class="post-metadata">

**Author:** ![Mikee1234K](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/mikee1234k/32/70283_2.png) [@Mikee1234K](https://discourse.nodered.org/u/Mikee1234K)\
**Post date:** [6 November 2022 22:12 UTC](https://discourse.nodered.org/t/node-red-crashes-and-exits-with-1/70176/7 "2022-11-06T22:12:37Z")

</div>

That is the iobroker log. Changing settings.js to trace, that does not give any more information in the iobroker log.  
I need to find the node red log. I did a search for .log files on my C drive, but there was no log file for node red. I think node red did not write the log to disk. If it was not running in iobroker, I could probably use a command promt and redirect the log to a file.

---

<div class="post-metadata">

**Author:** ![Mikee1234K](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/mikee1234k/32/70283_2.png) [@Mikee1234K](https://discourse.nodered.org/u/Mikee1234K)\
**Post date:** [6 November 2022 22:41 UTC](https://discourse.nodered.org/t/node-red-crashes-and-exits-with-1/70176/8 "2022-11-06T22:41:35Z")

</div>

I found the log. It was hidden in a iobroker.log file.

This is from starting to crashing

2022-11-06 22:37:22.208 - e[32minfoe[39m: host.HS3 "system.adapter.node-red.0" enabled  
2022-11-06 22:37:22.257 - e[32minfoe[39m: host.HS3 instance system.adapter.node-red.0 started with pid 19300  
2022-11-06 22:37:24.785 - e[32minfoe[39m: node-red.0 (19300) starting. Version 4.0.0 in C:/iobroker/node\_modules/iobroker.node-red, node: v16.14.2, js-controller: 4.0.21  
2022-11-06 22:37:24.932 - e[32minfoe[39m: node-red.0 (19300) Starting node-red: --max-old-space-size=256 C:\iobroker\node\_modules\node-red/red.js -v --settings C:\iobroker\node\_modules\iobroker.node-red/userdata/settings.js  
2022-11-06 22:37:38.193 - e[33mwarne[39m: node-red.0 (19300) 6 Nov 22:37:38 - [warn] No active project : using default flows file

2022-11-06 22:37:40.666 - e[32minfoe[39m: mqtt.0 (8816) Client [nodered\_5fe67a4e4fa615f8] connected with secret 1667774260610\_5300  
2022-11-06 22:37:40.820 - e[32minfoe[39m: mqtt.0 (8816) Client [nodered\_5fe67a4e4fa615f8] subscribes on "Alexa/#" with regex /^Alexa(.._)?/  
2022-11-06 22:37:40.821 - e[32minfoe[39m: mqtt.0 (8816) Client [nodered\_5fe67a4e4fa615f8] subscribes on "Alexa/#" with regex /^mqtt.0.Alexa(.._)?/  
2022-11-06 22:37:40.821 - e[32minfoe[39m: mqtt.0 (8816) Client [nodered\_5fe67a4e4fa615f8] subscribes on "mqtt.0.HS4"  
2022-11-06 22:37:41.032 - e[32minfoe[39m: mqtt.0 (8816) Client [nodered\_5fe67a4e4fa615f8] publishOnSubscribe send all known states  
2022-11-06 22:37:41.033 - e[32minfoe[39m: mqtt.0 (8816) Client [nodered\_5fe67a4e4fa615f8] publishOnSubscribe  
2022-11-06 22:37:42.137 - e[32minfoe[39m: mqtt.0 (8816) Client [nodered\_5fe67a4e4fa615f8] connection closed: Error: read ECONNRESET  
2022-11-06 22:37:42.181 - e[32minfoe[39m: node-red.0 (19300) node-red exited with 1  
2022-11-06 22:37:45.370 - e[32minfoe[39m: host.HS3 "system.adapter.node-red.0" disabled  
2022-11-06 22:37:45.370 - e[32minfoe[39m: host.HS3 stopInstance system.adapter.node-red.0 (force=false, process=true)  
2022-11-06 22:37:47.193 - e[32minfoe[39m: node-red.0 (19300) Starting node-red: --max-old-space-size=256 C:\iobroker\node\_modules\node-red/red.js -v --settings C:\iobroker\node\_modules\iobroker.node-red/userdata/settings.js  
2022-11-06 22:37:50.380 - e[32minfoe[39m: host.HS3 stopInstance timeout 5000 system.adapter.node-red.0 killing pid 19300  
2022-11-06 22:37:50.408 - e[33mwarne[39m: host.HS3 instance system.adapter.node-red.0 terminated due to SIGTERM  
2022-11-06 22:37:50.408 - e[32minfoe[39m: host.HS3 instance system.adapter.node-red.0 terminated with code null ()

---

<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 2022 21:47 UTC](https://discourse.nodered.org/t/node-red-crashes-and-exits-with-1/70176/9 "2022-11-07T21:47:36Z")

</div>

Are you using the regular node-red docker image?

---

<div class="post-metadata">

**Author:** ![Mikee1234K](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/mikee1234k/32/70283_2.png) [@Mikee1234K](https://discourse.nodered.org/u/Mikee1234K)\
**Post date:** [8 November 2022 09:45 UTC](https://discourse.nodered.org/t/node-red-crashes-and-exits-with-1/70176/10 "2022-11-08T09:45:53Z")

</div>

I made a mistake, I use IOBroker.  
I have no found the problem. It was a subflow I created, only consisting of 2 very simple change nodes. Once I deletd them and the subflow, Node Red is starting and running ok again. Looking at that subflow, it does not make any sense that that was crashing node red. I have gone back to using the 2 change nodes again

---

<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:** [7 January 2023 09:46 UTC](https://discourse.nodered.org/t/node-red-crashes-and-exits-with-1/70176/11 "2023-01-07T09:46:33Z")

</div>

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