# Node-Red Crashing Upon Opening

**URL:** <https://discourse.nodered.org/t/node-red-crashing-upon-opening/47346>\
**Category:** General\
**Created:** [18 June 2021 18:52 UTC](https://discourse.nodered.org/t/node-red-crashing-upon-opening/47346 "2021-06-18T18:52:46Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![psalibe](https://avatars.discourse-cdn.com/v4/letter/p/e9c0ed/32.png) [@psalibe](https://discourse.nodered.org/u/psalibe)\
**Post date:** [18 June 2021 18:52 UTC](https://discourse.nodered.org/t/node-red-crashing-upon-opening/47346/1 "2021-06-18T18:52:46Z")

</div>

Hello,

I have a super urgent matter of node-red crashing upon opening. It has been operating completely fine up until about 1 hour ago where now it crashes repeatedly. Below is the error I get. Running on a Raspberry-Pi and my node-red says v1.3.4 from the dropdown menu in the top right.

```auto
* nodered.service - Node-RED graphical event wiring tool
   Loaded: loaded (/lib/systemd/system/nodered.service; enabled; vendor preset: enabled)
   Active: activating (auto-restart) (Result: exit-code) since Fri 2021-06-18 14:45:36 EDT; 16s ago
     Docs: http://nodered.org/docs/hardware/raspberrypi.html
  Process: 2009 ExecStart=/usr/bin/env node-red-pi $NODE_OPTIONS $NODE_RED_OPTIONS (code=exited, status=1/FAILURE)
 Main PID: 2009 (code=exited, status=1/FAILURE)
~

```

---

<div class="post-metadata">

**Author:** ![zenofmud](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/zenofmud/32/316_2.png) [@zenofmud](https://discourse.nodered.org/u/zenofmud)\
**Post date:** [18 June 2021 18:58 UTC](https://discourse.nodered.org/t/node-red-crashing-upon-opening/47346/2 "2021-06-18T18:58:41Z")

</div>

First off, you should be able to start it from the command line using the `--safe` option.

Second, what changed? It shouldn't just start crashing.

---

<div class="post-metadata">

**Author:** ![psalibe](https://avatars.discourse-cdn.com/v4/letter/p/e9c0ed/32.png) [@psalibe](https://discourse.nodered.org/u/psalibe)\
**Post date:** [18 June 2021 19:01 UTC](https://discourse.nodered.org/t/node-red-crashing-upon-opening/47346/3 "2021-06-18T19:01:46Z")

</div>

What is the full command using the --safe?

Also, quite literally nothing changed. While remotely monitoring it I noticed our node-red-contrib-opcua nodes were not connecting and it was stuck in a loop of auto-restarts.

---

<div class="post-metadata">

**Author:** ![psalibe](https://avatars.discourse-cdn.com/v4/letter/p/e9c0ed/32.png) [@psalibe](https://discourse.nodered.org/u/psalibe)\
**Post date:** [18 June 2021 19:11 UTC](https://discourse.nodered.org/t/node-red-crashing-upon-opening/47346/4 "2021-06-18T19:11:34Z")

</div>

```auto
pi@raspberrypi:~ $ node-red-start --safe

Start Node-RED
 
Once Node-RED has started, point a browser at http://192.168.0.111:1880
On Pi Node-RED works better with the Firefox or Chrome browser
 
Use node-red-stop to stop Node-RED
Use node-red-start to start Node-RED again
Use node-red-log to view the recent log output
Use sudo systemctl enable nodered.service to autostart Node-RED at every boot
Use sudo systemctl disable nodered.service to disable autostart on boot
 
To find more nodes and example flows - go to http://flows.nodered.org
 
Starting as a systemd service.
18 Jun 15:09:58 - [info]
Welcome to Node-RED
===================
18 Jun 15:09:58 - [info] Node-RED version: v1.3.4
18 Jun 15:09:58 - [info] Node.js version: v14.16.1
18 Jun 15:09:58 - [info] Linux 5.10.17-v7+ arm LE
18 Jun 15:09:59 - [info] Loading palette nodes
18 Jun 15:10:07 - [info] Dashboard version 2.29.0 started at /ui
18 Jun 15:10:08 - [info] Settings file : /home/pi/.node-red/settings.js
18 Jun 15:10:08 - [info] HTTP Static : /home/pi/.node-red/static
18 Jun 15:10:08 - [info] Context store : 'default' [module=memory]
18 Jun 15:10:08 - [info] User directory : /home/pi/.node-red
18 Jun 15:10:08 - [warn] Projects disabled : editorTheme.projects.enabled=false
18 Jun 15:10:08 - [info] Flows file : /home/pi/.node-red/flows_raspberrypi.json
18 Jun 15:10:08 - [info] Server now running at http://127.0.0.1:1880/
18 Jun 15:10:08 - [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.
---------------------------------------------------------------------
18 Jun 15:10:08 - [info] Starting flows
18 Jun 15:10:09 - [info] [OpcUa-Client:READ] Local 'own' certificate is NOT used.
18 Jun 15:10:09 - [info] [OpcUa-Client:WRITE] Local 'own' certificate is NOT used.
18 Jun 15:10:09 - [info] [OpcUa-Client:READ] Local 'own' certificate is NOT used.
18 Jun 15:10:09 - [info] Started flows
Ubidots Publisher connected
Published successfully,
Published successfully,
18 Jun 15:10:14 - [red] Uncaught Exception:
18 Jun 15:10:14 - SyntaxError: Unexpected end of JSON input
    at JSON.parse (<anonymous>)
    at parseOutputObject (/home/pi/.node-red/node_modules/ubidots-nodered/ubidots/ubidots_in.js:21:43)
    at defineOutputObject (/home/pi/.node-red/node_modules/ubidots-nodered/ubidots/ubidots_in.js:13:19)
    at MqttClient.<anonymous> (/home/pi/.node-red/node_modules/ubidots-nodered/ubidots/ubidots_in.js:110:25)
    at MqttClient.emit (events.js:315:20)
    at MqttClient._handlePublish (/home/pi/.node-red/node_modules/mqtt/lib/client.js:792:12)
    at MqttClient._handlePacket (/home/pi/.node-red/node_modules/mqtt/lib/client.js:282:12)
    at process (/home/pi/.node-red/node_modules/mqtt/lib/client.js:238:12)
    at MqttClient._handlePacket (/home/pi/.node-red/node_modules/mqtt/lib/client.js:290:7)
    at process (/home/pi/.node-red/node_modules/mqtt/lib/client.js:238:12)
nodered.service: Main process exited, code=exited, status=1/FAILURE
nodered.service: Failed with result 'exit-code'.
nodered.service: Service RestartSec=20s expired, scheduling restart.
nodered.service: Scheduled restart job, restart counter is at 4.
Stopped Node-RED graphical event wiring tool.
Started Node-RED graphical event wiring tool.

```

---

<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:** [18 June 2021 19:28 UTC](https://discourse.nodered.org/t/node-red-crashing-upon-opening/47346/5 "2021-06-18T19:28:55Z")

</div>

Apparently there is a bug in the ubidots node that crashes node red when it gets invalid data.

---

<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:** [18 June 2021 19:37 UTC](https://discourse.nodered.org/t/node-red-crashing-upon-opening/47346/6 "2021-06-18T19:37:38Z")

</div>

To run node red in safe mode, which runs the editor but does not start the flows, use `node-red --safe`

---

<div class="post-metadata">

**Author:** ![psalibe](https://avatars.discourse-cdn.com/v4/letter/p/e9c0ed/32.png) [@psalibe](https://discourse.nodered.org/u/psalibe)\
**Post date:** [18 June 2021 19:42 UTC](https://discourse.nodered.org/t/node-red-crashing-upon-opening/47346/7 "2021-06-18T19:42:26Z")

</div>

I ran in safe mode and disabled some nodes one by one. Started with the node-red-contrib-opcua nodes because they have historically given us a problem but no change. The Ubidots Out node (which publishes to Ubidots) is fine, but the Ubidots In node (which pulls data from Ubidots) causes node-red to crash immediately. I have reached out to them about this. Thanks for your help guys.

---

<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:** [2 July 2021 19:43 UTC](https://discourse.nodered.org/t/node-red-crashing-upon-opening/47346/8 "2021-07-02T19:43:09Z")

</div>

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