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.39k stars 84 forks source link

Errors after upgrade from 6.22.0 to 7.0.1 #1088

Closed mcomer-captech closed 3 weeks ago

mcomer-captech commented 3 weeks ago

Homebridge UniFi Protect Version

7.0.1

Homebridge Platform and OS

ProxMox 8, Alpine container (from https://helper-scripts.com/scripts?id=Homebridge)

Homebridge Version

1.8.2

Node Version

v20.12.2

UniFi OS Version

3.2.12

UniFi Protect Controller Version

3.0.26

Describe the problem

I receive a new error on startup after upgrade to 7.0.1 and the plugin ends up in a restart loop:

[6/9/2024, 2:46:44 PM] [UniFi Protect] UNVR [UNVR4]: Syncing Protect device names to HomeKit. TypeError: Cannot read properties of undefined (reading 'replace') at formatEntry (file:///var/lib/homebridge/node_modules/homebridge-unifi-protect/src/devices/protect-camera.ts:1032:4) at ProtectCamera.findRtspEntry (file:///var/lib/homebridge/node_modules/homebridge-unifi-protect/src/devices/protect-camera.ts:1052:8) at ProtectCamera.findRtsp (file:///var/lib/homebridge/node_modules/homebridge-unifi-protect/src/devices/protect-camera.ts:1085:12) at ProtectCamera.configureVideoStream (file:///var/lib/homebridge/node_modules/homebridge-unifi-protect/src/devices/protect-camera.ts:660:18) at processTicksAndRejections (node:internal/process/task_queues:95:5) at ProtectCamera.configureDevice (file:///var/lib/homebridge/node_modules/homebridge-unifi-protect/src/devices/protect-camera.ts:160:5)

Reverting to 6.22.0 fixes the problem.

Homebridge HBUP JSON configuration

{
    "controllers": [
        {
            "address": "XXXX",
            "password": "XXXX",
            "username": "XXXX"
        }
    ],
    "name": "UniFi Protect",
    "options": [
        "Enable.Device.SyncName.F492BF87F1BE",
        "Enable.Video.Transcode.Hardware.F492BF87F1BE",
        "Enable.Video.DynamicBitrate.F492BF87F1BE",
        "Enable.Video.Transcode.Hardware",
        "Enable.Video.DynamicBitrate",
        "Enable.Device.StatusLed.E43883483694",
        "Enable.Log.HKSV"
    ],
    "verboseFfmpeg": false,
    "_bridge": {
        "username": "0E:53:EB:79:EE:34",
        "port": 42142
    },
    "platform": "UniFi Protect"
}

Relevant log output

[6/9/2024, 2:46:44 PM] [UniFi Protect] UNVR [UNVR4]: Syncing Protect device names to HomeKit.
TypeError: Cannot read properties of undefined (reading 'replace')
    at formatEntry (file:///var/lib/homebridge/node_modules/homebridge-unifi-protect/src/devices/protect-camera.ts:1032:4)
    at ProtectCamera.findRtspEntry (file:///var/lib/homebridge/node_modules/homebridge-unifi-protect/src/devices/protect-camera.ts:1052:8)
    at ProtectCamera.findRtsp (file:///var/lib/homebridge/node_modules/homebridge-unifi-protect/src/devices/protect-camera.ts:1085:12)
    at ProtectCamera.configureVideoStream (file:///var/lib/homebridge/node_modules/homebridge-unifi-protect/src/devices/protect-camera.ts:660:18)
    at processTicksAndRejections (node:internal/process/task_queues:95:5)
    at ProtectCamera.configureDevice (file:///var/lib/homebridge/node_modules/homebridge-unifi-protect/src/devices/protect-camera.ts:160:5)

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

mcomer-captech commented 3 weeks ago

And of course, happy to help with debugging or to provide additional information!

hjdhjd commented 3 weeks ago

Please try v7.0.4. Thanks for the report.

mcomer-captech commented 3 weeks ago

I am seeing a similar but slightly different error with 7.0.4

TypeError: Cannot read properties of undefined (reading 'replace') at ProtectCamera.configureVideoStream (file:///var/lib/homebridge/node_modules/homebridge-unifi-protect/src/devices/protect-camera.ts:616:32) at processTicksAndRejections (node:internal/process/task_queues:95:5) at ProtectCamera.configureDevice (file:///var/lib/homebridge/node_modules/homebridge-unifi-protect/src/devices/protect-camera.ts:159:5)

Thanks for the great tool and for the support as well!

hjdhjd commented 3 weeks ago

Thanks! Always appreciate the support.

What cameras do you have exactly? I'm curious. You're also on what is now an "old" Protect controller version.

I suspect that's the core issue here...though I should handle things more gracefully. Protect 4 came out a week or two ago...hence the major version bump for HBUP from 6 to 7, as I begin to incorporate some of the newer capabilities.

hjdhjd commented 3 weeks ago

v7.0.5 should address the issue. Give it a go.

mcomer-captech commented 3 weeks ago

v7.0.5 does indeed seem to work just fine, thank you!

Protect 4 came out a week or two ago... Yes, I've been a little skittish about taking Protect upgrades too aggressively, specifically because I don't want to break HBUP. I may go ahead and upgrade shortly though since it seems like you are pretty much on board with it.

Thanks again!

hjdhjd commented 3 weeks ago

Protect 4 is mostly a solid update. There's some new stuff in there, but rest assured, HBUP works well with it. Apologies for the regression and appreciate the report. Glad you're up and running again.

github-actions[bot] commented 3 weeks 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.