Node-Red will no longer start with uncaught exception

Log file is below. It looks like it is related to MQTT, however, I have changed nothing with my broker and can connect to it just fine with other clients.

I was, however, messing with Roomba configurations from: node-red-contrib-roomba980-fw2

Whatever has happened has me dead in the water. Using an older backed up flow file that was working fine yesterday doesn't seem to make a difference. Any suggestions?!

29 Dec 15:39:53 - [info]
Welcome to Node-RED
===================
29 Dec 15:39:53 - [info] Node-RED version: v3.0.2
29 Dec 15:39:53 - [info] Node.js  version: v18.9.1
29 Dec 15:39:53 - [info] Linux 5.10.103-v7l+ arm LE
29 Dec 15:39:55 - [info] Loading palette nodes
SmartthingsConfigNode
Creating directory: /home/pi/.node-red/smartthings/context/

29 Dec 15:39:59 - [info] Dashboard version 3.2.3 started at /ui
29 Dec 15:40:00 - [info] Settings file  : /home/pi/.node-red/settings.js
29 Dec 15:40:00 - [info] HTTP Static    : /home/pi/webroot > /
29 Dec 15:40:00 - [info] Context store  : 'memory' [module=memory]
29 Dec 15:40:00 - [info] Context store  : 'file' [module=localfilesystem]
29 Dec 15:40:00 - [info] Context store  : 'LaMetric' [module=localfilesystem]
29 Dec 15:40:00 - [info] User directory : /home/pi/.node-red
29 Dec 15:40:00 - [info] Projects directory: /home/pi/.node-red/projects
29 Dec 15:40:00 - [info] Server now running at http://127.0.0.1:1880/editor/
29 Dec 15:40:00 - [info] Active project : jarvis
29 Dec 15:40:00 - [info] Flows file     : /home/pi/.node-red/projects/jarvis/flow.json
29 Dec 15:40:02 - [info] Starting flows
29 Dec 15:40:02 - [info] [hubitat config:Hubitat B] Starting endpoint for /hubitat/webhook_B
29 Dec 15:40:02 - [info] [hubitat config:Hubitat A] Starting endpoint for /hubitat/webhook_A
29 Dec 15:40:02 - [info] [hubitat config:Hubitat E] Starting endpoint for /hubitat/webhook_E
29 Dec 15:40:02 - [info] [hubitat config:Hubitat C] Starting endpoint for /hubitat/webhook_C
29 Dec 15:40:03 - [info] [hubitat config:Hubitat D] Starting endpoint for /hubitat/webhook_D
Tesla API: No token found. Getting new token now...
Tesla API: doing api call to fetch new access token
29 Dec 15:40:10 - [info] Started flows
29 Dec 15:40:15 - [info] [mqtt-broker:69c5f4ddbab77be2] Connected to broker: jarvis-session01@mqtt://mqtt.theerrors.com:9883
29 Dec 15:40:15 - [info] [alexa-remote-account:Alexa Proxy Auth] intialising "Alexa Proxy Auth" with the PROXY method and saved data...
Tesla API: access token OK
29 Dec 15:40:15 - [info] [hubitat device:Dad's Thermostat Heat Setting] Initialized. heatingSetpoint: 72
29 Dec 15:40:16 - [info] [hubitat device:Ecobee Marys Room Temp] Initialized. temperature: 68
29 Dec 15:40:16 - [info] [hubitat device:Ecobee Marys Room Heat Set] Initialized. heatingSetpoint: 70
29 Dec 15:40:16 - [info] [hubitat device:Dad's Thermostat Heat Setting] Initialized. heatingSetpoint: 72
...
29 Dec 15:40:16 - [info] [hubitat device:Dad Blinds Sensor Closed] Initialized. contact: open
29 Dec 15:40:16 - [info] [hubitat device:Dad Lamps] Initialized. switch: off
29 Dec 15:40:16 - [info] [hubitat device:Garage_A] Initialized. door: closed
29 Dec 15:40:16 - [info] [hubitat device:Garage_B] Initialized. door: closed
29 Dec 15:40:16 - [info] [hubitat device:Garage_C] Initialized. door: closed
29 Dec 15:40:16 - [info] [hubitat device:Garage_D] Initialized. door: closed
29 Dec 15:40:16 - [info] [hubitat device:Piano Room Blinds Sensor Open] Initialized. contact: closed
29 Dec 15:40:16 - [info] [hubitat device:Piano Room Blinds Sensor Closed] Initialized. contact: open
29 Dec 15:40:16 - [info] [hubitat device:Piano Room Lights] Initialized. switch: off
29 Dec 15:40:16 - [info] [hubitat device:Alexa Test Function] Initialized. switch: off
29 Dec 15:40:16 - [info] [hubitat device:Detached Garage Heater] Initialized. switch: off
29 Dec 15:40:16 - [info] [hubitat device:Garage Light] Initialized. switch: off
29 Dec 15:40:16 - [info] [hubitat device:76cf03de.14daac] Initialized. switch: on
29 Dec 15:40:16 - [info] [hubitat device:Barrier] Initialized. switch: on
29 Dec 15:40:16 - [red] Uncaught Exception:
29 Dec 15:40:16 - [error] Error: Connection refused: Identifier rejected
    at MqttClient._handleConnack (/home/pi/.node-red/node_modules/mqtt/lib/client.js:920:15)
    at MqttClient._handlePacket (/home/pi/.node-red/node_modules/mqtt/lib/client.js:350:12)
    at work (/home/pi/.node-red/node_modules/mqtt/lib/client.js:292:12)
    at writable._write (/home/pi/.node-red/node_modules/mqtt/lib/client.js:302:5)
    at doWrite (/home/pi/.node-red/node_modules/readable-stream/lib/_stream_writable.js:428:64)
    at writeOrBuffer (/home/pi/.node-red/node_modules/readable-stream/lib/_stream_writable.js:417:5)
    at Writable.write (/home/pi/.node-red/node_modules/readable-stream/lib/_stream_writable.js:334:11)
    at TLSSocket.ondata (node:internal/streams/readable:766:22)
    at TLSSocket.emit (node:events:513:28)
    at addChunk (node:internal/streams/readable:324:12)
    at readableAddChunk (node:internal/streams/readable:297:9)
    at Readable.push (node:internal/streams/readable:234:10)
    at TLSWrap.onStreamRead (node:internal/stream_base_commons:190:23)
nodered.service: Main process exited, code=exited, status=1/FAILURE
pam_unix(sudo:session): session closed for user root
pam_unix(sudo:session): session closed for user root
nodered.service: Failed with result 'exit-code'.

I tried moving the .node-red/node_modules/node-red-contrib-roomba980-fw2, but now it seems hangs waiting for the missing nodes to register themselves.

What are the next steps to try and get up and running again?

Welcome to Node-RED
===================
29 Dec 16:50:40 - [info] Node-RED version: v3.0.2
29 Dec 16:50:40 - [info] Node.js  version: v18.9.1
29 Dec 16:50:40 - [info] Linux 5.10.103-v7l+ arm LE
29 Dec 16:50:41 - [info] Loading palette nodes
SmartthingsConfigNode
Creating directory: /home/pi/.node-red/smartthings/context/
29 Dec 16:50:46 - [info] Dashboard version 3.2.3 started at /ui
29 Dec 16:50:46 - [warn] Missing node modules:
29 Dec 16:50:46 - [warn]  - node-red-contrib-roomba980-fw2 (0.0.1): dorita980Config, get, set, basic
29 Dec 16:50:46 - [info] Removing modules from config
29 Dec 16:50:46 - [info] Settings file  : /home/pi/.node-red/settings.js
29 Dec 16:50:46 - [info] HTTP Static    : /home/pi/webroot > /
29 Dec 16:50:46 - [info] Context store  : 'memory' [module=memory]
29 Dec 16:50:46 - [info] Context store  : 'file' [module=localfilesystem]
29 Dec 16:50:46 - [info] Context store  : 'LaMetric' [module=localfilesystem]
29 Dec 16:50:46 - [info] User directory : /home/pi/.node-red
29 Dec 16:50:46 - [info] Projects directory: /home/pi/.node-red/projects
29 Dec 16:50:46 - [info] Server now running at http://127.0.0.1:1880/editor/
29 Dec 16:50:47 - [info] Active project : jarvis
29 Dec 16:50:47 - [info] Flows file     : /home/pi/.node-red/projects/jarvis/flow.json
29 Dec 16:50:48 - [info] Waiting for missing types to be registered:
29 Dec 16:50:48 - [info]  - dorita980Config
29 Dec 16:50:48 - [info]  - get
29 Dec 16:50:48 - [info]  - basic

Well, good on you for having a backup.

Sorry, I don't know how good you are with NR and I will try to not be too smart or too dumb.

You are using a RasPi. That's kind of good.
Open a terminal/CLI and:

cd .node-red
node-red-stop

Can you put things back to how they were with the NEWEST flow to be used?

Then from the terminal do:
node-red --safe

Node-red is started but the flow is not ACTIVE.
This may help you find any errors with nodes.

Now you can check if there are any problems with node configs.

Hope that helps.

That was immensely helpful. THANK YOU!

Using the --safe flag I was able to get the editor started as you suggested. I deleted a couple of configuration nodes that I thought might be problematic, and the problem seems to have been solved. Thank you again for the help.

2 Likes

Wow, I do know things.

Glad to help.

3 Likes

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