hjdhjd / homebridge-unifi-protect

:video_camera: Complete HomeKit integration for all UniFi Protect device types with full support for most features including HomeKit Secure Video, and more. https://homebridge.io
Other
1.45k stars 93 forks source link

after updating to latest version: TypeError: Cannot read properties of undefined (reading 'id') #1092

Closed MilkyWayne92 closed 3 months ago

MilkyWayne92 commented 3 months ago

Homebridge UniFi Protect Version

v7.1.2

Homebridge Platform and OS

Raspbian

Homebridge Version

v1.8.2

Node Version

v18.19.0

UniFi OS Version

v3.2.12

UniFi Protect Controller Version

v4.0.33

Describe the problem

After updating my Homebridge Protect plugin, homebridge always throws the following errors and leads to shutdown of homebridge

Homebridge HBUP JSON configuration

{
    "name": "UniFi Protect",
    "platform": "UniFi Protect",
    "controllers": [
        {
            "address": "XXX.XXX.XX.XX",
            "username": "XXXXXX",
            "password": "XXXXXX"
        }
    ]
}

Relevant log output

[6/19/2024, 7:40:54 PM] TypeError: Cannot read properties of undefined (reading 'id')
    at new ProtectTimeshiftBuffer (file:///homebridge/node_modules/homebridge-unifi-protect/src/protect-timeshift.ts:42:96)
    at new ProtectRecordingDelegate (file:///homebridge/node_modules/homebridge-unifi-protect/src/protect-record.ts:58:22)
    at new ProtectStreamingDelegate (file:///homebridge/node_modules/homebridge-unifi-protect/src/protect-stream.ts:91:19)
    at ProtectCameraPackage.configureDevice (file:///homebridge/node_modules/homebridge-unifi-protect/src/devices/protect-camera-package.ts:110:19)
    at new ProtectCamera (file:///homebridge/node_modules/homebridge-unifi-protect/src/devices/protect-camera.ts:59:15)
    at new ProtectCameraPackage (file:///homebridge/node_modules/homebridge-unifi-protect/src/devices/protect-camera-package.ts:10:7)
    at ProtectDoorbell.configurePackageCamera (file:///homebridge/node_modules/homebridge-unifi-protect/src/devices/protect-doorbell.ts:209:26)
    at ProtectDoorbell.configureDevice (file:///homebridge/node_modules/homebridge-unifi-protect/src/devices/protect-doorbell.ts:73:10)
    at processTicksAndRejections (node:internal/process/task_queues:95:5)
[6/19/2024, 7:40:54 PM] Got SIGTERM, shutting down Homebridge...

Acknowledgment that you are only running UniFi OS and UniFi Protect releases from the Ubiquiti Official release channel

hjdhjd commented 3 months ago

Thanks for the report. Can you give me a sense of what cameras you have in your environment?

MilkyWayne92 commented 3 months ago

sure, currently it's two g4 instant and (the following currently offline but still within protect) g4 doorbell poe + chime

MilkyWayne92 commented 3 months ago

update: took your message as kind of a hint and deleted the currently offline g4 doorbell poe as well as the chime and activated the plugin again. seems to be working again ;)

hjdhjd commented 3 months ago

Thanks for confirming. And yep…but it’s definitely something I need to address in HBUP, and will in the next release. Looks like an edge case they shifted in Protect v4. Thanks for reporting!

github-actions[bot] commented 3 months ago

This issue is locked to prevent necroposting on closed issues. Please create a new issue for related support requests, bug reports, or feature suggestions.