Random restarts

Hi

Node red randomly restarts and I am not quite sure how to interpret it.
I just started over a week ago and nothing new was added to any flows.

In the log I managed to get the following:

26 Mar 06:43:06 - [red] Uncaught Exception:
26 Mar 06:43:06 - [error] SyntaxError: Unexpected end of JSON input
    at JSON.parse (<anonymous>)
    at WebSocket.message (/home/pi/.node-red/node_modules/node-red-contrib-unifi/unifiws-helper.js:69:40)
    at WebSocket.emit (node:events:517:28)
    at WebSocket.emit (node:domain:489:12)
    at Receiver.receiverOnMessage (/home/pi/.node-red/node_modules/ws/lib/websocket.js:1178:20)
    at Receiver.emit (node:events:517:28)
    at Receiver.emit (node:domain:489:12)
    at Receiver.dataMessage (/home/pi/.node-red/node_modules/ws/lib/receiver.js:528:14)
    at Receiver.getData (/home/pi/.node-red/node_modules/ws/lib/receiver.js:446:17)
    at Receiver.startLoop (/home/pi/.node-red/node_modules/ws/lib/receiver.js:148:22)
    at Receiver._write (/home/pi/.node-red/node_modules/ws/lib/receiver.js:83:10)
    at writeOrBuffer (node:internal/streams/writable:392:12)
    at _write (node:internal/streams/writable:333:10)
    at Receiver.Writable.write (node:internal/streams/writable:337:10)
    at TLSSocket.socketOnData (/home/pi/.node-red/node_modules/ws/lib/websocket.js:1272:35)
    at TLSSocket.emit (node:events:517:28)
    at TLSSocket.emit (node:domain:489:12)
    at addChunk (node:internal/streams/readable:368:12)
    at readableAddChunk (node:internal/streams/readable:341:9)
    at TLSSocket.Readable.push (node:internal/streams/readable:278:10)
    at TLSWrap.onStreamRead (node:internal/stream_base_commons:190:23)
nodered.service: Main process exited, code=exited, status=1/FAILURE
nodered.service: Failed with result 'exit-code'.
nodered.service: Consumed 7min 5.150s CPU time.
nodered.service: Scheduled restart job, restart counter is at 2.
Stopped nodered.service - Node-RED graphical event wiring tool.
nodered.service: Consumed 7min 5.150s CPU time.

This line is telling you node-red has been crashed unexpectedly by "something"

This line tells you which node that is.

It looks like a known bug as it has been reported here: unifiWS stability issue · Issue #128 · Isaksson/node-red-contrib-unifi · GitHub

The author was unaware of it and may think it is an isolated case, you should probably comment on the issue to explain how you also encountered it.

Thanks, @Steve-Mcl
I don't use the unifi nodes as it is right now, so I just disabled it for now.

So the way it is shown, it just shows that the entire node module is at fault, and not a specific part of my programming in the flow where I use the node. Right?
Because that was what I were looking for :slight_smile:

Hello.
I have released a new version that fixes this issue.

1 Like