nicoduj / homebridge-harmony

Harmony websocket plugin for homebridge
The Unlicense
211 stars 22 forks source link

Crash after updating 1.6.2 --> Error: WebSocket closed with reason: undefined (undefined). #420

Closed wendy2702 closed 1 year ago

wendy2702 commented 1 year ago

Describe the bug i have the feeling that after upgrading Homebridge to 1.6.0 and Harmony Plugin to 1.6.2 the error occurs often. To Reproduce

Steps to reproduce the behavior Sometimes Harmony does not react.

Expected behavior Activity should be started

Screenshots If applicable, add screenshots to help explain your problem.

IOS (please complete the following information):

Logs

[29.11.2022, 15:10:45] Homebridge v1.6.0 (HAP v0.11.0) (Homebridge DC14) is running on port 51559.
[29.11.2022, 15:10:47] [Entertainment] (Entertainment)INFO - Discovered Activity : Fernsehen
[29.11.2022, 15:10:47] [Entertainment] (Entertainment)INFO - Discovered Activity : Das Hitradio
[29.11.2022, 15:10:47] [Entertainment] (Entertainment)INFO - Discovered Activity : BluRay-TV
[29.11.2022, 15:10:47] [Entertainment] (Entertainment)INFO - Discovered Activity : Kino
[29.11.2022, 15:10:47] [Entertainment] (Entertainment)INFO - Discovered Activity : Eins Live
[29.11.2022, 15:10:47] [Entertainment] (Entertainment)INFO - Discovered Activity : Apple TV
[29.11.2022, 15:10:47] [Entertainment] (Entertainment)INFO - Discovered Activity : Apple TV-Beamer
[29.11.2022, 15:10:47] [Entertainment] (Entertainment)INFO - Discovered Activity : TV-Beamer
[29.11.2022, 15:10:47] [Entertainment] (Entertainment)INFO - Discovered Activity : Antenne AC
[29.11.2022, 15:10:47] [Entertainment] (Entertainment)INFO - Loading general mute Switch...
[29.11.2022, 15:10:47] [Entertainment] (Entertainment)INFO - Loading general volume Slider...
[29.11.2022, 15:10:51] [Entertainment] INFO - stopping hub discovery, hubs found : undefined
[29.11.2022, 15:10:51] [Entertainment] (undefined)INFO - received discovered hubs  undefined
[29.11.2022, 15:10:51] [Entertainment] (undefined)ERROR - no hub found 
[29.11.2022, 16:40:21] [Entertainment] (Entertainment)ERROR (1)- refreshCurrentActivity Error: WebSocket closed with reason: undefined (undefined). - Stack : Error: WebSocket closed with reason: undefined (undefined).
    at WebSocketAsPromised._handleClose (/usr/lib/node_modules/homebridge-harmony/node_modules/websocket-as-promised/src/index.js:353:19)
    at WebSocket.listener (/usr/lib/node_modules/homebridge-harmony/node_modules/websocket-as-promised/src/index.js:311:64)
    at WebSocket.emit (events.js:400:28)
    at WebSocket.emitClose (/usr/lib/node_modules/homebridge-harmony/node_modules/ws/lib/websocket.js:246:10)
    at Receiver.receiverOnFinish (/usr/lib/node_modules/homebridge-harmony/node_modules/ws/lib/websocket.js:1058:20)
    at Receiver.emit (events.js:400:28)
    at finish (internal/streams/writable.js:657:10)
    at processTicksAndRejections (internal/process/task_queues.js:82:21)
[29.11.2022, 16:40:21] [Entertainment] (Entertainment)WARNING - socket closed
[29.11.2022, 18:46:37] [Entertainment] (Entertainment)WARNING - socket closed
[30.11.2022, 01:10:48] [Homebridge UI] Running job to cleanup config.json backup files older than 60 days...
[30.11.2022, 04:13:43] [Entertainment] (Entertainment)WARNING - socket closed
[30.11.2022, 05:43:38] [Homebridge UI] Running scheduled instance backup...
[30.11.2022, 05:43:38] [Homebridge UI] Creating temporary backup archive at /tmp/homebridge-backup-lenIvh/homebridge-backup-0EB41CA2DDEB.tar.gz
[30.11.2022, 15:22:22] [Entertainment] (Entertainment)WARNING - socket closed
[1.12.2022, 01:05:59] [Entertainment] (Entertainment)WARNING - socket closed
[1.12.2022, 01:10:48] [Homebridge UI] Running job to cleanup config.json backup files older than 60 days...
[1.12.2022, 02:07:16] [Entertainment] (Entertainment)WARNING - socket closed
[1.12.2022, 02:30:54] [Entertainment] (Entertainment)WARNING - socket closed
[1.12.2022, 05:43:38] [Homebridge UI] Running scheduled instance backup...
[1.12.2022, 05:43:38] [Homebridge UI] Creating temporary backup archive at /tmp/homebridge-backup-jtN9ng/homebridge-backup-0EB41CA2DDEB.tar.gz
[1.12.2022, 12:49:56] [Entertainment] (Entertainment)WARNING - socket closed
[1.12.2022, 16:27:43] [Entertainment] (Entertainment)WARNING - socket closed
[1.12.2022, 20:40:35] [Entertainment] (Entertainment)WARNING - socket closed
[2.12.2022, 01:10:48] [Homebridge UI] Running job to cleanup config.json backup files older than 60 days...
[2.12.2022, 02:01:42] [Entertainment] (Entertainment)WARNING - socket closed
[2.12.2022, 03:12:48] [Entertainment] (Entertainment)WARNING - socket closed
[2.12.2022, 05:43:38] [Homebridge UI] Running scheduled instance backup...
[2.12.2022, 05:43:38] [Homebridge UI] Creating temporary backup archive at /tmp/homebridge-backup-yjz58g/homebridge-backup-0EB41CA2DDEB.tar.gz
[3.12.2022, 01:10:48] [Homebridge UI] Running job to cleanup config.json backup files older than 60 days...
[3.12.2022, 05:43:38] [Homebridge UI] Running scheduled instance backup...
[3.12.2022, 05:43:38] [Homebridge UI] Creating temporary backup archive at /tmp/homebridge-backup-w1qWwf/homebridge-backup-0EB41CA2DDEB.tar.gz
[3.12.2022, 18:23:17] [Entertainment] (Entertainment)WARNING - socket closed
[3.12.2022, 19:33:34] [Entertainment] (Entertainment)WARNING - socket closed
[4.12.2022, 01:10:48] [Homebridge UI] Running job to cleanup config.json backup files older than 60 days...
[4.12.2022, 05:43:38] [Homebridge UI] Running scheduled instance backup...
[4.12.2022, 05:43:38] [Homebridge UI] Creating temporary backup archive at /tmp/homebridge-backup-lkfV0d/homebridge-backup-0EB41CA2DDEB.tar.gz
[5.12.2022, 01:10:48] [Homebridge UI] Running job to cleanup config.json backup files older than 60 days...
[5.12.2022, 05:43:38] [Homebridge UI] Running scheduled instance backup...
[5.12.2022, 05:43:38] [Homebridge UI] Creating temporary backup archive at /tmp/homebridge-backup-XDgK0h/homebridge-backup-0EB41CA2DDEB.tar.gz
[5.12.2022, 20:08:37] [Entertainment] (Entertainment)ERROR - activityCommand : Error: WebSocket closed with reason: undefined (undefined).
[5.12.2022, 20:08:37] [Entertainment] (Entertainment)ERROR (1)- refreshCurrentActivity Error: WebSocket closed with reason: undefined (undefined). - Stack : Error: WebSocket closed with reason: undefined (undefined).
    at WebSocketAsPromised._handleClose (/usr/lib/node_modules/homebridge-harmony/node_modules/websocket-as-promised/src/index.js:353:19)
    at WebSocket.listener (/usr/lib/node_modules/homebridge-harmony/node_modules/websocket-as-promised/src/index.js:311:64)
    at WebSocket.emit (events.js:400:28)
    at WebSocket.emitClose (/usr/lib/node_modules/homebridge-harmony/node_modules/ws/lib/websocket.js:246:10)
    at Receiver.receiverOnFinish (/usr/lib/node_modules/homebridge-harmony/node_modules/ws/lib/websocket.js:1058:20)
    at Receiver.emit (events.js:400:28)
    at finish (internal/streams/writable.js:657:10)
    at processTicksAndRejections (internal/process/task_queues.js:82:21)
[5.12.2022, 20:08:37] [Entertainment] (Entertainment)ERROR - activityCommand : Error: WebSocket closed with reason: undefined (undefined).
[5.12.2022, 20:08:37] [Entertainment] (Entertainment)ERROR - activityCommand : Error: WebSocket closed with reason: undefined (undefined).
[5.12.2022, 20:08:37] [Entertainment] (Entertainment)WARNING - socket closed
[5.12.2022, 23:35:36] [Entertainment] (Entertainment)WARNING - socket closed
[6.12.2022, 01:10:48] [Homebridge UI] Running job to cleanup config.json backup files older than 60 days...
[6.12.2022, 04:44:13] [Entertainment] (Entertainment)WARNING - socket closed
[6.12.2022, 05:43:38] [Homebridge UI] Running scheduled instance backup...
[6.12.2022, 05:43:38] [Homebridge UI] Creating temporary backup archive at /tmp/homebridge-backup-1vgaJf/homebridge-backup-0EB41CA2DDEB.tar.gz

Config

{
    "bridge": {
        "name": "Homebridge DC14",
        "username": "0E:B4:1C:A2:DD:EB",
        "port": 51559,
        "pin": "779-14-246"
    },
    "accessories": [],
    "platforms": [
        {
            "name": "Config",
            "port": 8581,
            "platform": "config"
        },
        {
            "name": "Entertainment",
            "hubIP": "192.168.178.40",
            "hubName": "Wohnzimmer",
            "DELAY_BEFORE_RETRY_AFTER_NETWORK_LOSS": 60000,
            "HUB_CONNECT_TIMEOUT": 10000,
            "HUB_SEND_TIMEOUT": 30000,
            "TVAccessory": false,
            "sortInput": 0,
            "mainActivity": "Fernsehen",
            "activitiesToPublishAsInputForTVMode": [
                "Apple-TV"
            ],
            "switchAccessories": true,
            "showTurnOffActivity": "false",
            "publishGeneralMuteSwitch": true,
            "publishGeneralVolumeSlider": true,
            "publishSwitchActivitiesAsIndividualAccessories": true,
            "otherPlatforms": [
                {
                    "sortInput": 0
                }
            ],
            "platform": "HarmonyHubWebSocket"
        }
    ],
    "disabledPlugins": [
        "homebridge-dreambox"
    ]
}

Additional context Homebridge running on Proxmox VM with Debian Bullseye and Node 14.20.0

wendy2702 commented 1 year ago

Did an upgrade of Node from 14.x to 18.x

Maybe Node Version was to old.