# Cant start NR - crashes on start

**URL:** https://discourse.nodered.org/t/cant-start-nr-crashes-on-start/45738
**Category:** General
**Created:** [16 May 2021 20:14 UTC](https://discourse.nodered.org/t/cant-start-nr-crashes-on-start/45738 "2021-05-16T20:14:14Z")
**Posts on this page:** 10
**Page:** 1

<div class="post-metadata">

### Author: ![RogierQ](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/rogierq/32/3211_2.png) [@RogierQ](https://discourse.nodered.org/u/RogierQ)
#### Post date: [16 May 2021 20:14 UTC](https://discourse.nodered.org/t/cant-start-nr-crashes-on-start/45738/1 "2021-05-16T20:14:15Z")

</div>

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

The logs tells me this:

```auto
<--- 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 http://127.0.0.1:1880/
16 May 22:10:22 - [warn]

```

---

<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: [16 May 2021 20:34 UTC](https://discourse.nodered.org/t/cant-start-nr-crashes-on-start/45738/2 "2021-05-16T20:34:50Z")

</div>

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

---

<div class="post-metadata">

### Author: ![RogierQ](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/rogierq/32/3211_2.png) [@RogierQ](https://discourse.nodered.org/u/RogierQ)
#### Post date: [16 May 2021 20:47 UTC](https://discourse.nodered.org/t/cant-start-nr-crashes-on-start/45738/3 "2021-05-16T20:47:56Z")

</div>

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

---

<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: [16 May 2021 21:08 UTC](https://discourse.nodered.org/t/cant-start-nr-crashes-on-start/45738/4 "2021-05-16T21:08:50Z")

</div>

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.

---

<div class="post-metadata">

### Author: ![RogierQ](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/rogierq/32/3211_2.png) [@RogierQ](https://discourse.nodered.org/u/RogierQ)
#### Post date: [17 May 2021 05:52 UTC](https://discourse.nodered.org/t/cant-start-nr-crashes-on-start/45738/5 "2021-05-17T05:52:01Z")

</div>

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?

---

<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: [17 May 2021 08:53 UTC](https://discourse.nodered.org/t/cant-start-nr-crashes-on-start/45738/6 "2021-05-17T08:53:21Z")

</div>

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.

> [@RogierQ](#):
>
> Is there any solutions to do a proper shutdown when running on batteries in NR?

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.

---

<div class="post-metadata">

### Author: ![RogierQ](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/rogierq/32/3211_2.png) [@RogierQ](https://discourse.nodered.org/u/RogierQ)
#### Post date: [17 May 2021 18:59 UTC](https://discourse.nodered.org/t/cant-start-nr-crashes-on-start/45738/7 "2021-05-17T18:59:12Z")

</div>

I did the rename and npm install without succes.  
Then i renamed flows.json and tried again to start  
Now it is working 😉  
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

---

<div class="post-metadata">

### Author: ![Steve-Mcl](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/steve-mcl/32/4826_2.png) [@Steve-Mcl](https://discourse.nodered.org/u/Steve-Mcl)
#### Post date: [17 May 2021 19:01 UTC](https://discourse.nodered.org/t/cant-start-nr-crashes-on-start/45738/8 "2021-05-17T19:01:40Z")

</div>

> [@RogierQ](#):
>
> Then i renamed flows.json and tried again to start  
> Now it is working 😉  
> What does this say? Did i create something buggy?

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?

---

<div class="post-metadata">

### Author: ![RogierQ](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/rogierq/32/3211_2.png) [@RogierQ](https://discourse.nodered.org/u/RogierQ)
#### Post date: [17 May 2021 19:12 UTC](https://discourse.nodered.org/t/cant-start-nr-crashes-on-start/45738/9 "2021-05-17T19:12:46Z")

</div>

Thanks!

I had some inject nodes on inject ones and repeat.  
Turned that off and now it works 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: [16 July 2021 19:13 UTC](https://discourse.nodered.org/t/cant-start-nr-crashes-on-start/45738/10 "2021-07-16T19:13:11Z")

</div>

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