every time node red crashes when doing nothing
have no idea what or where
i found this below in the log
Nov 5 15:11:49 bomb-game Node-RED[16879]: (node:16879) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or$
Nov 5 15:11:49 bomb-game Node-RED[16879]: (node:16879) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js $
Nov 5 15:11:49 bomb-game Node-RED[16879]: (node:16879) UnhandledPromiseRejectionWarning: Error: Huejay: timeout of 15000ms exceeded
Nov 5 15:11:49 bomb-game Node-RED[16879]: at /home/pi/.node-red/node_modules/huejay/lib/Transport.js:106:15
Nov 5 15:11:49 bomb-game Node-RED[16879]: at processTicksAndRejections (internal/process/task_queues.js:95:5)
Nov 5 15:11:49 bomb-game Node-RED[16879]: at runNextTicks (internal/process/task_queues.js:64:3)
Nov 5 15:11:49 bomb-game Node-RED[16879]: at listOnTimeout (internal/timers.js:526:9)
Nov 5 15:11:49 bomb-game Node-RED[16879]: at processTimers (internal/timers.js:500:7)
Nov 5 15:11:49 bomb-game Node-RED[16879]: (node:16879) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or$
Nov 5 15:11:49 bomb-game Node-RED[16879]: (node:16879) UnhandledPromiseRejectionWarning: Error: Huejay: timeout of 15000ms exceeded
Nov 5 15:11:49 bomb-game Node-RED[16879]: at /home/pi/.node-red/node_modules/huejay/lib/Transport.js:106:15
Nov 5 15:11:49 bomb-game Node-RED[16879]: at processTicksAndRejections (internal/process/task_queues.js:95:5)
Nov 5 15:11:49 bomb-game Node-RED[16879]: at runNextTicks (internal/process/task_queues.js:64:3)
Nov 5 15:11:49 bomb-game Node-RED[16879]: at listOnTimeout (internal/timers.js:526:9)
Nov 5 15:11:49 bomb-game Node-RED[16879]: at processTimers (internal/timers.js:500:7)
Nov 5 15:11:49 bomb-game Node-RED[16879]: (node:16879) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or$
Nov 5 15:14:36 bomb-game Node-RED[16879]: <--- Last few GCs --->
Nov 5 15:14:36 bomb-game Node-RED[16879]: [16879:0x3cb6bd8] 2690949 ms: Scavenge 2043.4 (2049.3) -> 2041.9 (2049.3) MB, 4.9 / 0.0 ms (average mu = 0.319, current mu = 0.294) task
Nov 5 15:14:36 bomb-game Node-RED[16879]: [16879:0x3cb6bd8] 2691031 ms: Scavenge 2043.5 (2049.3) -> 2042.0 (2049.3) MB, 4.8 / 0.0 ms (average mu = 0.319, current mu = 0.294) task
Nov 5 15:14:36 bomb-game Node-RED[16879]: [16879:0x3cb6bd8] 2691112 ms: Scavenge 2043.6 (2053.3) -> 2042.1 (2053.3) MB, 5.5 / 0.0 ms (average mu = 0.319, current mu = 0.294) task
Nov 5 15:14:36 bomb-game Node-RED[16879]: <--- JS stacktrace --->
Nov 5 15:14:36 bomb-game Node-RED[16879]: FATAL ERROR: Ineffective mark-compacts near heap limit Allocation failed - JavaScript heap out of memory
Nov 5 15:14:36 bomb-game systemd[1]: nodered.service: Main process exited, code=killed, status=6/ABRT
Nov 5 15:14:36 bomb-game systemd[1]: nodered.service: Failed with result 'signal'.
Nov 5 15:14:56 bomb-game systemd[1]: nodered.service: Service RestartSec=20s expired, scheduling restart.
Nov 5 15:14:56 bomb-game systemd[1]: nodered.service: Scheduled restart job, restart counter is at 6.
Nov 5 15:14:56 bomb-game systemd[1]: Stopped Node-RED graphical event wiring tool.
Nov 5 15:14:56 bomb-game systemd[1]: Started Node-RED graphical event wiring tool.
Nov 5 15:14:58 bomb-game Node-RED[20122]: 5 Nov 15:14:58 - [info]
Nov 5 15:14:58 bomb-game Node-RED[20122]: Welcome to Node-RED
Nov 5 15:14:58 bomb-game Node-RED[20122]: ===================
Nov 5 15:14:58 bomb-game Node-RED[20122]: 5 Nov 15:14:58 - [info] Node-RED version: v2.1.1
Nov 5 15:14:58 bomb-game Node-RED[20122]: 5 Nov 15:14:58 - [info] Node.js version: v14.18.1
Nov 5 15:14:58 bomb-game Node-RED[20122]: 5 Nov 15:14:58 - [info] Linux 5.10.17-v7l+ arm LE
Nov 5 15:14:58 bomb-game Node-RED[20122]: 5 Nov 15:14:58 - [info] Loading palette nodes
Nov 5 15:15:00 bomb-game Node-RED[20122]: 5 Nov 15:15:00 - [info] Dashboard version 3.0.4 started at /ui
Nov 5 15:15:00 bomb-game Node-RED[20122]: 5 Nov 15:15:00 - [info] Settings file : /home/pi/.node-red/settings.js
Nov 5 15:15:00 bomb-game Node-RED[20122]: 5 Nov 15:15:00 - [info] Context store : 'default' [module=memory]
Nov 5 15:15:00 bomb-game Node-RED[20122]: 5 Nov 15:15:00 - [info] User directory : /home/pi/.node-red
Nov 5 15:15:00 bomb-game Node-RED[20122]: 5 Nov 15:15:00 - [warn] Projects disabled : editorTheme.projects.enabled=false
Nov 5 15:15:00 bomb-game Node-RED[20122]: 5 Nov 15:15:00 - [info] Flows file : /home/pi/.node-red/flows.json
Nov 5 15:15:00 bomb-game Node-RED[20122]: 5 Nov 15:15:00 - [info] Server now running at http://127.0.0.1:1880/
Nov 5 15:15:00 bomb-game Node-RED[20122]: 5 Nov 15:15:00 - [warn]
Nov 5 15:15:00 bomb-game Node-RED[20122]: ---------------------------------------------------------------------
i guess it is about this line but no clue what it means
FATAL ERROR: Ineffective mark-compacts near heap limit Allocation failed - JavaScript heap out of memory
The npm package huejay is crashing. Go into your .node-red folder and run npm list huejay
which should tell you which node red node is using that, if you don't know already.
Make sure all your nodes are at the latest versions (you can check that in Manage Palette).
That means there is a bug in that node that crashes node-red. Unfortunately I think that node is no longer supported as there are many unaddressed issues on its github page, including other reports of crashing node-red.
You have run out of memory, something you are doing is using memory and not releasing it. Are you doing something with images or video or large files or something similar?
No, it is very basic what it is at the moment.
I also created a clean install and imported the node red json
Again it crashes.
There are a lot ping nodes in it, i disabled them and still same problem.
latest crash report below
6 Nov 17:17:41 - [info] [function:flows_*.json] Backup made
<--- Last few GCs --->
[5366:0x4074bd8] 2287594 ms: Scavenge (reduce) 2040.9 (2044.4) -> 2040.2 (2045.4) MB, 6.6 / 0.0 ms (average mu = 0.181, current mu = 0.145) task
[5366:0x4074bd8] 2287652 ms: Scavenge (reduce) 2041.0 (2044.4) -> 2040.2 (2045.4) MB, 6.6 / 0.0 ms (average mu = 0.181, current mu = 0.145) task
[5366:0x4074bd8] 2287711 ms: Scavenge (reduce) 2041.0 (2044.4) -> 2040.2 (2045.4) MB, 6.5 / 0.0 ms (average mu = 0.181, current mu = 0.145) task
<--- JS stacktrace --->
FATAL ERROR: Ineffective mark-compacts near heap limit Allocation failed - JavaScript heap out of memory
nodered.service: Main process exited, code=killed, status=6/ABRT
nodered.service: Failed with result 'signal'.
nodered.service: Service RestartSec=20s expired, scheduling restart.
nodered.service: Scheduled restart job, restart counter is at 2.
Stopped Node-RED graphical event wiring tool.
Started Node-RED graphical event wiring tool.
6 Nov 17:54:43 - [info]
Welcome to Node-RED
===================
6 Nov 17:54:43 - [info] Node-RED version: v2.1.3
6 Nov 17:54:43 - [info] Node.js version: v14.18.1
6 Nov 17:54:43 - [info] Linux 5.10.17-v7l+ arm LE
I can send you the json if you like to see what is giving the problem
Wow that is a lot of MQTT nodes, each one making a connection to the broker. Is the broker running on the same Pi?
What model Pi is it and how much memory does it have?
For the mqtt-inbomb/result/bombN, the JSON nodes after it could be removed if in the mqtt-in node you set the Output option to a parsed JSON object.
if you change the mqtt-in to use the topic bomb/result/# you could have one mqtt-in node (for that batch of nodes)followed by a switch node to test the 'topic' and send the msg to the correct function node.
for the mqtt-out nodes, I would consolidate them too by having one mqtt-out node with no topic and have the incoming msg contain a msg.topic. To keep the flows neat, you could use a link node (or the new link call node) on the pages to the mqtt-out nodes
I think reducing the number of MQTT nodes will go quite aways to reducing your memory usage.
Thanks @zenofmud for taking time to scan my work.
And thanks for you feedback, i learned some new nodes today
After some playing around the problem was solved before using your tips.
No idea what it exactly was.
The important thing with MQTT nodes is to only have one config node for each server. So if you click on the Server drop-down it should only show one entry (or one for each broker if you connect to multiple brokers). Then you will only have one connection to the broker and it doesn't matter how many MQTT In/Out nodes you use.