# Harmony websocket crashing node-red

**URL:** <https://discourse.nodered.org/t/harmony-websocket-crashing-node-red/97691>\
**Category:** General\
**Created:** [19 June 2025 05:04 UTC](https://discourse.nodered.org/t/harmony-websocket-crashing-node-red/97691 "2025-06-19T05:04:32Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![mark31](https://avatars.discourse-cdn.com/v4/letter/m/eb8c5e/32.png) [@mark31](https://discourse.nodered.org/u/mark31)\
**Post date:** [19 June 2025 05:04 UTC](https://discourse.nodered.org/t/harmony-websocket-crashing-node-red/97691/1 "2025-06-19T05:04:32Z")

</div>

Been using "node-red-contrib-harmony-websocket" for years. Today it caused node-red crash while in use. When I tried to restart node-red this error in the log...

$ Start Node-RED

Once Node-RED has started, point a browser at [http://192.168.1.4:1880](http://192.168.1.4:1880)  
On Pi Node-RED works better with the Firefox or Chrome browser

Use node-red-stop to stop Node-RED  
Use node-red-start to start Node-RED again  
Use node-red-log to view the recent log output  
Use sudo systemctl enable nodered.service to autostart Node-RED at every boot  
Use sudo systemctl disable nodered.service to disable autostart on boot

To find more nodes and example flows - go to [http://flows.nodered.org](http://flows.nodered.org)

# Starting as a systemd service. nodered.service: Referenced but unset environment variable evaluates to an empty string: NODE\_RED\_OPTIONS 18 Jun 23:41:32 - [info] Welcome to Node-RED

18 Jun 23:41:32 - [info] Node-RED version: v4.0.9  
18 Jun 23:41:32 - [info] Node.js version: v20.19.2  
18 Jun 23:41:32 - [info] Linux 6.8.0-60-generic x64 LE  
18 Jun 23:41:32 - [info] Loading palette nodes  
18 Jun 23:41:33 - [info] node-red-contrib-shelly version: v11.6.1  
18 Jun 23:41:33 - [info] Dashboard version 3.6.5 started at /ui  
18 Jun 23:41:33 - [warn] rpi-gpio : Raspberry Pi specific node set inactive  
18 Jun 23:41:34 - [info] Settings file : /home/mark/.node-red/settings.js  
18 Jun 23:41:34 - [info] Context store : 'default' [module=memory]  
18 Jun 23:41:34 - [info] User directory : /home/mark/.node-red  
18 Jun 23:41:34 - [warn] Projects disabled : editorTheme.projects.enabled=false  
18 Jun 23:41:34 - [info] Flows file : /home/mark/.node-red/flows.json  
18 Jun 23:41:34 - [info] Server now running at [http://127.0.0.1:1880/](http://127.0.0.1:1880/)  
18 Jun 23:41:34 - [warn] Using unencrypted credentials  
18 Jun 23:41:34 - [info] Starting flows  
18 Jun 23:41:34 - [error] [e-mail:xxxxxxxxxx@vtext.com] No e-mail userid set  
18 Jun 23:41:34 - [info] Started flows  
Shelly gen2 server is listening on port 10001  
18 Jun 23:41:34 - [info] [mqtt-broker:MQTT] Connected to broker: mqtt://192.168.1.4:1883  
18 Jun 23:41:34 - [red] Uncaught Exception:  
18 Jun 23:41:34 - [error] TypeError: Cannot read properties of null (reading 'open') at Harmony.sendCommand (/home/mark/.node-red/node\_modules/harmony-websocket/lib/harmony-websocket.js:411:29)  
at /home/mark/.node-red/node\_modules/bad-node-red-contrib-harmony-websocket/lib/hub.js:258:46  
at processTicksAndRejections (node:internal/process/task\_queues:95:5)  
at runNextTicks (node:internal/process/task\_queues:64:3)  
at processImmediate (node:internal/timers:454:9)  
nodered.service: Main process exited, code=exited, status=1/FAILURE  
nodered.service: Failed with result 'exit-code'.  
nodered.service: Consumed 3.899s CPU time.

No idea why this is happening now,,,,,

At this point I need some advice how to get back into node-red to understand why Harmony node is causing the crash...  
The Harmony hub is working fine I can access the it via Logitech app on my phone....

---

<div class="post-metadata">

**Author:** ![UnborN](https://avatars.discourse-cdn.com/v4/letter/u/4491bb/32.png) [@UnborN](https://discourse.nodered.org/u/UnborN)\
**Post date:** [19 June 2025 09:01 UTC](https://discourse.nodered.org/t/harmony-websocket-crashing-node-red/97691/2 "2025-06-19T09:01:38Z")

</div>

Read this from the node's Github issues page .. seems related

> <https://github.com/lopelex/node-red-contrib-harmony/issues/27>
>
> node-red crashed with this error.
> 
> I was able to quickly disable the server no…de from the admin panel when node-red restarted and when i enabled it again it worked.
> There must be a bug somwhere
> 
> \### node-red-log
> \`\`\`\`
> Jun 00:04:21 - \[red\] Uncaught Exception:
> 2 Jun 00:04:21 - \[error\] TypeError: Cannot read properties of null (reading 'open')
> at Harmony.sendCommand (/home/username/.node-red/node\_modules/harmony-websocket/lib/harmony-websocket.js:411:29)
> at /home/username/.node-red/node\_modules/node-red-contrib-harmony-websocket/lib/hub.js:258:46
> at processTicksAndRejections (node:internal/process/task\_queues:95:5)
> at runNextTicks (node:internal/process/task\_queues:64:3)
> at process.processImmediate (node:internal/timers:447:9)
> 
> \`\`\`\`
> 
> 
> \## if unable to get to the admin panel:
> add \*\*"d": true,\*\* on the 'harmonyws-server' node in flows.json
> \`\`\`\`
> "id": "b9d90a4d.371b58",
> "type": "harmonyws-server",
> "d": true,
> "name": "Livingroom HUB",
> "ip": "192.168.1.162",
> "debug": false
> \`\`\`\`

---

<div class="post-metadata">

**Author:** ![jbudd](https://avatars.discourse-cdn.com/v4/letter/j/5f8ce5/32.png) [@jbudd](https://discourse.nodered.org/u/jbudd)\
**Post date:** [19 June 2025 09:32 UTC](https://discourse.nodered.org/t/harmony-websocket-crashing-node-red/97691/3 "2025-06-19T09:32:25Z")

</div>

> [@mark31](#):
>
> At this point I need some advice how to get back into node-red to understand

You can start Node-red in "safe mode" with `node-red --safe`  
Your flows don't run but the editor is available, so hopefully you can investigate or delete any nodes causing a crash.  
A deploy then restarts Node-red normally.

---

<div class="post-metadata">

**Author:** ![mark31](https://avatars.discourse-cdn.com/v4/letter/m/eb8c5e/32.png) [@mark31](https://discourse.nodered.org/u/mark31)\
**Post date:** [19 June 2025 12:03 UTC](https://discourse.nodered.org/t/harmony-websocket-crashing-node-red/97691/4 "2025-06-19T12:03:11Z")

</div>

Thank you that allow me to get back in. Now to understand why harmony nodes causing the crash

---

<div class="post-metadata">

**Author:** ![mark31](https://avatars.discourse-cdn.com/v4/letter/m/eb8c5e/32.png) [@mark31](https://discourse.nodered.org/u/mark31)\
**Post date:** [26 June 2025 20:26 UTC](https://discourse.nodered.org/t/harmony-websocket-crashing-node-red/97691/5 "2025-06-26T20:26:08Z")

</div>

First thanks "node-red --safe" which has help in working this problem. I thought I had correct issue by removing all flows using the "node-red-contrib-harmony-websocket" Then removing/reinstalling "node-red-contrib-harmony-websocket", Then importing the flows and redeploying. Things have been fine for 5 days then again the issues has occurred.

After some days of watching the node-red logs I captured the following.. (see log attached below.) concerning "HarmonyWS" closing and opening, finally closing at HarmonyWS at 14:18:55... Node red then crashed at 14:23:36, that is when I request HarmonyWS to switch the on stereo.

After that the log contains cycling of node-red restarts and crashs. The only fix I have found is again remove flows using HarmonyWS, then remove/reinstall "node-red-contrib-harmony-websocket"...

As before the Harmony Hub is online, and the Harmony app on my phone can access the hub and control all devices.

Again at a point on how to precede in trouble shooting this issue.

mark@OptiPlex9020M:/var/log/mosquitto$ node-red-log

```auto
26 Jun 04:12:31 - [info] Node-RED version: v4.0.9
26 Jun 04:12:31 - [info] Node.js version: v20.19.2
26 Jun 04:12:31 - [info] Linux 6.8.0-60-generic x64 LE
26 Jun 04:12:31 - [info] Loading palette nodes
26 Jun 04:12:33 - [info] node-red-contrib-shelly version: v11.6.1
26 Jun 04:12:34 - [info] Dashboard version 3.6.5 started at /ui
26 Jun 04:12:34 - [info] Settings file : /home/mark/.node-red/settings.js
26 Jun 04:12:34 - [info] Context store : 'default' [module=memory]
26 Jun 04:12:34 - [info] User directory : /home/mark/.node-red
26 Jun 04:12:34 - [warn] Projects disabled : editorTheme.projects.enabled=false
26 Jun 04:12:34 - [info] Flows file : /home/mark/.node-red/flows.json
26 Jun 04:12:34 - [info] Server now running at http://127.0.0.1:1880/
26 Jun 04:12:34 - [warn] Using unencrypted credentials
26 Jun 04:12:35 - [info] Starting flows
26 Jun 04:12:35 - [error] [e-mail:xxxxxxxxxxxx] No e-mail userid set
26 Jun 04:12:35 - [info] Started flows
Shelly gen2 server is listening on port 10001
26 Jun 04:12:35 - [info] [mqtt-broker:MQTT] Connection failed to broker: mqtt://192.168.1.4:1883
26 Jun 04:12:35 - [info] HarmonyWS open (192.168.1.244)
26 Jun 04:12:50 - [info] [mqtt-broker:MQTT] Connected to broker: mqtt://192.168.1.4:1883
26 Jun 02:27:07 - [info] HarmonyWS close (192.168.1.244)
26 Jun 02:27:07 - [info] HarmonyWS open (192.168.1.244)
26 Jun 08:17:49 - [error] [http request:GEt Venstar status] RequestError: connect EHOSTUNREACH 192.168.1.245:80
26 Jun 12:50:15 - [info] HarmonyWS close (192.168.1.244)
26 Jun 12:50:15 - [info] HarmonyWS open (192.168.1.244)
26 Jun 14:15:25 - [info] HarmonyWS close (192.168.1.244)
26 Jun 14:15:25 - [info] HarmonyWS open (192.168.1.244)
26 Jun 14:15:56 - [warn] [shelly-gen2:e938fd258c4f87a6] Error in executeCommand2: /rpc/Shelly.GetStatus --> Error: getaddrinfo ENOTFOUND shellyplus1-b8d61a8a8b48.local
26 Jun 14:18:51 - [warn] [shelly-gen2:d3d9917014d7dbc7] Error in executeCommand2: /rpc/Shelly.GetStatus --> AxiosError: timeout of 5022ms exceeded
26 Jun 14:18:55 - [info] HarmonyWS close (192.168.1.244)
26 Jun 14:23:36 - [red] Uncaught Exception:
26 Jun 14:23:36 - [error] TypeError: Cannot read properties of null (reading 'open')
    at Harmony.sendCommand (/home/mark/.node-red/node_modules/harmony-websocket/lib/harmony-websocket.js:411:29)
    at /home/mark/.node-red/node_modules/node-red-contrib-harmony-websocket/lib/hub.js:258:46
    at processTicksAndRejections (node:internal/process/task_queues:95:5)
    at runNextTicks (node:internal/process/task_queues:64:3)
    at processImmediate (node:internal/timers:454:9)
nodered.service: Main process exited, code=exited, status=1/FAILURE
nodered.service: Failed with result 'exit-code'.

```

---

<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 June 2025 20:41 UTC](https://discourse.nodered.org/t/harmony-websocket-crashing-node-red/97691/6 "2025-06-26T20:41:56Z")

</div>

There is an open issue from 2023: [crashed node-red · Issue #27 · lopelex/node-red-contrib-harmony · GitHub](https://github.com/lopelex/node-red-contrib-harmony/issues/27)

I don't hood much faith in it being fixed any time soon. You could try adding a me too to see if the owner responds?

---

<div class="post-metadata">

**Author:** ![bakman2](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/bakman2/32/6207_2.png) [@bakman2](https://discourse.nodered.org/u/bakman2)\
**Post date:** [27 June 2025 03:45 UTC](https://discourse.nodered.org/t/harmony-websocket-crashing-node-red/97691/7 "2025-06-27T03:45:58Z")

</div>

Looking at the output, it is not just the harmony websocket, but the mqtt broker, 'shelly-gen2', 'GEt Venstar status' all fail, do you have network connectivity ?

---

<div class="post-metadata">

**Author:** ![mark31](https://avatars.discourse-cdn.com/v4/letter/m/eb8c5e/32.png) [@mark31](https://discourse.nodered.org/u/mark31)\
**Post date:** [27 June 2025 12:18 UTC](https://discourse.nodered.org/t/harmony-websocket-crashing-node-red/97691/8 "2025-06-27T12:18:47Z")

</div>

Yes, I know they all show a failure. During my testing I have found that as soon as flows using "HarmonyWS " are removed, these he other failures stopped. I will be watching the logs the next few days to see if these errors reoccur

---

<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:** [25 September 2025 12:18 UTC](https://discourse.nodered.org/t/harmony-websocket-crashing-node-red/97691/9 "2025-09-25T12:18:56Z")

</div>

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