My Node red has been working fine for quite some time now. But after installing an MQTT broker in NR and trying to do something with it Node Red crashed and I can't get it to start again.
https://flows.nodered.org/node/node-red-contrib-mqtt-broker
When I manually start Node Red in the Terminal I get the messages below. How can I bring my NR back to life?
pi@RENDERFARM-MONITOR:~ $ node-red-start
Start Node-RED
Once Node-RED has started, point a browser at http://192.168.1.179: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.
19 Oct 17:49:43 - [info]
Welcome to Node-RED
===================
19 Oct 17:49:43 - [info] Node-RED version: v2.0.6
19 Oct 17:49:43 - [info] Node.js version: v14.17.6
19 Oct 17:49:43 - [info] Linux 5.10.60-v7+ arm LE
19 Oct 17:49:44 - [info] Loading palette nodes
19 Oct 17:49:48 - [info] Dashboard version 3.0.4 started at /ui
19 Oct 17:49:48 - [info] Settings file : /home/pi/.node-red/settings.js
19 Oct 17:49:48 - [info] Context store : 'default' [module=memory]
19 Oct 17:49:48 - [info] User directory : /home/pi/.node-red
19 Oct 17:49:48 - [warn] Projects disabled : editorTheme.projects.enabled=false
19 Oct 17:49:48 - [info] Flows file : /home/pi/.node-red/flows.json
19 Oct 17:49:49 - [info] Server now running at http://127.0.0.1:1880/
19 Oct 17:49:49 - [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.
---------------------------------------------------------------------
19 Oct 17:49:49 - [info] Starting flows
19 Oct 17:49:49 - [info] [aedes broker:8b97a1b39788fbd5] Start persistence to MongeDB
19 Oct 17:49:49 - [info] [aedes broker:8b97a1b39788fbd5] Publish output wired. Enable broker publish event messages.
19 Oct 17:49:49 - [info] Started flows
19 Oct 17:49:49 - [error] [aedes broker:8b97a1b39788fbd5] Error: Port 1883 is already in use
19 Oct 17:49:49 - [red] Uncaught Exception:
19 Oct 17:49:49 - MongoParseError: Invalid connection string
at parseConnectionString (/home/pi/.node-red/node_modules/mongodb/lib/core/uri_parser.js:585:21)
at connect (/home/pi/.node-red/node_modules/mongodb/lib/operations/connect.js:283:3)
at /home/pi/.node-red/node_modules/mongodb/lib/mongo_client.js:284:5
at maybePromise (/home/pi/.node-red/node_modules/mongodb/lib/utils.js:692:3)
at MongoClient.connect (/home/pi/.node-red/node_modules/mongodb/lib/mongo_client.js:280:10)
at Function.MongoClient.connect (/home/pi/.node-red/node_modules/mongodb/lib/mongo_client.js:426:22)
at MongoPersistence._connect (/home/pi/.node-red/node_modules/aedes-persistence-mongodb/persistence.js:62:23)
at MongoPersistence._setup (/home/pi/.node-red/node_modules/aedes-persistence-mongodb/persistence.js:72:8)
at processImmediate (internal/timers.js:464:21)
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 1.
Stopped Node-RED graphical event wiring tool.
Started Node-RED graphical event wiring tool.
19 Oct 17:50:12 - [info]
Welcome to Node-RED
===================
19 Oct 17:50:12 - [info] Node-RED version: v2.0.6
19 Oct 17:50:12 - [info] Node.js version: v14.17.6
19 Oct 17:50:12 - [info] Linux 5.10.60-v7+ arm LE
19 Oct 17:50:13 - [info] Loading palette nodes
19 Oct 17:50:18 - [info] Dashboard version 3.0.4 started at /ui
19 Oct 17:50:18 - [info] Settings file : /home/pi/.node-red/settings.js
19 Oct 17:50:18 - [info] Context store : 'default' [module=memory]
19 Oct 17:50:18 - [info] User directory : /home/pi/.node-red
19 Oct 17:50:18 - [warn] Projects disabled : editorTheme.projects.enabled=false
19 Oct 17:50:18 - [info] Flows file : /home/pi/.node-red/flows.json
19 Oct 17:50:18 - [info] Server now running at http://127.0.0.1:1880/
19 Oct 17:50:18 - [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.
---------------------------------------------------------------------
19 Oct 17:50:18 - [info] Starting flows
19 Oct 17:50:19 - [info] [aedes broker:8b97a1b39788fbd5] Start persistence to MongeDB
19 Oct 17:50:19 - [info] [aedes broker:8b97a1b39788fbd5] Publish output wired. Enable broker publish event messages.
19 Oct 17:50:19 - [info] Started flows
19 Oct 17:50:19 - [error] [aedes broker:8b97a1b39788fbd5] Error: Port 1883 is already in use
19 Oct 17:50:19 - [red] Uncaught Exception:
19 Oct 17:50:19 - MongoParseError: Invalid connection string
at parseConnectionString (/home/pi/.node-red/node_modules/mongodb/lib/core/uri_parser.js:585:21)
at connect (/home/pi/.node-red/node_modules/mongodb/lib/operations/connect.js:283:3)
at /home/pi/.node-red/node_modules/mongodb/lib/mongo_client.js:284:5
at maybePromise (/home/pi/.node-red/node_modules/mongodb/lib/utils.js:692:3)
at MongoClient.connect (/home/pi/.node-red/node_modules/mongodb/lib/mongo_client.js:280:10)
at Function.MongoClient.connect (/home/pi/.node-red/node_modules/mongodb/lib/mongo_client.js:426:22)
at MongoPersistence._connect (/home/pi/.node-red/node_modules/aedes-persistence-mongodb/persistence.js:62:23)
at MongoPersistence._setup (/home/pi/.node-red/node_modules/aedes-persistence-mongodb/persistence.js:72:8)
at processImmediate (internal/timers.js:464:21)
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 2.
Stopped Node-RED graphical event wiring tool.
Started Node-RED graphical event wiring tool.
19 Oct 17:50:41 - [info]
Welcome to Node-RED
===================
19 Oct 17:50:41 - [info] Node-RED version: v2.0.6
19 Oct 17:50:41 - [info] Node.js version: v14.17.6
19 Oct 17:50:41 - [info] Linux 5.10.60-v7+ arm LE
19 Oct 17:50:43 - [info] Loading palette nodes
19 Oct 17:50:47 - [info] Dashboard version 3.0.4 started at /ui
19 Oct 17:50:47 - [info] Settings file : /home/pi/.node-red/settings.js
19 Oct 17:50:47 - [info] Context store : 'default' [module=memory]
19 Oct 17:50:47 - [info] User directory : /home/pi/.node-red
19 Oct 17:50:47 - [warn] Projects disabled : editorTheme.projects.enabled=false
19 Oct 17:50:47 - [info] Flows file : /home/pi/.node-red/flows.json
19 Oct 17:50:47 - [info] Server now running at http://127.0.0.1:1880/
19 Oct 17:50: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.
---------------------------------------------------------------------
19 Oct 17:50:47 - [info] Starting flows
19 Oct 17:50:48 - [info] [aedes broker:8b97a1b39788fbd5] Start persistence to MongeDB
19 Oct 17:50:48 - [info] [aedes broker:8b97a1b39788fbd5] Publish output wired. Enable broker publish event messages.
19 Oct 17:50:48 - [info] Started flows
19 Oct 17:50:48 - [error] [aedes broker:8b97a1b39788fbd5] Error: Port 1883 is already in use
19 Oct 17:50:48 - [red] Uncaught Exception:
19 Oct 17:50:48 - MongoParseError: Invalid connection string
at parseConnectionString (/home/pi/.node-red/node_modules/mongodb/lib/core/uri_parser.js:585:21)
at connect (/home/pi/.node-red/node_modules/mongodb/lib/operations/connect.js:283:3)
at /home/pi/.node-red/node_modules/mongodb/lib/mongo_client.js:284:5
at maybePromise (/home/pi/.node-red/node_modules/mongodb/lib/utils.js:692:3)
at MongoClient.connect (/home/pi/.node-red/node_modules/mongodb/lib/mongo_client.js:280:10)
at Function.MongoClient.connect (/home/pi/.node-red/node_modules/mongodb/lib/mongo_client.js:426:22)
at MongoPersistence._connect (/home/pi/.node-red/node_modules/aedes-persistence-mongodb/persistence.js:62:23)
at MongoPersistence._setup (/home/pi/.node-red/node_modules/aedes-persistence-mongodb/persistence.js:72:8)
at processImmediate (internal/timers.js:464:21)
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 3.
Stopped Node-RED graphical event wiring tool.
Started Node-RED graphical event wiring tool.
19 Oct 17:51:11 - [info]
Welcome to Node-RED
===================
19 Oct 17:51:11 - [info] Node-RED version: v2.0.6
19 Oct 17:51:11 - [info] Node.js version: v14.17.6
19 Oct 17:51:11 - [info] Linux 5.10.60-v7+ arm LE
^A19 Oct 17:51:12 - [info] Loading palette nodes