Cant start NR - crashes on start

On boot nr crashes.
Really no idea how or what to do

The logs tells me this:

<--- Last few GCs --->
re[1154:0x3f2e448]    43468 ms: Mark-sweep 279.9 (282.5) -> 279.8 (282.5) MB, 62.0 / 0.0 ms  (+ 5.8 ms in 1 steps since start of marking, biggest step 5.8 ms, walltime since start of marking 70 ms) (average mu = 0.151, current mu = 0.027) allocation failure[1154:0x3f2e448]    43539 ms: Mark-sweep 280.0 (282.5) -> 279.9 (282.5) MB, 53.3 / 0.0 ms  (+ 11.3 ms in 2 steps since start of marking, biggest step 6.5 ms, walltime since start of marking 70 ms) (average mu = 0.118, current mu = 0.081) allocation failur
<--- JS stacktrace --->
==== JS stack trace =========================================
    0: ExitFrame [pc: 0xee3000]
Security context: 0x43b8ea35 <JSObject>
    1: drawLine [0x355fc035] [/home/pi/.node-red/node_modules/oled-i2c-bus/oled.js:~552] [pc=0x52dd8ac0](this=0x4d3acf85 <Oled map = 0x4a4b6845>,0x26b00279 <undefined>,0x26b00279 <undefined>,0x4579befd <HeapNumber nan>,0x26b00279 <undefined>,1,0x26b00279 <undefined>)
    2: arguments adaptor frame: 5->6
    3: _inputCallback [0x4579bf39] [/home/pi/.node-red/node_modul...
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 5.
Stopped Node-RED graphical event wiring tool.
Started Node-RED graphical event wiring tool.
16 May 22:10:20 - [info]
Welcome to Node-RED
16 May 22:10:20 - [info] Node-RED version: v1.3.4
16 May 22:10:20 - [info] Node.js  version: v12.22.1
16 May 22:10:20 - [info] Linux 5.10.17-v7l+ arm LE
16 May 22:10:20 - [info] Loading palette nodes
16 May 22:10:22 - [info] Worldmap version 2.13.4
16 May 22:10:22 - [info] Dashboard version 2.28.2 started at /ui
16 May 22:10:22 - [info] Settings file  : /home/pi/.node-red/settings.js
16 May 22:10:22 - [info] Context store  : 'default' [module=memory]
16 May 22:10:22 - [info] User directory : /home/pi/.node-red
16 May 22:10:22 - [warn] Projects disabled : editorTheme.projects.enabled=false
16 May 22:10:22 - [info] Flows file     : /home/pi/.node-red/flows_logger.json
16 May 22:10:22 - [info] Server now running at
16 May 22:10:22 - [warn]

What change did you make (if any) that might have caused the change in behaviour?

Ehh nothing. I was just running when the battery run low. I grabbed a new battery and then this happend.
Really no idea on how or what

Have you re-booted?
If it was run on low batteries could that corrupt the SD card?
Alternatively could the low voltage damage a peripheral such as the display?

Do you keep image backups of the card? If so you could revert to your latest backup.

All is running except Node Red.
Did reboots and other pi and a new install with the install script
Nothing worked.
I can get back with the flow file but would like to know what caused the problem.

Is there any solutions to do a proper shutdown when running on batteries in NR?

Try renaming the .node-red/node_modules and then, in the .node-red folder run
npm install
That will re-install all the non-standard nodes you are using. Then restart node-red. If that fixes it then something in your node_modules folder had been corrupted.

I am not sure what you mean. The fact that you are running on batteries is irrelevant to how to do a proper shutdown of the pi.

I did the rename and npm install without succes.
Then i renamed flows.json and tried again to start
Now it is working :wink:
What does this say? Did i create something buggy??

About running on batteries, what i mean is: is it possible to monitor battery power and send a shutdown when the battery power is becoming to low

Potentially your flow had a loop causing node-red to exhaust the stack. The fact removing your flow fixed things suggests that. Or a (bad) setting on a buggy node?


I had some inject nodes on inject ones and repeat.
Turned that off and now it works again.

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