Node-Red Crashing Upon Opening

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.

* 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)
~

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.

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.

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.

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

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

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.