homebridge-eufy-security / plugin

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

[Bug]: Complete plugin crash occurs when signing in with an Eufy account with an Eufy SmartCard #301

Closed jon-iger closed 1 year ago

jon-iger commented 1 year ago

What happened?

Recently I added an Eufy SmartCard tracker to my Eufy account (for finding my wallet), and worth noting that this is compatible with Apple Find My (which is the primary reason I got it anyways). Signed in, set it up in Eufy's app, added to Find My. Then immediately after, the Eufy Security plugin on my HOOBS Box crashed multiple times, restarted itself multiple times, and was unable to start back up. I had to remove the SmartCard accessory from my Eufy account entirely in order to have the plugin come back up and work as expected with no crashes. Going through the log, it looks like there are errors when parsing through the device list and the software not knowing how to handle this Eufy SmartCard accessory. I tried adding it to the "Ignored device list" as well, and cleared the cache of the accessory, but didn't do any good. I can still use the tracker in Find My with no issue which is good at least, but obviously removing such from the Eufy account and experiencing the crash isn't ideal. Only removing the accessory from my Eufy account worked. Would it be possible to add additional error handling so this kind of crash doesn't occur? Log output will be attached below (one note. The final device serial number listed in ignoreDevices is the serial number for the smartCard. Issue still occurred before and after I added the serial number to this list. Only removing the card from my Eufy account works)

Device Type

other (UnSupported)

Plugin Version

v2.0.x (Supported)

HomeBridge Version

v1.4.x (Supported)

NodeJS Version

v16 (Supported)

Operating System

Raspbian 10+ (Supported)

Relevant log output

3/4/2023, 2:17:14 PMEufy Security BridgeWARNINGunhandled rejection: TypeError [ERR_INVALID_ARG_TYPE]: The first argument must be of type string or an instance of Buffer, ArrayBuffer, or Array or an Array-like Object. Received undefined
3/4/2023, 2:17:14 PMEufy Security BridgeERRORTypeError: The first argument must be of type string or an instance of Buffer, ArrayBuffer, or Array or an Array-like Object. Received undefined
    at new NodeError (node:internal/errors:387:5)
    at Function.from (node:buffer:328:9)
    at stringWithLength (/var/lib/hoobs/eufysecuritybridge/node_modules/eufy-security-client/src/p2p/utils.ts:31:35)
    at p2pDidToBuffer (/var/lib/hoobs/eufysecuritybridge/node_modules/eufy-security-client/src/p2p/utils.ts:59:18)
    at buildCheckCamPayload (/var/lib/hoobs/eufysecuritybridge/node_modules/eufy-security-client/src/p2p/utils.ts:111:26)
    at P2PClientProtocol.sendCamCheck (/var/lib/hoobs/eufysecuritybridge/node_modules/eufy-security-client/src/p2p/session.ts:455:45)
    at P2PClientProtocol._connect (/var/lib/hoobs/eufysecuritybridge/node_modules/eufy-security-client/src/p2p/session.ts:406:18)
    at P2PClientProtocol.handleMsg (/var/lib/hoobs/eufysecuritybridge/node_modules/eufy-security-client/src/p2p/session.ts:726:22)
    at Socket.<anonymous> (/var/lib/hoobs/eufysecuritybridge/node_modules/eufy-security-client/src/p2p/session.ts:127:56)
    at Socket.emit (node:events:513:28)
    at UDP.onMessage (node:dgram:930:8)
3/4/2023, 2:17:15 PMEufy Security BridgeERROR/var/lib/hoobs/eufysecuritybridge/node_modules/mediainfo.js/dist/mediainfo.js:40
3/4/2023, 2:17:15 PMEufy Security BridgeERRORTypeError: The first argument must be of type string or an instance of Buffer, ArrayBuffer, or Array or an Array-like Object. Received undefined
3/4/2023, 2:17:15 PMEufy Security BridgeERRORat new NodeError (node:internal/errors:387:5)
3/4/2023, 2:17:15 PMEufy Security BridgeERRORat Function.from (node:buffer:328:9)
3/4/2023, 2:17:15 PMEufy Security BridgeERRORat stringWithLength (/var/lib/hoobs/eufysecuritybridge/node_modules/eufy-security-client/src/p2p/utils.ts:31:35)
3/4/2023, 2:17:15 PMEufy Security BridgeERRORat p2pDidToBuffer (/var/lib/hoobs/eufysecuritybridge/node_modules/eufy-security-client/src/p2p/utils.ts:59:18)
3/4/2023, 2:17:15 PMEufy Security BridgeERRORat buildCheckCamPayload (/var/lib/hoobs/eufysecuritybridge/node_modules/eufy-security-client/src/p2p/utils.ts:111:26)
3/4/2023, 2:17:15 PMEufy Security BridgeERRORat P2PClientProtocol.sendCamCheck (/var/lib/hoobs/eufysecuritybridge/node_modules/eufy-security-client/src/p2p/session.ts:455:45)
3/4/2023, 2:17:15 PMEufy Security BridgeERRORat P2PClientProtocol._connect (/var/lib/hoobs/eufysecuritybridge/node_modules/eufy-security-client/src/p2p/session.ts:406:18)
3/4/2023, 2:17:15 PMEufy Security BridgeERRORat P2PClientProtocol.handleMsg (/var/lib/hoobs/eufysecuritybridge/node_modules/eufy-security-client/src/p2p/session.ts:726:22)
3/4/2023, 2:17:15 PMEufy Security BridgeERRORat Socket.<anonymous> (/var/lib/hoobs/eufysecuritybridge/node_modules/eufy-security-client/src/p2p/session.ts:127:56)
3/4/2023, 2:17:15 PMEufy Security BridgeERRORat Socket.emit (node:events:513:28)
3/4/2023, 2:17:15 PMEufy Security BridgeERRORat UDP.onMessage (node:dgram:930:8) {
3/4/2023, 2:17:15 PMEufy Security BridgeERRORcode: 'ERR_INVALID_ARG_TYPE'
3/4/2023, 2:17:15 PMEufy Security BridgeERROR}
3/4/2023, 2:17:22 PMEufy Security Bridge starting

config

{
    "platform": "EufySecurity",
    "username": "somebody@thisisasomebody.somebody",
    "password": "somebodyspasswordhere",
    "enableCamera": true,
    "enableDetailedLogging": 1,
    "ignoreStations": [
        "T8400P3121311EAA",
        "T8400P312130011C"
    ],
    "ignoreDevices": [
        "T8140P61212415B5",
        "T8140P61212414B5",
        "T8400P3121311EAA",
        "T8400P312130011C",
        "T87B2P002249273D"
    ]
}
github-actions[bot] commented 1 year ago

Did you check this Common Issues pages ?

github-actions[bot] commented 1 year ago

This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 5 days.

github-actions[bot] commented 1 year ago

This issue was closed because it has been stalled for 5 days with no activity.