Node-red Keeps rebooting itself

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 ?

- /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'.

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

node-red --safe

1 Like

This is a known issue: Crashes on node red v2 · Issue #45 · hobbyquaker/node-red-contrib-lgtv · GitHub

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

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

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

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

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

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

hmmmm.

ok, so looking at your error...

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

Looking at the code on that line ...

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

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

                    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

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

All seems ok so far ... :crossed_fingers:

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

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

1 Like

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