keshavdv / unifi-cam-proxy

Enable non-Ubiquiti cameras to work with Unifi NVR
MIT License
1.68k stars 235 forks source link

Unifi Protect 1.19.0 crashing #68

Closed hamster closed 3 years ago

hamster commented 3 years ago

Cameras worked fine with prior release of Protect, now they instantly crash Protect. Unifi cameras got a firmware update at the same time, I suspect there is some new parameter being reported in the paramAgreement. I'll see if I can get some packet dumps of normal cameras phoning home.

Unifi Protect log snippet

2021-08-18T05:21:44.860Z - info: addConnection, mac: AABBCCDDEEFF 2021-08-18T05:21:44.862Z - verbose: RECEIVED ubnt_avclient_hello FROM Front Porch [AABBCCDDEEFF @ 192.168.10.1]. MESSAGE ID: 1 2021-08-18T05:21:44.863Z - verbose: SENT ubnt_avclient_hello TO Front Porch [AABBCCDDEEFF @ 192.168.10.1]. MESSAGE ID: 10078 2021-08-18T05:21:44.866Z - verbose: RECEIVED ubnt_avclient_hello FROM Front Porch [AABBCCDDEEFF @ 192.168.10.1]. MESSAGE ID: 1 2021-08-18T05:21:44.867Z - verbose: SENT ubnt_avclient_hello TO Front Porch [AABBCCDDEEFF @ 192.168.10.1]. MESSAGE ID: 10079 2021-08-18T05:21:45.384Z - verbose: SENT ubnt_avclient_paramAgreement TO Front Porch [AABBCCDDEEFF @ 192.168.10.1]. MESSAGE ID: 10080 2021-08-18T05:21:45.393Z - verbose: SENT ubnt_avclient_paramAgreement TO Front Porch [AABBCCDDEEFF @ 192.168.10.1]. MESSAGE ID: 10081 2021-08-18T05:21:45.397Z - error: unhandledRejection, shutting down... 2021-08-18T05:21:45.399Z - error: TypeError: Cannot set property 's' of null at set (/usr/share/unifi-protect/app/node_modules/decal/src/utils/set.js:62:21) at updateRecursively (/usr/share/unifi-protect/app/node_modules/decal/src/data/Model.js:436:9) at updateRecursively (/usr/share/unifi-protect/app/node_modules/decal/src/data/Model.js:433:11) at DecalObject.patch (/usr/share/unifi-protect/app/node_modules/decal/src/data/Model.js:439:5) at DecalObject.update (/usr/share/unifi-protect/app/webpack:/src/core/data/models/Model.js:16:17) at I (/usr/share/unifi-protect/app/webpack:/src/middleware/cameras/avclient/index.js:111:12) at 2021-08-18T05:21:45.417Z - info: Stopping MiddlewareService... 2021-08-18T05:21:45.419Z - error: TypeError: Cannot set property 's' of null at set (/usr/share/unifi-protect/app/node_modules/decal/src/utils/set.js:62:21) at updateRecursively (/usr/share/unifi-protect/app/node_modules/decal/src/data/Model.js:436:9) at updateRecursively (/usr/share/unifi-protect/app/node_modules/decal/src/data/Model.js:433:11) at DecalObject.patch (/usr/share/unifi-protect/app/node_modules/decal/src/data/Model.js:439:5) at DecalObject.update (/usr/share/unifi-protect/app/webpack:/src/core/data/models/Model.js:16:17) at I (/usr/share/unifi-protect/app/webpack:/src/middleware/cameras/avclient/index.js:111:12) at at process._tickDomainCallback (internal/process/next_tick.js:229:7)

Log from unifi-cam-proxy (version 0.1.3)

2021-08-17 23:21:44 hal RTSPCam[202095] INFO Adopting with token [] and mac [AABBCCDDEEFF] 2021-08-17 23:21:44 hal RTSPCam[202095] DEBUG Sending: {'from': 'ubnt_avclient', 'functionName': 'ubnt_avclient_hello', 'inResponseTo': 0, 'messageId': 1, 'payload': {'adoptionCode': '', 'connectionHost': '192.168.10.254', 'connectionSecurePort': 7442, 'fwVersion': 'UVC.S2L.v4.23.8.67.0eba6e3.200526.1046', 'hwrev': 19, 'idleTime': 191.96, 'ip': '192.168.1.10', 'mac': 'AABBCCDDEEFF', 'model': 'UVC G3', 'name': 'unifi-cam-proxy', 'protocolVersion': 67, 'rebootTimeoutSec': 30, 'semver': 'v4.4.8', 'totalLoad': 0.5474, 'upgradeTimeoutSec': 150, 'uptime': 0.06348109245300293, 'features': {'mic': True}}, 'responseExpected': False, 'to': 'UniFiVideo'} 2021-08-17 23:21:44 hal RTSPCam[202095] INFO Processing [ubnt_avclient_hello] message 2021-08-17 23:21:44 hal RTSPCam[202095] DEBUG Message contents: {'from': 'UniFiVideo', 'to': 'ubnt_avclient', 'functionName': 'ubnt_avclient_hello', 'messageId': 10078, 'inResponseTo': 1, 'payload': {'protocolVersion': 67, 'controllerName': 'Home', 'controllerUuid': 'f0a345b7-3203-4bce-9d10-88053e004513', 'controllerVersion': '1.19.0', 'overrideUuid': True}} 2021-08-17 23:21:44 hal RTSPCam[202095] INFO Processing [ubnt_avclient_hello] message 2021-08-17 23:21:44 hal RTSPCam[202095] DEBUG Message contents: {'from': 'UniFiVideo', 'to': 'ubnt_avclient', 'functionName': 'ubnt_avclient_hello', 'messageId': 10079, 'inResponseTo': 1, 'payload': {'protocolVersion': 67, 'controllerName': 'Home', 'controllerUuid': 'f0a345b7-3203-4bce-9d10-88053e004513', 'controllerVersion': '1.19.0', 'overrideUuid': True}} 2021-08-17 23:21:45 hal RTSPCam[202095] INFO Processing [ubnt_avclient_paramAgreement] message 2021-08-17 23:21:45 hal RTSPCam[202095] DEBUG Message contents: {'from': 'UniFiVideo', 'to': 'ubnt_avclient', 'responseExpected': True, 'functionName': 'ubnt_avclient_paramAgreement', 'messageId': 10080, 'inResponseTo': 0, 'payload': {'enableStatusCodes': True, 'useHeartbeats': False, 'heartbeatsTimeoutMs': 60000}} 2021-08-17 23:21:45 hal RTSPCam[202095] DEBUG Sending: {'from': 'ubnt_avclient', 'functionName': 'ubnt_avclient_paramAgreement', 'inResponseTo': 10080, 'messageId': 2, 'payload': {'authToken': '', 'features': {'mic': True}}, 'responseExpected': False, 'to': 'UniFiVideo'} 2021-08-17 23:21:45 hal RTSPCam[202095] INFO Processing [ubnt_avclient_paramAgreement] message 2021-08-17 23:21:45 hal RTSPCam[202095] DEBUG Message contents: {'from': 'UniFiVideo', 'to': 'ubnt_avclient', 'responseExpected': True, 'functionName': 'ubnt_avclient_paramAgreement', 'messageId': 10081, 'inResponseTo': 0, 'payload': {'enableStatusCodes': True, 'useHeartbeats': False, 'heartbeatsTimeoutMs': 60000}} 2021-08-17 23:21:45 hal RTSPCam[202095] DEBUG Sending: {'from': 'ubnt_avclient', 'functionName': 'ubnt_avclient_paramAgreement', 'inResponseTo': 10081, 'messageId': 3, 'payload': {'authToken': '', 'features': {'mic': True}}, 'responseExpected': False, 'to': 'UniFiVideo'} 2021-08-17 23:21:45 hal RTSPCam[202095] INFO Cleaning up instance 2021-08-17 23:21:45 hal Core[202095] INFO Backing off connect(...) for 2.0s (True) 2021-08-17 23:21:47 hal Core[202095] INFO Creating ws connection to wss://192.168.10.254:7442/camera/1.0/ws?token=

guido331 commented 3 years ago

My 1.19.0 protect instance also started crashing yesterday as well. UniFi support tried blaming my HDD so I purchased a new one. If I stop my Docker containers running unifi-cam-proxy then protect will run fine.

jkblm commented 3 years ago

Yes I have had problems with the new 1.19.0 crashing the UDMP test unit. The Unifi Protect interface is a bit different. I will need to revert back to 1.18.1 firmware.

Still works great on 1.18.1 on my production UNVR unit!

keshavdv commented 3 years ago

Closing in favor of #60.