# Random restarts

**URL:** <https://discourse.nodered.org/t/random-restarts/86752>\
**Category:** General\
**Created:** [26 March 2024 05:52 UTC](https://discourse.nodered.org/t/random-restarts/86752 "2024-03-26T05:52:55Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Kimovitzh](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/kimovitzh/32/67046_2.png) [@Kimovitzh](https://discourse.nodered.org/u/Kimovitzh)\
**Post date:** [26 March 2024 05:52 UTC](https://discourse.nodered.org/t/random-restarts/86752/1 "2024-03-26T05:52:55Z")

</div>

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:

```auto
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.

```

---

<div class="post-metadata">

**Author:** ![Steve-Mcl](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/steve-mcl/32/4826_2.png) [@Steve-Mcl](https://discourse.nodered.org/u/Steve-Mcl)\
**Post date:** [26 March 2024 06:46 UTC](https://discourse.nodered.org/t/random-restarts/86752/2 "2024-03-26T06:46:44Z")

</div>

> [@Kimovitzh](#):
>
> `26 Mar 06:43:06 - [red] Uncaught Exception:`

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

> [@Kimovitzh](#):
>
> `at WebSocket.message (/home/pi/.node-red/node_modules/node-red-contrib-unifi/unifiws-helper.js:69:40)`

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](https://github.com/Isaksson/node-red-contrib-unifi/issues/128)

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.

---

<div class="post-metadata">

**Author:** ![Kimovitzh](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/kimovitzh/32/67046_2.png) [@Kimovitzh](https://discourse.nodered.org/u/Kimovitzh)\
**Post date:** [26 March 2024 07:07 UTC](https://discourse.nodered.org/t/random-restarts/86752/3 "2024-03-26T07:07:38Z")

</div>

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 🙂

---

<div class="post-metadata">

**Author:** ![Isaksson](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/isaksson/32/89744_2.png) [@Isaksson](https://discourse.nodered.org/u/Isaksson)\
**Post date:** [30 March 2024 20:23 UTC](https://discourse.nodered.org/t/random-restarts/86752/4 "2024-03-30T20:23:18Z")

</div>

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

---

<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:** [28 June 2024 20:24 UTC](https://discourse.nodered.org/t/random-restarts/86752/5 "2024-06-28T20:24:13Z")

</div>

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