OpenWonderLabs / homebridge-switchbot

The Homebridge SwitchBot plugin allows you to access your SwitchBot Device(s) from HomeKit. Homebridge.
https://openwonderlabs.github.io/homebridge-switchbot/
ISC License
239 stars 51 forks source link

Bug: Switchbot child bridge keeps crashing #955

Closed Jacksonbm1 closed 6 months ago

Jacksonbm1 commented 6 months ago

Describe the Bug

I am running the plugin and had no issues till a few days ago. After, I tried updating and I got the errors (I didn't check the logs before updating, but it def wasn't working properly).

To Reproduce

Just run the plugin and it will start crashing

here's my config though I redacted all the personal stuff:

Expected Behavior

should work and not crash?

Relevant Log Output

[3/17/2024, 9:45:14 PM] [SwitchBot] Restarting Process...
[3/17/2024, 9:45:15 PM] [SwitchBot] Launched child bridge with PID 15078
[3/17/2024, 9:45:20 PM] Registering platform '@switchbot/homebridge-switchbot.SwitchBot'
[3/17/2024, 9:45:20 PM] [SwitchBot] Loaded @switchbot/homebridge-switchbot v3.4.0 child bridge successfully
[3/17/2024, 9:45:20 PM] Loaded 7 cached accessories from cachedAccessories.0E3225FEF6CB.
Error: listen EADDRINUSE: address already in use :::56266
    at Server.setupListenHandle [as _listen2] (node:net:1817:16)
    at listenInCluster (node:net:1865:12)
    at Server.listen (node:net:1953:7)
    at EventedHTTPServer.listen (/var/lib/homebridge/node_modules/homebridge/node_modules/hap-nodejs/src/lib/util/eventedhttp.ts:164:20)
    at HAPServer.listen (/var/lib/homebridge/node_modules/homebridge/node_modules/hap-nodejs/src/lib/HAPServer.ts:377:21)
    at Bridge.<anonymous> (/var/lib/homebridge/node_modules/homebridge/node_modules/hap-nodejs/src/lib/Accessory.ts:1365:18)
    at step (/var/lib/homebridge/node_modules/homebridge/node_modules/tslib/tslib.js:195:27)
    at Object.next (/var/lib/homebridge/node_modules/homebridge/node_modules/tslib/tslib.js:176:57)
    at /var/lib/homebridge/node_modules/homebridge/node_modules/tslib/tslib.js:169:75
    at new Promise (<anonymous>)
[3/17/2024, 9:45:21 PM] [SwitchBot] Child bridge process ended
[3/17/2024, 9:45:21 PM] [SwitchBot] Process Ended. Code: 1, Signal: null
[3/17/2024, 9:45:28 PM] [SwitchBot] Restarting Process...

Config for homebridge-switchbot

{
            "name": "SwitchBot",
            "credentials": {
                "token": "<REDACTED>",
                "secret": "<REDACTED>",
                "notice": "Keep your Token & Secret a secret!"
            },
            "_bridge": {
                "username": "<REDACTED>",
                "port": <REDACTED>
            },
            "platform": "SwitchBot"
        }

Screenshots

image

Device and Model

Raspberry Pi 4B+

Node.js Version

v18.19.0

NPM Version

10.2.3

Homebridge Version

1.7.0

Homebridge Switchbot Plugin Version

v3.4.0

Homebridge Config UI X Plugin Version

v4.55.1

Operating System

Rasbian

Jacksonbm1 commented 6 months ago

issue seems to have disappeared. No idea why, but will mark as closed for now and monitor