homebridge-eufy-security / plugin

Homebridge plugin to control certain Eufy Security devices
Apache License 2.0
166 stars 24 forks source link

[Bug]: child bridge restarting signal 1 error #583

Closed andypburke closed 3 months ago

andypburke commented 3 months ago

What happened?

Restarting child bridge loads but then fails with signal 1 and then restarts constantly

Device Type

Doorbell (Supported)

Plugin Version

v3.0.x (Best Effort)

HomeBridge Version

v1.7.x (Supported)

NodeJS Version

v20 (Supported)

Operating System

Raspbian 10+ (Supported)

Relevant log output

6/19/2024, 1:25:51 PM] [homebridge-eufy-security] Child bridge process ended
[6/19/2024, 1:25:51 PM] [homebridge-eufy-security] Process Ended. Code: 1, Signal: null
[6/19/2024, 1:25:58 PM] [homebridge-eufy-security] Restarting Process...
[6/19/2024, 1:26:00 PM] [homebridge-eufy-security] Launched child bridge with PID 3333
[6/19/2024, 1:26:03 PM] Registering platform 'homebridge-eufy-security.EufySecurity'
[6/19/2024, 1:26:03 PM] [homebridge-eufy-security] Loaded homebridge-eufy-security v3.4.2 child bridge successfully
[6/19/2024, 1:26:03 PM] Loaded 4 cached accessories from cachedAccessories.0E35953ECB1A.
Error: listen EADDRINUSE: address already in use :::59551
    at Server.setupListenHandle [as _listen2] (node:net:1872:16)
    at listenInCluster (node:net:1920:12)
    at Server.listen (node:net:2008: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:1368: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>)
[6/19/2024, 1:26:04 PM] [homebridge-eufy-security] Child bridge process ended
[6/19/2024, 1:26:04 PM] [homebridge-eufy-security] Process Ended. Code: 1, Signal: null
[6/19/2024, 1:26:11 PM] [homebridge-eufy-security] Restarting Process...
[6/19/2024, 1:26:14 PM] [homebridge-eufy-security] Launched child bridge with PID 3353
[6/19/2024, 1:26:17 PM] Registering platform 'homebridge-eufy-security.EufySecurity'
[6/19/2024, 1:26:17 PM] [homebridge-eufy-security] Loaded homebridge-eufy-security v3.4.2 child bridge successfully
[6/19/2024, 1:26:17 PM] Loaded 4 cached accessories from cachedAccessories.0E35953ECB1A.
Error: listen EADDRINUSE: address already in use :::59551
    at Server.setupListenHandle [as _listen2] (node:net:1872:16)
    at listenInCluster (node:net:1920:12)
    at Server.listen (node:net:2008: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:1368: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>)
[6/19/2024, 1:26:18 PM] [homebridge-eufy-security] Child bridge process ended
[6/19/2024, 1:26:18 PM] [homebridge-eufy-security] Process Ended. Code: 1, Signal: null
[6/19/2024, 1:26:25 PM] [homebridge-eufy-security] Restarting Process...
[6/19/2024, 1:26:27 PM] [homebridge-eufy-security] Launched child bridge with PID 3413
[6/19/2024, 1:26:30 PM] Registering platform 'homebridge-eufy-security.EufySecurity'
[6/19/2024, 1:26:31 PM] [homebridge-eufy-security] Loaded homebridge-eufy-security v3.4.2 child bridge successfully
[6/19/2024, 1:26:31 PM] Loaded 4 cached accessories from cachedAccessories.0E35953ECB1A.
Error: listen EADDRINUSE: address already in use :::59551
    at Server.setupListenHandle [as _listen2] (node:net:1872:16)
    at listenInCluster (node:net:1920:12)
    at Server.listen (node:net:2008: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:1368: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>)
[6/19/2024, 1:26:32 PM] [homebridge-eufy-security] Child bridge process ended
[6/19/2024, 1:26:32 PM] [homebridge-eufy-security] Process Ended. Code: 1, Signal: null
[6/19/2024, 1:26:39 PM] [homebridge-eufy-security] Restarting Process...
[6/19/2024, 1:26:41 PM] [homebridge-eufy-security] Launched child bridge with PID 3437
[6/19/2024, 1:26:44 PM] Registering platform 'homebridge-eufy-security.EufySecurity'
[6/19/2024, 1:26:44 PM] [homebridge-eufy-security] Loaded homebridge-eufy-security v3.4.2 child bridge successfully
[6/19/2024, 1:26:44 PM] Loaded 4 cached accessories from cachedAccessories.0E35953ECB1A.
Error: listen EADDRINUSE: address already in use :::59551
    at Server.setupListenHandle [as _listen2] (node:net:1872:16)
    at listenInCluster (node:net:1920:12)
    at Server.listen (node:net:2008: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:1368: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>)
[6/19/2024, 1:26:46 PM] [homebridge-eufy-security] Child bridge process ended
[6/19/2024, 1:26:46 PM] [homebridge-eufy-security] Process Ended. Code: 1, Signal: null
[6/19/2024, 1:26:53 PM] [homebridge-eufy-security] Restarting Process...
[6/19/2024, 1:26:55 PM] [homebridge-eufy-security] Launched child bridge with PID 3456
[6/19/2024, 1:26:58 PM] Registering platform 'homebridge-eufy-security.EufySecurity'
[6/19/2024, 1:26:58 PM] [homebridge-eufy-security] Loaded homebridge-eufy-security v3.4.2 child bridge successfully
[6/19/2024, 1:26:58 PM] Loaded 4 cached accessories from cachedAccessories.0E35953ECB1A.
Error: listen EADDRINUSE: address already in use :::59551
    at Server.setupListenHandle [as _listen2] (node:net:1872:16)
    at listenInCluster (node:net:1920:12)
    at Server.listen (node:net:2008: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:1368: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>)
[6/19/2024, 1:26:59 PM] [homebridge-eufy-security] Child bridge process ended
[6/19/2024, 1:26:59 PM] [homebridge-eufy-security] Process Ended. Code: 1, Signal: null
[6/19/2024, 1:27:06 PM] [homebridge-eufy-security] Restarting Process...
[6/19/2024, 1:27:08 PM] [homebridge-eufy-security] Launched child bridge with PID 3479
[6/19/2024, 1:27:11 PM] Registering platform 'homebridge-eufy-security.EufySecurity'
[6/19/2024, 1:27:11 PM] [homebridge-eufy-security] Loaded homebridge-eufy-security v3.4.2 child bridge successfully
[6/19/2024, 1:27:12 PM] Loaded 4 cached accessories from cachedAccessories.0E35953ECB1A.
Error: listen EADDRINUSE: address already in use :::59551
    at Server.setupListenHandle [as _listen2] (node:net:1872:16)
    at listenInCluster (node:net:1920:12)
    at Server.listen (node:net:2008: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:1368: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>)
[6/19/2024, 1:27:13 PM] [homebridge-eufy-security] Child bridge process ended
[6/19/2024, 1:27:13 PM] [homebridge-eufy-security] Process Ended. Code: 1, Signal: null
[6/19/2024, 1:27:20 PM] [homebridge-eufy-security] Restarting Process...
[6/19/2024, 1:27:22 PM] [homebridge-eufy-security] Launched child bridge with PID 3499
[6/19/2024, 1:27:25 PM] Registering platform 'homebridge-eufy-security.EufySecurity'
[6/19/2024, 1:27:25 PM] [homebridge-eufy-security] Loaded homebridge-eufy-security v3.4.2 child bridge successfully
[6/19/2024, 1:27:25 PM] Loaded 4 cached accessories from cachedAccessories.0E35953ECB1A.
Error: listen EADDRINUSE: address already in use :::59551
    at Server.setupListenHandle [as _listen2] (node:net:1872:16)
    at listenInCluster (node:net:1920:12)
    at Server.listen (node:net:2008: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:1368: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>)
[6/19/2024, 1:27:26 PM] [homebridge-eufy-security] Child bridge process ended
[6/19/2024, 1:27:26 PM] [homebridge-eufy-security] Process Ended. Code: 1, Signal: null
[6/19/2024, 1:27:33 PM] [homebridge-eufy-security] Restarting Process...
[6/19/2024, 1:27:36 PM] [homebridge-eufy-security] Launched child bridge with PID 3567
[6/19/2024, 1:27:39 PM] Registering platform 'homebridge-eufy-security.EufySecurity'
[6/19/2024, 1:27:39 PM] [homebridge-eufy-security] Loaded homebridge-eufy-security v3.4.2 child bridge successfully

config

{
    "bridge": {
        "name": "Homebridge 2C14",
        "username": "0E:AA:41:84:36:2A",
        "port": 51634,
        "pin": "397-53-293",
        "sudo": true
    },
    "accessories": [
        {
            "accessory": "Script2",
            "name": "Apple TV 4K",
            "on": "/var/lib/homebridge/appletv_on.sh",
            "off": "/var/lib/homebridge/appletv_off.sh",
            "state": "/var/lib/homebridge/appletv_state.sh",
            "fileState": "/var/lib/homebridge/script1.flag",
            "on_value": "true"
        },
        {
            "name": "Messenger",
            "services": {
                "ifttt": {
                    "key": "dzCxrUIBLsxyZTQ_sgKCez"
                }
            },
            "messages": [
                {
                    "name": "Garden Gate Open",
                    "type": "ifttt",
                    "event": "garden_gate_open",
                    "value1": "Garden",
                    "value2": "Gate",
                    "value3": "Open",
                    "priority": 0,
                    "sound": "pushover"
                }
            ],
            "accessory": "HomebridgeMessenger"
        }
    ],
    "platforms": [
        {
            "name": "Nest",
            "googleAuth": {
                "issueToken": "https://accounts.google.com/o/oauth2/iframerpc?action=issueToken&response_type=token%20id_token&login_hint=AJDLj6LQu-SMCQLMJfOUep6S7tCefs5nTjzrPuEUy3fu3FRvuEGo7y0lYEOwboyx2QFqXHp6tnOd4Me8LOLUNclN5yKcIemH0w&client_id=733249279899-44tchle2kaa9afr5v9ov7jbuojfr9lrq.apps.googleusercontent.com&origin=https%3A%2F%2Fhome.nest.com&scope=openid%20profile%20email%20https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fnest-account&ss_domain=https%3A%2F%2Fhome.nest.com&include_granted_scopes=true&auto=0",
                "cookies": "__Secure-3PSID=aQjFgVkgpW4f9lA4krehqVufgxzbsuk1VFpgdCREEmm2E9C6bj3cTDjVqI7Fm2wdKO57lA.; __Secure-3PAPISID=3GNlhLengu5_IYEr/AUx9pp3NU2YF2HFuB; NID=511=qL4vvHktlmgumG8TgxB9xtOAhK0ENhEAZ3ZU3TpJfPGJNdOxDEFXjMDvc0yQwVaiWG_Gx-3znXyGcRGSpTnfDA_2rTo4sDhRcenkf7dH01BCI5gR_rtPouKGEyNGQkAK1HpMupoNdtQLMO8sM6hwH3Al7LpVSDcF0gNct9ZM7jgkhvWGKzrU4V8A1a7ocN0FyKW-BARii-odUOdmUi1VrL_G; __Host-3PLSID=s.GB|s.youtube:aQjFget56aBZ8Ae4HOboQu9y-oOx8QWW7T-_y61HgeW0lN-GRXvVN7xPAHcNEWPpGfOLtw.; LSOLH=_SVI_EL3Ku-jJgoEDGAMiP01BRURIZl9xemRwSHo1dXJucndZUmhkck00andxWkF2YWJvQmN1VG5PYy1SOGRkU1VuTFlNVFA5MFM2MHNrUQ_:28222289:f242; __Secure-3PSIDCC=APoG2W8W0AUDBJc2zvBp11CZqkbkxbnbCFbRde8nZWojcW8lcrTJrLB-V6OcDipDot1fBw2Abg"
            },
            "options": [
                "HomeAway.Disable"
            ],
            "hotWaterDurationMinutes": 120,
            "platform": "Nest"
        },
        {
            "name": "Config",
            "port": 8581,
            "platform": "config"
        },
        {
            "name": "SmartThings-v2",
            "app_url": "https://graph-eu01-euwest1.api.smartthings.com/api/smartapps/installations/",
            "app_id": "d8a68a81-0df1-43ac-b819-00ae189cf573",
            "access_token": "c7007305-f379-40ea-b1c6-f0c43a7c6f61",
            "direct_port": 8000,
            "temperature_unit": "C",
            "validateTokenId": false,
            "logConfig": {
                "debug": false,
                "showChanges": true,
                "hideTimestamp": true,
                "hideNamePrefix": true,
                "file": {
                    "enabled": true,
                    "level": "good"
                }
            },
            "platform": "SmartThings-v2"
        },
        {
            "name": "BraviaTVOS",
            "warn": true,
            "error": true,
            "extendedError": true,
            "tvs": [
                {
                    "active": true,
                    "name": "Extension TV",
                    "ip": "192.168.86.52",
                    "port": 80,
                    "manufacturer": "Sony",
                    "model": "Bravia",
                    "serialNumber": "00000000",
                    "wol": false,
                    "refreshInputs": false,
                    "polling": 10,
                    "sheduledRefresh": 12,
                    "inputs": [],
                    "apps": [],
                    "channels": [],
                    "commands": [],
                    "macros": [],
                    "remote": [],
                    "displayOrder": [
                        "inputs",
                        "apps",
                        "channels",
                        "commands",
                        "macros"
                    ],
                    "speaker": {
                        "active": true,
                        "output": "speaker",
                        "increaseBy": 1,
                        "reduceBy": 1,
                        "accType": "lightbulb"
                    },
                    "appName": "Extension TV"
                }
            ],
            "platform": "BraviaOSPlatform"
        },
        {
            "platform": "EufySecurity",
            "username": "apburke@outlook.com",
            "password": "urndjbGso769pBmQ32L!",
            "ignoreStations": [
                "",
                "T8400P2020360F34",
                "T8400P2021092A22",
                "T8400P322312480C"
            ],
            "ignoreDevices": [
                "",
                "T8400P2020360F34",
                "T8400P2021092A22",
                "T8400P322312480C"
            ],
            "enableCamera": true,
            "pollingIntervalMinutes": 30,
            "hkHome": 1,
            "hkAway": 0,
            "hkNight": 3,
            "hkOff": 63,
            "enableDetailedLogging": false,
            "_bridge": {
                "username": "0E:35:95:3E:CB:1A",
                "port": 59551
            },
            "country": "GB",
            "CameraMaxLivestreamDuration": 60,
            "cleanCache": true,
            "cameras": [
                {
                    "serialNumber": "T8210P0020270232",
                    "enableCamera": true,
                    "enableButton": true,
                    "motionButton": true,
                    "rtsp": false,
                    "unbridge": true,
                    "forcerefreshsnap": false,
                    "useCachedLocalLivestream": true,
                    "videoConfig": {
                        "audio": true
                    },
                    "talkback": false,
                    "talkbackChannels": 1,
                    "hsv": false,
                    "hsvRecordingDuration": 20,
                    "hsvConfig": {},
                    "experimentalRTSP": false,
                    "snapshotHandlingMethod": 1,
                    "immediateRingNotificationWithoutSnapshot": false
                },
                {
                    "serialNumber": "T8124P2122402C87",
                    "rtsp": false,
                    "enableCamera": "true",
                    "unbridge": false,
                    "videoConfig": {
                        "audio": true,
                        "maxWidth": 640,
                        "maxHeight": 480,
                        "maxFPS": 15,
                        "useSeparateProcesses": true
                    },
                    "experimentalRTSP": false,
                    "enableButton": false,
                    "motionButton": false,
                    "snapshotHandlingMethod": 3,
                    "useCachedLocalLivestream": true,
                    "talkback": false
                }
            ],
            "experimentalMode": false,
            "preferLocalConnection": false
        },
        {
            "name": "TplinkSmarthome",
            "addCustomCharacteristics": true,
            "deviceTypes": [
                "plug",
                "bulb"
            ],
            "platform": "TplinkSmarthome"
        }
    ],
    "disabledPlugins": [
        "homebridge-plugin-eufy-security",
        "homebridge-apple-tv-remote",
        "homebridge-alexa",
        "homebridge-skyq-tvremote",
        "homebridge-sky-q-no-logs",
        "homebridge-arlo-v2",
        "homebridge-harmony",
        "homebridge-smartthings",
        "homebridge-nest"
    ]
}
ccanalia82 commented 3 months ago

Your issue is

Error: listen EADDRINUSE: address already in use :::59551 at Server.setupListenHandle [as _listen2] (node:net:1872:16) at listenInCluster (node:net:1920:12) at Server.listen (node:net:2008: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. (/var/lib/homebridge/node_modules/homebridge/node_modules/hap-nodejs/src/lib/Accessory.ts:1368: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 ()

I have fixed it typically by resetting my DHCP leases on my router after I turned off my child bridge. Then restart HB and that usually works. You have an old connection that hasn’t let go while the new connection is trying to connect. Other option is to turn off the child bridge, wait some time, and then turn it back on.

On Jun 19, 2024, at 8:58 AM, andypburke @.***> wrote:

Error: listen EADDRINUSE: address already in use :::59551 at Server.setupListenHandle [as _listen2] (node:net:1872:16) at listenInCluster (node:net:1920:12) at Server.listen (node:net:2008: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. (/var/lib/homebridge/node_modules/homebridge/node_modules/hap-nodejs/src/lib/Accessory.ts:1368: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 ()

andypburke commented 3 months ago

I deleted the child bridge and it seems to have worked. Thanks for your input.