# Cyclical crashing

**URL:** <https://discourse.nodered.org/t/cyclical-crashing/1208>\
**Category:** General\
**Created:** [30 June 2018 17:51 UTC](https://discourse.nodered.org/t/cyclical-crashing/1208 "2018-06-30T17:51:00Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![Nagrom](https://avatars.discourse-cdn.com/v4/letter/n/73ab20/32.png) [@Nagrom](https://discourse.nodered.org/u/Nagrom)\
**Post date:** [30 June 2018 17:51 UTC](https://discourse.nodered.org/t/cyclical-crashing/1208/1 "2018-06-30T17:51:00Z")

</div>

I'm new to this and have been noodling around with a couple of Sonoff switches and MQTT.

The Sonoff nodes have been installed for some time now. Suddenly I'm getting cyclical crashing when Node-red starts. Here is the log...

> pi@raspberrypi3:~ $ node-red-stop
> 
> Stop Node-RED
> 
> Use node-red-start to start Node-RED again  
> node-red-log  
> pi@raspberrypi3:~ $ node-red-log
> 
> # nodered.service: Unit entered failed state. nodered.service: Failed with result 'exit-code'. nodered.service: Service hold-off time over, scheduling restart. Stopped Node-RED graphical event wiring tool. Started Node-RED graphical event wiring tool. 30 Jun 10:16:09 - [info] Welcome to Node-RED
> 
> 30 Jun 10:16:09 - [info] Node-RED version: v0.18.7  
> 30 Jun 10:16:09 - [info] Node.js version: v8.11.3  
> 30 Jun 10:16:09 - [info] Linux 4.14.50-v7+ arm LE  
> 30 Jun 10:16:10 - [info] Loading palette nodes  
> Stopping Node-RED graphical event wiring tool...  
> global Settings { uib\_globalSettings: { debug: false },  
> userDir: '/home/pi/.node-red',  
> httpNodeRoot: '/' }  
> 30 Jun 10:16:15 - [info] Dashboard version 2.9.4 started at /ui  
> 30 Jun 10:16:16 - [warn] ------------------------------------------------------  
> 30 Jun 10:16:16 - [warn] [node-red-contrib-moment2/moment] 'moment' already registered by module node-red-contrib-moment  
> 30 Jun 10:16:16 - [warn] ------------------------------------------------------  
> 30 Jun 10:16:16 - [info] Settings file : /home/pi/.node-red/settings.js  
> 30 Jun 10:16:16 - [info] User directory : /home/pi/.node-red  
> 30 Jun 10:16:16 - [warn] Projects disabled : editorTheme.projects.enabled=false  
> 30 Jun 10:16:16 - [info] Flows file : /home/pi/.node-red/flows\_raspberrypi3.json  
> Stopped Node-RED graphical event wiring tool.

My ignorant sense is that there is a simple fix. I'm hoping someone can direct me to the solution. Thanks.

---

<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:** [30 June 2018 18:41 UTC](https://discourse.nodered.org/t/cyclical-crashing/1208/2 "2018-06-30T18:41:22Z")

</div>

You seem to have shown us what is in the log when you run node-red-stop just as it is starting. What do you see when you run node-red-start?

---

<div class="post-metadata">

**Author:** ![Nagrom](https://avatars.discourse-cdn.com/v4/letter/n/73ab20/32.png) [@Nagrom](https://discourse.nodered.org/u/Nagrom)\
**Post date:** [30 June 2018 18:58 UTC](https://discourse.nodered.org/t/cyclical-crashing/1208/3 "2018-06-30T18:58:52Z")

</div>

Thanks for clarifying....This cycles until I stop it.

> # Starting as a systemd service. Started Node-RED graphical event wiring tool. 30 Jun 11:57:39 - [info] Welcome to Node-RED
> 
> ## 30 Jun 11:57:39 - [info] Node-RED version: v0.18.7 30 Jun 11:57:39 - [info] Node.js version: v8.11.3 30 Jun 11:57:39 - [info] Linux 4.14.50-v7+ arm LE 30 Jun 11:57:40 - [info] Loading palette nodes global Settings { uib\_globalSettings: { debug: false }, userDir: '/home/pi/.node-red', httpNodeRoot: '/' } 30 Jun 11:57:46 - [info] Dashboard version 2.9.4 started at /ui 30 Jun 11:57:47 - [warn] ------------------------------------------------------ 30 Jun 11:57:47 - [warn] [node-red-contrib-moment2/moment] 'moment' already registered by module node-red-contrib-moment 30 Jun 11:57:47 - [warn] ------------------------------------------------------ 30 Jun 11:57:47 - [info] Settings file : /home/pi/.node-red/settings.js 30 Jun 11:57:47 - [info] User directory : /home/pi/.node-red 30 Jun 11:57:47 - [warn] Projects disabled : editorTheme.projects.enabled=false 30 Jun 11:57:47 - [info] Flows file : /home/pi/.node-red/flows\_raspberrypi3.json 30 Jun 11:57:47 - [info] Server now running at [http://127.0.0.1:1880/](http://127.0.0.1:1880/) 30 Jun 11:57:47 - [warn]
> 
> ## Your flow credentials file is encrypted using a system-generated key. If the system-generated key is lost for any reason, your credentials file will not be recoverable, you will have to delete it and re-enter your credentials. You should set your own key using the 'credentialSecret' option in your settings file. Node-RED will then re-encrypt your credentials file using your chosen key the next time you deploy a change.
> 
> 30 Jun 11:57:47 - [warn] Error loading credentials: SyntaxError: Unexpected token � in JSON at position 0  
> 30 Jun 11:57:47 - [warn] Error loading flows: Error: Failed to decrypt credentials  
> 30 Jun 11:57:47 - [info] Starting flows  
> 30 Jun 11:57:48 - [info] Started flows  
> 30 Jun 11:57:48 - [info] [sonoff-server:2f8463fd.c923ec] SONOFF Server Started On Port 1080  
> 30 Jun 11:57:48 - [red] Uncaught Exception:  
> 30 Jun 11:57:48 - Error: listen EACCES 0.0.0.0:443  
> at Object.\_errnoException (util.js:992:11)  
> at \_exceptionWithHostPort (util.js:1014:20)  
> at Server.setupListenHandle [as \_listen2] (net.js:1338:19)  
> nodered.service: Main process exited, code=exited, status=1/FAILURE  
> nodered.service: Unit entered failed state.  
> nodered.service: Failed with result 'exit-code'.  
> nodered.service: Service hold-off time over, scheduling restart.  
> Stopped Node-RED graphical event wiring tool.  
> Started Node-RED graphical event wiring tool.  
> 30 Jun 11:57:50 - [info]

---

<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:** [30 June 2018 19:15 UTC](https://discourse.nodered.org/t/cyclical-crashing/1208/4 "2018-06-30T19:15:51Z")

</div>

There is a problem decrypting your credentials file (which contains any node red user/passwords you may have entered. The easiest way to recover from this is to delete the file `.node-red/flows_<something>_cred.json` where will probably be the name of the computer. Then restart node-red. You will have to re-enter any credentials that you might have saved.

---

<div class="post-metadata">

**Author:** ![Nagrom](https://avatars.discourse-cdn.com/v4/letter/n/73ab20/32.png) [@Nagrom](https://discourse.nodered.org/u/Nagrom)\
**Post date:** [30 June 2018 19:52 UTC](https://discourse.nodered.org/t/cyclical-crashing/1208/5 "2018-06-30T19:52:58Z")

</div>

I deleted the \_cred.json file and restarted node-red.

This is the currently cycling fail on start....the \_cred.json file did not regenerate, nor did it ask for any credentials. I also went into the settings file and uncommented the user/pw login bits. But that by its self didn't solve anything.

Any other suggestions?

> # Starting as a systemd service. Started Node-RED graphical event wiring tool. 30 Jun 12:46:56 - [info] Welcome to Node-RED
> 
> ## 30 Jun 12:46:56 - [info] Node-RED version: v0.18.7 30 Jun 12:46:56 - [info] Node.js version: v8.11.3 30 Jun 12:46:56 - [info] Linux 4.14.50-v7+ arm LE 30 Jun 12:46:57 - [info] Loading palette nodes global Settings { uib\_globalSettings: { debug: false }, userDir: '/home/pi/.node-red', httpNodeRoot: '/' } 30 Jun 12:47:03 - [info] Dashboard version 2.9.4 started at /ui 30 Jun 12:47:04 - [warn] ------------------------------------------------------ 30 Jun 12:47:04 - [warn] [node-red-contrib-moment2/moment] 'moment' already registered by module node-red-contrib-moment 30 Jun 12:47:04 - [warn] ------------------------------------------------------ 30 Jun 12:47:04 - [info] Settings file : /home/pi/.node-red/settings.js 30 Jun 12:47:04 - [info] User directory : /home/pi/.node-red 30 Jun 12:47:04 - [warn] Projects disabled : editorTheme.projects.enabled=false 30 Jun 12:47:04 - [info] Flows file : /home/pi/.node-red/flows\_raspberrypi3.json 30 Jun 12:47:04 - [info] Server now running at [http://127.0.0.1:1880/](http://127.0.0.1:1880/) 30 Jun 12:47:04 - [warn]
> 
> ## Your flow credentials file is encrypted using a system-generated key. If the system-generated key is lost for any reason, your credentials file will not be recoverable, you will have to delete it and re-enter your credentials. You should set your own key using the 'credentialSecret' option in your settings file. Node-RED will then re-encrypt your credentials file using your chosen key the next time you deploy a change.
> 
> # 30 Jun 12:47:04 - [info] Starting flows 30 Jun 12:47:04 - [info] Started flows 30 Jun 12:47:04 - [info] [sonoff-server:2f8463fd.c923ec] SONOFF Server Started On Port 1080 30 Jun 12:47:04 - [red] Uncaught Exception: 30 Jun 12:47:04 - Error: listen EACCES 0.0.0.0:443 nodered.service: Main process exited, code=exited, status=1/FAILURE nodered.service: Unit entered failed state. nodered.service: Failed with result 'exit-code'. nodered.service: Service hold-off time over, scheduling restart. Stopped Node-RED graphical event wiring tool. Started Node-RED graphical event wiring tool. 30 Jun 12:47:07 - [info] Welcome to Node-RED
> 
> ## 30 Jun 12:47:07 - [info] Node-RED version: v0.18.7 30 Jun 12:47:07 - [info] Node.js version: v8.11.3 30 Jun 12:47:07 - [info] Linux 4.14.50-v7+ arm LE 30 Jun 12:47:08 - [info] Loading palette nodes global Settings { uib\_globalSettings: { debug: false }, userDir: '/home/pi/.node-red', httpNodeRoot: '/' } 30 Jun 12:47:14 - [info] Dashboard version 2.9.4 started at /ui 30 Jun 12:47:15 - [warn] ------------------------------------------------------ 30 Jun 12:47:15 - [warn] [node-red-contrib-moment2/moment] 'moment' already registered by module node-red-contrib-moment 30 Jun 12:47:15 - [warn] ------------------------------------------------------ 30 Jun 12:47:15 - [info] Settings file : /home/pi/.node-red/settings.js 30 Jun 12:47:15 - [info] User directory : /home/pi/.node-red 30 Jun 12:47:15 - [warn] Projects disabled : editorTheme.projects.enabled=false 30 Jun 12:47:15 - [info] Flows file : /home/pi/.node-red/flows\_raspberrypi3.json 30 Jun 12:47:15 - [info] Server now running at [http://127.0.0.1:1880/](http://127.0.0.1:1880/) 30 Jun 12:47:15 - [warn]
> 
> ## Your flow credentials file is encrypted using a system-generated key. If the system-generated key is lost for any reason, your credentials file will not be recoverable, you will have to delete it and re-enter your credentials. You should set your own key using the 'credentialSecret' option in your settings file. Node-RED will then re-encrypt your credentials file using your chosen key the next time you deploy a change.
> 
> # 30 Jun 12:47:15 - [info] Starting flows 30 Jun 12:47:15 - [info] Started flows 30 Jun 12:47:15 - [info] [sonoff-server:2f8463fd.c923ec] SONOFF Server Started On Port 1080 30 Jun 12:47:15 - [red] Uncaught Exception: nodered.service: Main process exited, code=exited, status=1/FAILURE nodered.service: Unit entered failed state. nodered.service: Failed with result 'exit-code'. nodered.service: Service hold-off time over, scheduling restart. Stopped Node-RED graphical event wiring tool. Started Node-RED graphical event wiring tool. 30 Jun 12:47:18 - [info] Welcome to Node-RED
> 
> 30 Jun 12:47:18 - [info] Node-RED version: v0.18.7  
> 30 Jun 12:47:18 - [info] Node.js version: v8.11.3  
> 30 Jun 12:47:18 - [info] Linux 4.14.50-v7+ arm LE  
> 30 Jun 12:47:19 - [info] Loading palette nodes  
> Stopping Node-RED graphical event wiring tool...  
> Stopped Node-RED graphical event wiring tool.

---

<div class="post-metadata">

**Author:** ![Nagrom](https://avatars.discourse-cdn.com/v4/letter/n/73ab20/32.png) [@Nagrom](https://discourse.nodered.org/u/Nagrom)\
**Post date:** [30 June 2018 19:54 UTC](https://discourse.nodered.org/t/cyclical-crashing/1208/6 "2018-06-30T19:54:55Z")

</div>

It looks to my inexperienced eye that the sonoff server is failing to watch/listen to something.

---

<div class="post-metadata">

**Author:** ![SteveMann](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/stevemann/32/3810_2.png) [@SteveMann](https://discourse.nodered.org/u/SteveMann)\
**Post date:** [30 June 2018 22:46 UTC](https://discourse.nodered.org/t/cyclical-crashing/1208/7 "2018-06-30T22:46:40Z")

</div>

To my limited experience… When I see a cyclic failure, the first thing I think of is power supply.

---

<div class="post-metadata">

**Author:** ![Nagrom](https://avatars.discourse-cdn.com/v4/letter/n/73ab20/32.png) [@Nagrom](https://discourse.nodered.org/u/Nagrom)\
**Post date:** [30 June 2018 22:59 UTC](https://discourse.nodered.org/t/cyclical-crashing/1208/8 "2018-06-30T22:59:49Z")

</div>

hmmmm…

It’s plugged into the 120v wall outlet with the provided power supply. The pi runs well aside from node-red.

But it’s certainly plausible.

---

<div class="post-metadata">

**Author:** ![davidcgu](https://avatars.discourse-cdn.com/v4/letter/d/e8c25b/32.png) [@davidcgu](https://discourse.nodered.org/u/davidcgu)\
**Post date:** [30 June 2018 23:22 UTC](https://discourse.nodered.org/t/cyclical-crashing/1208/9 "2018-06-30T23:22:36Z")

</div>

I had many problems due to power supply or even the cable too thin too as SteveMann told, from other side I had also several issues using GPIOs even damaged some pi, at the end decided the better was to use PI for soft and use ESPs or arduino for managing out/in this also reduce power supply consumption and a lot of problems.

For me was the best choice with less than 10$ you can have an arduino mega with a lot of analog channels almost 50 digital ones… and just use it plugged via USB (with independent power supply of course), This has removed a lot of pains from me.

Regards

---

<div class="post-metadata">

**Author:** ![dceejay](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/dceejay/32/38_2.png) [@dceejay](https://discourse.nodered.org/u/dceejay)\
**Post date:** [1 July 2018 07:03 UTC](https://discourse.nodered.org/t/cyclical-crashing/1208/10 "2018-07-01T07:03:51Z")

</div>

What happens if you stop the sevice from trying to run. `node-red-stop` then run it manually with a blank flow. `node-red blank.json` does it start OK ?

---

<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:** [1 July 2018 07:19 UTC](https://discourse.nodered.org/t/cyclical-crashing/1208/11 "2018-07-01T07:19:11Z")

</div>

> [@Nagrom](#):
>
> Error: listen EACCES 0.0.0.0:443  
> nodered.service: Main process exited, code=exited, status=1/FAILURE

That is not a PSU issue. The server is trying to listen on port 443 and does not have permission to do so. Port 443 is the https port I believe. Are you trying to use https?

---

<div class="post-metadata">

**Author:** ![Nagrom](https://avatars.discourse-cdn.com/v4/letter/n/73ab20/32.png) [@Nagrom](https://discourse.nodered.org/u/Nagrom)\
**Post date:** [7 July 2018 06:49 UTC](https://discourse.nodered.org/t/cyclical-crashing/1208/12 "2018-07-07T06:49:52Z")

</div>

I have to confess to just bailing and reinstalling from scratch. Seemed like the most efficient option considering how easy it would be to get back learning compared to banging my head on this problem that wouldn't matter when I used the Sonoff anyway.

Thanks for the help and suggestions.
