Node-RED crashes randomly

Hi!
I have multiple instances from Node-RED on different devices. On one big one for a lot of smart home stuff I have crashes almost every day. It is running in a docker container. A lot of other container are up for months on the device. I have no idea how to start the search why its crashing. For the beginning here is the console log from docker - any tipps how to start the search of the reason?

...
2023-09-10T01:17:36.956524658Z 10 Sep 03:17:36 - [info] [daylight-rgbw:4e924b22.61ab14] Sun position:-0.48039423692328814
2023-09-10T01:17:36.956636556Z 10 Sep 03:17:36 - [info] [daylight-rgbw:4e924b22.61ab14] Sun position fraction:-0.30582846975680167
2023-09-10T01:17:36.956700825Z 10 Sep 03:17:36 - [info] [daylight-rgbw:4e924b22.61ab14] Color-temp:2600
2023-09-10T01:22:36.961393325Z 10 Sep 03:22:36 - [info] [daylight-rgbw:4e924b22.61ab14] Received Topic:date-time
2023-09-10T01:22:36.961441380Z 10 Sep 03:22:36 - [info] [daylight-rgbw:4e924b22.61ab14] Received dt:1694308956960
2023-09-10T01:22:36.961633269Z 10 Sep 03:22:36 - [info] [daylight-rgbw:4e924b22.61ab14] Sun position:-0.4730633509308233
2023-09-10T01:22:36.961734391Z 10 Sep 03:22:36 - [info] [daylight-rgbw:4e924b22.61ab14] Sun position fraction:-0.30116148278502597
2023-09-10T01:22:36.961794216Z 10 Sep 03:22:36 - [info] [daylight-rgbw:4e924b22.61ab14] Color-temp:2600
2023-09-10T01:27:26.779503320Z ./entrypoint.sh: line 14:     8 Killed                  /usr/local/bin/node $NODE_OPTIONS node_modules/node-red/red.js --userDir /data $FLOWS "${@}"
2023-09-10T01:27:27.882234384Z 10 Sep 03:27:27 - [info] 
2023-09-10T01:27:27.882251474Z 
2023-09-10T01:27:27.882256431Z Welcome to Node-RED
2023-09-10T01:27:27.882260500Z ===================
2023-09-10T01:27:27.882264441Z 
2023-09-10T01:27:27.882772594Z 10 Sep 03:27:27 - [info] Node-RED version: v3.0.2
2023-09-10T01:27:27.882893666Z 10 Sep 03:27:27 - [info] Node.js  version: v16.20.0
2023-09-10T01:27:27.882992917Z 10 Sep 03:27:27 - [info] Linux 5.15.30-2-pve x64 LE
2023-09-10T01:27:28.199756718Z 10 Sep 03:27:28 - [info] Loading palette nodes
2023-09-10T01:27:28.905581829Z 10 Sep 03:27:28 - [info] node-red-contrib-ccu version: 3.4.2
...

Are you sure its crashing, look at this logfile it looks more to me the the nr instance is restarted for some reason.
What's in the entrypoint.sh on line 14?

I think it is crashing. If I do a restart on the container it looks like that:

2023-09-05T19:15:02.947730832Z 5 Sep 21:15:02 - [info] [ccu-connection:192.168.1.37] values saved to /data/ccu_values_192.168.1.37.json
2023-09-05T19:15:02.954104110Z 5 Sep 21:15:02 - [info] [miio-roborock-server:Vacuum] Miio Roborock: Destroyed
2023-09-05T19:15:02.958986697Z 5 Sep 21:15:02 - [info] [ccu-connection:192.168.1.37] de-init BidCos-RF http://192.168.1.34:2049 done
2023-09-05T19:15:02.961254894Z 5 Sep 21:15:02 - [info] [ccu-connection:192.168.1.37] de-init VirtualDevices http://192.168.1.34:2049 done
2023-09-05T19:15:02.964373151Z 5 Sep 21:15:02 - [info] [ccu-connection:192.168.1.37] de-init HmIP-RF http://192.168.1.34:2049 done
2023-09-05T19:15:02.964831115Z 5 Sep 21:15:02 - [info] [ccu-connection:192.168.1.37] xmlrpc server closed
2023-09-05T19:15:02.964859318Z 5 Sep 21:15:02 - [info] [ccu-connection:192.168.1.37] rpc close done
2023-09-05T19:15:02.969140149Z 5 Sep 21:15:02 - [info] [zigbee2mqtt-server.***] MQTT Close
2023-09-05T19:15:02.969366378Z 5 Sep 21:15:02 - [info] [zigbee2mqtt-server ***] MQTT End
2023-09-05T19:15:11.156146509Z 5 Sep 21:15:11 - [info] Stopped flows
2023-09-05T19:15:12.134014343Z 5 Sep 21:15:12 - [info] 
2023-09-05T19:15:12.134039034Z 
2023-09-05T19:15:12.134043774Z Welcome to Node-RED
2023-09-05T19:15:12.134047604Z ===================
2023-09-05T19:15:12.134051375Z 
2023-09-05T19:15:12.134561683Z 5 Sep 21:15:12 - [info] Node-RED version: v3.0.2
2023-09-05T19:15:12.134669879Z 5 Sep 21:15:12 - [info] Node.js  version: v16.20.0
2023-09-05T19:15:12.134758849Z 5 Sep 21:15:12 - [info] Linux 5.15.30-2-pve x64 LE
2023-09-05T19:15:12.431505766Z 5 Sep 21:15:12 - [info] Loading palette nodes

I think the entrypoint comes from this setting:

But I have no idea what this is, furthermore I'd never set this setting. It is set automatically whith the default docker file / image layers:

8 ENTRYPOINT ["docker-entrypoint.sh"]

Source of dockerfile

I was getting this error too. I think the issue is if you set resource limits on the container.

I had mine set for 1gb and 0.5 cpu. After removing these limits it's working fine.

I have no limits, CPU limit, memory limit and memory reservation. The host has 4GB of memory.

Found out that node red increases the memory usage constantly. If the memory is full it crashes. I will make a new thread to find out what the memory usage increases all the time. Thank you to @MyRandomThoughts for the memory-limit-tip.

Here you see the memory by time. The drop means a crash. If I increase the memory of the machine, it took longer until the next crash happend. :slight_smile:

Start by searching the forum. The subject of how to find out how to find out what is causing increasing memory comes up regularly.

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