nicoduj / homebridge-harmony

Harmony websocket plugin for homebridge
The Unlicense
215 stars 23 forks source link

[BUG] Socket closed #361

Closed jahnkenneth closed 3 years ago

jahnkenneth commented 3 years ago

I am getting the following errors. Am using Hoobs.

25.3.2021, 01:06:34 [Stuehub] (Stuehub)ERROR (1)- refreshCurrentActivity Error: WebSocket closed with reason: undefined (undefined). - Stack : Error: WebSocket closed with reason: undefined (undefined). at WebSocketAsPromised._handleClose (/home/hoobs/.hoobs/node_modules/websocket-as-promised/src/index.js:353:19) at WebSocket.listener (/home/hoobs/.hoobs/node_modules/websocket-as-promised/src/index.js:311:64) at WebSocket.emit (events.js:315:20) at WebSocket.emitClose (/home/hoobs/.hoobs/node_modules/harmony-websocket/node_modules/ws/lib/websocket.js:198:10) at Receiver.receiverOnFinish (/home/hoobs/.hoobs/node_modules/harmony-websocket/node_modules/ws/lib/websocket.js:815:20) at Receiver.emit (events.js:315:20) at finish (internal/streams/writable.js:657:10) at processTicksAndRejections (internal/process/task_queues.js:80:21) 25.3.2021, 01:06:34 [Stuehub] (Stuehub)WARNING - socket closed 25.3.2021, 01:06:54 [Stuehub] (Stuehub)ERROR (2)- refreshCurrentActivity TimeoutError: Can't open WebSocket within allowed timeout: 10000 ms. - Stack : TimeoutError: Can't open WebSocket within allowed timeout: 10000 ms. at PromiseController._handleTimeout (/home/hoobs/.hoobs/node_modules/promise-controller/src/index.js:172:19) at Timeout. (/home/hoobs/.hoobs/node_modules/promise-controller/src/index.js:178:43) at listOnTimeout (internal/timers.js:554:17) at processTimers (internal/timers.js:497:7)

Config Your config section of platform. Please do not post your whole config and especially with logins / passwords !

Additional context

jahnkenneth commented 3 years ago

25.3.2021, 13:42:05 [Stuehub] (Stuehub)ERROR (3)- refreshCurrentActivity TimeoutError: Can't open WebSocket within allowed timeout: 10000 ms. - Stack : TimeoutError: Can't open WebSocket within allowed timeout: 10000 ms. at PromiseController._handleTimeout (/home/hoobs/.hoobs/node_modules/promise-controller/src/index.js:172:19) at Timeout. (/home/hoobs/.hoobs/node_modules/promise-controller/src/index.js:178:43) at listOnTimeout (internal/timers.js:554:17) at processTimers (internal/timers.js:497:7) 25.3.2021, 13:42:14 Error: connect EHOSTUNREACH 192.168.68.113:8088 at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1146:16) 25.3.2021, 13:42:14 Got SIGTERM, shutting down Bridge... 25.3.2021, 13:42:14 [Stuehub] INFO - shutdown 25.3.2021, 13:42:14 [Stuehub] INFO - shutdown

SvenKempf commented 3 years ago

I can confirm to have the very same issue. I was using it with hoobs version 3.3.5 I meanwhile had to remove the module entirely because it caused my hoobs to completely crash at least once a day :-(

nicoduj commented 3 years ago

Hi, Did you check with Hoobs support ? I have no such issue reported on regular homebridge, might be some problem with websockrets / hoobs itself. no error on the plugin side from the error stack I see.

SvenKempf commented 3 years ago

I did not yet contact hoobs support because so far to me it looked obvious that the issue was caused by harmony plugin. What brings me to this is this log entry: Mar 27 08:19:49 hoobs hoobs[12903]: [HarmonyHub] (HarmonyHub)ERROR (2)- refreshC urrentActivity TimeoutError: Can't open WebSocket within allowed timeout: 600 ms . - Stack : TimeoutError: Can't open WebSocket within allowed timeout: 600 ms. Mar 27 08:19:49 hoobs hoobs[12903]: at PromiseController._handleTimeout (/ho me/hoobs/.hoobs/node_modules/promise-controller/src/index.js:172:19) Mar 27 08:19:49 hoobs hoobs[12903]: at Timeout.<anonymous> (/home/hoobs/.hoo bs/node_modules/promise-controller/src/index.js:178:43) Mar 27 08:19:49 hoobs hoobs[12903]: at listOnTimeout (internal/timers.js:531 :17) Mar 27 08:19:49 hoobs hoobs[12903]: at processTimers (internal/timers.js:475 :7) Mar 27 08:21:28 hoobs hoobs[12903]: Error: connect ETIMEDOUT 192.168.178.59:8088 Mar 27 08:21:28 hoobs hoobs[12903]: at TCPConnectWrap.afterConnect [as oncom plete] (net.js:1134:16) Mar 27 08:21:28 hoobs hoobs[12903]: Error: connect ETIMEDOUT 192.168.178.59:8088 Mar 27 08:21:28 hoobs hoobs[12903]: at TCPConnectWrap.afterConnect [as oncom plete] (net.js:1134:16) Mar 27 08:21:28 hoobs hoobs[12903]: Got SIGTERM, shutting down Bridge... Mar 27 08:21:28 hoobs hoobs[12903]: [HarmonyHub] INFO - shutdown Mar 27 08:21:28 hoobs hoobs[12903]: [HarmonyHub] INFO - shutdown

jahnkenneth commented 3 years ago

I ditched Hoobs and converted to Homebridge. No problems. :-)

nicoduj commented 3 years ago

the plugin can't open a websocket, maybe because ports on the system are blocked or already in use. Can't do anything about that. It is either network related or a conflict with the host.

I have already seen such error on hoobs, but don't really know what thez are doing above homebridge ....

SvenKempf commented 3 years ago

OK - I will open an incident on hoobs as well. If they can't help as well I will have to keep harmony plugin removed

nicoduj commented 3 years ago

Or move to regular homebridge 😀

SvenKempf commented 3 years ago

Not an option. Way to much manually maintenance required. This installation was rock solid for over a year now.

NorbertM21 commented 3 years ago

Same issue here without Hoobs:

Several times a day just "socket closed": [29.3.2021, 21:11:56] [Harmony] (Harmony)WARNING - socket closed

Sometimes with the following messages [29.3.2021, 21:12:06] [Harmony] (Harmony)ERROR (1)- refreshCurrentActivity Error: WebSocket closed with reason: undefined (undefined). - Stack : Error: WebSocket closed with reason: undefined (undefined). at WebSocketAsPromised._handleClose (/usr/local/lib/node_modules/homebridge-harmony/node_modules/websocket-as-promised/src/index.js:353:19) at WebSocket.listener (/usr/local/lib/node_modules/homebridge-harmony/node_modules/websocket-as-promised/src/index.js:311:64) at WebSocket.emit (events.js:315:20) at WebSocket.emitClose (/usr/local/lib/node_modules/homebridge-harmony/node_modules/ws/lib/websocket.js:188:12) at ClientRequest. (/usr/local/lib/node_modules/homebridge-harmony/node_modules/ws/lib/websocket.js:580:15) at ClientRequest.emit (events.js:315:20) at Socket.socketErrorListener (_http_client.js:469:9) at Socket.emit (events.js:315:20) at emitErrorNT (internal/streams/destroy.js:106:8) at emitErrorCloseNT (internal/streams/destroy.js:74:3) [29.3.2021, 21:12:06] [Harmony] (Harmony)WARNING - socket closed

NorbertM21 commented 3 years ago

Looks like solved. Just about three messages "socket close" per day (without Hoobs). Thanks for your support.

nicoduj commented 3 years ago

Looks like solved.

Just about three messages "socket close" per day (without Hoobs).

Thanks for your support.

Thank you for reporting. If you still have socket close, it means your hub becomes unreachable at some point but it can reconnect so that was my main concern.