Node Red crashes and exits with 1

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

Welcome to the forum @Mikee1234K

Try setting the log level to Trace in settings.js

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

You posted it earlier.

Set that to trace.

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.

You posted the log in your first post

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.

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 ()

Are you using the regular node-red docker image?

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

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