# Node-red Keeps rebooting itself

**URL:** https://discourse.nodered.org/t/node-red-keeps-rebooting-itself/56590
**Category:** Developing Nodes
**Created:** [13 January 2022 13:29 UTC](https://discourse.nodered.org/t/node-red-keeps-rebooting-itself/56590 "2022-01-13T13:29:58Z")
**Posts on this page:** 13
**Page:** 1

<div class="post-metadata">

### Author: ![myozone](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/myozone/32/8904_2.png) [@myozone](https://discourse.nodered.org/u/myozone)
#### Post date: [13 January 2022 13:29 UTC](https://discourse.nodered.org/t/node-red-keeps-rebooting-itself/56590/1 "2022-01-13T13:29:58Z")

</div>

I've just discover my node-red keeps rebooting it self.  
Obviously it's to do with the LG node but how do I deactivate / delete it the node without the gui ?

```auto
- /usr/lib/node_modules/node-red/red.js
13 Jan 13:25:02 - [warn] ------------------------------------------------------
13 Jan 13:25:02 - [info] Settings file : /home/pi/.node-red/settings.js
13 Jan 13:25:02 - [info] Context store : 'default' [module=memory]
13 Jan 13:25:02 - [info] User directory : /home/pi/.node-red
13 Jan 13:25:02 - [warn] Projects disabled : editorTheme.projects.enabled=false
13 Jan 13:25:02 - [info] Flows file : /home/pi/.node-red/flows_raspberrypi.json
13 Jan 13:25:02 - [info] Server now running at http://127.0.0.1:1880/
13 Jan 13:25:02 - [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.
---------------------------------------------------------------------
13 Jan 13:25:03 - [info] Starting flows
13 Jan 13:25:05 - [info] [worldmap:map] started at /worldmap
13 Jan 13:25:07 - [info] Started flows
13 Jan 13:25:07 - [info] [tcp in:39f278c1.9ff568] listening on port 14000
13 Jan 13:25:07 - [info] [tasmota-mqtt-broker:bb555da3.ca6c9] Connected to broker: mqtt://192.168.2.40:1883
13 Jan 13:25:07 - [info] [mqtt-broker:513d0305.98efac] Connected to broker: mqtt://192.168.2.40:1883
13 Jan 13:25:07 - [info] [mqtt-broker:3964efb9.3bd32] Connected to broker: mqtt://192.168.2.60:1883
13 Jan 13:25:08 - [info] [mqtt-broker:CloudMQTT] Connected to broker: mqtts://XXXXXXXXXXXXXXX
13 Jan 13:25:08 - [red] Uncaught Exception:
13 Jan 13:25:08 - TypeError: Cannot read property 'indexOf' of undefined
    at Object.a75ec79c.48ddb8 (/home/pi/.node-red/node_modules/node-red-contrib-lgtv/nodes/lgtv-volume.js:19:59)
    at /home/pi/.node-red/node_modules/node-red-contrib-lgtv/nodes/lgtv-config.js:72:43
    at Array.forEach (<anonymous>)
    at LgtvConfigNode.subscriptionHandler (/home/pi/.node-red/node_modules/node-red-contrib-lgtv/nodes/lgtv-config.js:71:49)
    at Object.7557339c0002 (/home/pi/.node-red/node_modules/node-red-contrib-lgtv/nodes/lgtv-config.js:38:26)
    at WebSocketConnection.<anonymous> (/home/pi/.node-red/node_modules/lgtv2/index.js:149:48)
    at WebSocketConnection.emit (events.js:314:20)
    at WebSocketConnection.processFrame (/home/pi/.node-red/node_modules/websocket/lib/WebSocketConnection.js:554:26)
    at /home/pi/.node-red/node_modules/websocket/lib/WebSocketConnection.js:323:40
    at processTicksAndRejections (internal/process/task_queues.js:79:11)
    at runNextTicks (internal/process/task_queues.js:66:3)
    at processImmediate (internal/timers.js:434:9)
nodered.service: Main process exited, code=exited, status=1/FAILURE
nodered.service: Failed with result 'exit-code'.

```

---

<div class="post-metadata">

### Author: ![ghayne](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/ghayne/32/39_2.png) [@ghayne](https://discourse.nodered.org/u/ghayne)
#### Post date: [13 January 2022 13:36 UTC](https://discourse.nodered.org/t/node-red-keeps-rebooting-itself/56590/2 "2022-01-13T13:36:01Z")

</div>

Start Node red in safe mode, you can then delete the node causing problems:

node-red --safe

---

<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: [13 January 2022 13:41 UTC](https://discourse.nodered.org/t/node-red-keeps-rebooting-itself/56590/3 "2022-01-13T13:41:20Z")

</div>

> [@myozone](#):
>
> `at Object.a75ec79c.48ddb8 (/home/pi/.node-red/node_modules/node-red-contrib-lgtv/nodes/lgtv-volume.js:19:59)`

This is a known issue: [Crashes on node red v2 · Issue #45 · hobbyquaker/node-red-contrib-lgtv · GitHub](https://github.com/hobbyquaker/node-red-contrib-lgtv/issues/45)

As there is no response from the author and the code was last updated over 2.5y ago, i would not hold your breath for a fix.

Alternatively, you can [fix it yourself](https://github.com/hobbyquaker/node-red-contrib-lgtv/issues/36#issuecomment-940575503)

---

<div class="post-metadata">

### Author: ![myozone](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/myozone/32/8904_2.png) [@myozone](https://discourse.nodered.org/u/myozone)
#### Post date: [13 January 2022 13:41 UTC](https://discourse.nodered.org/t/node-red-keeps-rebooting-itself/56590/4 "2022-01-13T13:41:33Z")

</div>

Thank you, That was quick ! I forgot about node-red --safe. It's odd it's been working ok for a week or so.

---

<div class="post-metadata">

### Author: ![myozone](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/myozone/32/8904_2.png) [@myozone](https://discourse.nodered.org/u/myozone)
#### Post date: [13 January 2022 13:44 UTC](https://discourse.nodered.org/t/node-red-keeps-rebooting-itself/56590/5 "2022-01-13T13:44:54Z")

</div>

Thanks Steve, I knew the node was old but assumed it worked ok. I think it's a network issue somewhere getting 'clogged' ?.

---

<div class="post-metadata">

### Author: ![myozone](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/myozone/32/8904_2.png) [@myozone](https://discourse.nodered.org/u/myozone)
#### Post date: [13 January 2022 13:49 UTC](https://discourse.nodered.org/t/node-red-keeps-rebooting-itself/56590/6 "2022-01-13T13:49:39Z")

</div>

It's a shame as I wanted to turn on the TV to a webpage for CCTV activated by a PIR / radar / camera.

---

<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: [13 January 2022 13:59 UTC](https://discourse.nodered.org/t/node-red-keeps-rebooting-itself/56590/7 "2022-01-13T13:59:45Z")

</div>

It is fixable (or so the link I provided says so)

---

<div class="post-metadata">

### Author: ![myozone](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/myozone/32/8904_2.png) [@myozone](https://discourse.nodered.org/u/myozone)
#### Post date: [13 January 2022 14:22 UTC](https://discourse.nodered.org/t/node-red-keeps-rebooting-itself/56590/8 "2022-01-13T14:22:59Z")

</div>

The bit of code to change doesn't exist, nothing even like it.

---

<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: [13 January 2022 14:39 UTC](https://discourse.nodered.org/t/node-red-keeps-rebooting-itself/56590/9 "2022-01-13T14:39:27Z")

</div>

> [@myozone](#):
>
> The bit of code to change doesn't exist

hmmmm.

ok, so looking at your error...

> [@myozone](#):
>
> ```auto
> at Object.a75ec79c.48ddb8 (/home/pi/.node-red/node_modules/node-red-contrib-lgtv/nodes/lgtv-volume.js:19:59)
> 
> ```

... it happens in `lgtv-volume.js` at line 19

This is the code on the repo - [node-red-contrib-lgtv/nodes/lgtv-volume.js at 16583f19ea2aeccaa9a43599da25966a99d2aa79 · hobbyquaker/node-red-contrib-lgtv · GitHub](https://github.com/hobbyquaker/node-red-contrib-lgtv/blob/16583f19ea2aeccaa9a43599da25966a99d2aa79/nodes/lgtv-volume.js#L19)

Looking at the code on that line ...

```auto
                    if (!err && res && res && res.changed.indexOf('volume') !== -1) {
                        node.send({payload: res.volume});
                    }

```

... I suspect the dev meant to write ...

```auto
                    if (!err && res && res.changed && res.changed.indexOf('volume') !== -1) {
                        node.send({payload: res.volume});
                    }

```

Try that in file `/home/pi/.node-red/node_modules/node-red-contrib-lgtv/nodes/lgtv-volume.js` then restart node-red

---

<div class="post-metadata">

### Author: ![myozone](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/myozone/32/8904_2.png) [@myozone](https://discourse.nodered.org/u/myozone)
#### Post date: [13 January 2022 17:19 UTC](https://discourse.nodered.org/t/node-red-keeps-rebooting-itself/56590/10 "2022-01-13T17:19:50Z")

</div>

Thanks Steve, That was a good spot ! I'll give it a go and report back.

All seems ok so far ... 🤞

---

<div class="post-metadata">

### Author: ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)
#### Post date: [14 January 2022 09:02 UTC](https://discourse.nodered.org/t/node-red-keeps-rebooting-itself/56590/11 "2022-01-14T09:02:52Z")

</div>

Please add to the comments on github, giving the correct solution, so others can find it.

---

<div class="post-metadata">

### Author: ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)
#### Post date: [23 January 2022 17:24 UTC](https://discourse.nodered.org/t/node-red-keeps-rebooting-itself/56590/12 "2022-01-23T17:24:54Z")

</div>

I have added the correct fix to the issue on github.

---

<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: [6 February 2022 17:25 UTC](https://discourse.nodered.org/t/node-red-keeps-rebooting-itself/56590/13 "2022-02-06T17:25:41Z")

</div>

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