ep1cman / unifi-protect-backup

Python tool to backup unifi event clips in realtime
MIT License
635 stars 31 forks source link

Not finding any cameras #76

Closed morkol-dot closed 1 year ago

morkol-dot commented 1 year ago

The tool runs without any errors in the log. It does, however, not find any cameras. I tried the Docker image as well as the Python script directly. No change. I can rule out network connectivity problems, an instance of Home Assistant on the same machine can connect to Protect without problem. To rule out any issues with two services connecting at the same time, I've stopped HA as well - no change. I upgraded to a different release channel in Unifi a few weeks ago and I think it might have stopped working there, but I am not 100% sure regarding the dates.

This is the log output:

2023-01-20 23:13:42 [   DEBUG   ] unifi_protect_backup.unifi_protect_backup  :  Config:
2023-01-20 23:13:42 [   DEBUG   ] unifi_protect_backup.unifi_protect_backup  :    address='192.168.1.1'
2023-01-20 23:13:42 [   DEBUG   ] unifi_protect_backup.unifi_protect_backup  :    port=443
2023-01-20 23:13:42 [   DEBUG   ] unifi_protect_backup.unifi_protect_backup  :    username='unifi-protect-backup'
2023-01-20 23:13:42 [   DEBUG   ] unifi_protect_backup.unifi_protect_backup  :    password=REDACTED
2023-01-20 23:13:42 [   DEBUG   ] unifi_protect_backup.unifi_protect_backup  :    verify_ssl=False
2023-01-20 23:13:42 [   DEBUG   ] unifi_protect_backup.unifi_protect_backup  :    rclone_destination='unifi-protect-backup:/'
2023-01-20 23:13:42 [   DEBUG   ] unifi_protect_backup.unifi_protect_backup  :    retention='180d'
2023-01-20 23:13:42 [   DEBUG   ] unifi_protect_backup.unifi_protect_backup  :    rclone_args=''
2023-01-20 23:13:42 [   DEBUG   ] unifi_protect_backup.unifi_protect_backup  :    ignore_cameras=()
2023-01-20 23:13:42 [   DEBUG   ] unifi_protect_backup.unifi_protect_backup  :    verbose=1
2023-01-20 23:13:42 [   DEBUG   ] unifi_protect_backup.unifi_protect_backup  :    detection_types=['motion', 'person', 'vehicle', 'ring']
2023-01-20 23:13:42 [   DEBUG   ] unifi_protect_backup.unifi_protect_backup  :    file_structure_format='{camera_name}/{event.start:%Y-%m-%d}/{event.end:%Y-%m-%dT%H-%M-%S} {detection_type}.mp4'
2023-01-20 23:13:42 [   DEBUG   ] unifi_protect_backup.unifi_protect_backup  :    sqlite_path='/config/database/events.sqlite'
2023-01-20 23:13:42 [   DEBUG   ] unifi_protect_backup.unifi_protect_backup  :    download_buffer_size=512.0MiB
2023-01-20 23:13:42 [   DEBUG   ] unifi_protect_backup.unifi_protect_backup  :    purge_interval='1d'
2023-01-20 23:13:42 [   INFO    ] unifi_protect_backup.unifi_protect_backup  :  Starting...
2023-01-20 23:13:42 [   INFO    ] unifi_protect_backup.unifi_protect_backup  :  Checking rclone configuration...
2023-01-20 23:13:42 [   DEBUG   ] unifi_protect_backup.unifi_protect_backup  :  rclone found: /usr/bin/rclone

root@aumkse1p:/data-volume/unify-protect# 2023-01-20 23:13:42 [   INFO    ] unifi_protect_backup.unifi_protect_backup  :  Connecting to Unifi Protect...
2023-01-20 23:13:43 [   INFO    ] unifi_protect_backup.unifi_protect_backup  :  Found cameras:
2023-01-20 23:13:43 [   DEBUG   ] unifi_protect_backup.unifi_protect_backup  :  NVR TZ: Europe/Berlin
2023-01-20 23:13:43 [   DEBUG   ] unifi_protect_backup.unifi_protect_backup  :  Local TZ: UTC
2023-01-20 23:13:43 [   DEBUG   ] unifi_protect_backup.downloader            :  ffprobe found: /usr/bin/ffprobe
2023-01-20 23:13:43 [   INFO    ] unifi_protect_backup.unifi_protect_backup  :  Starting...
2023-01-20 23:13:43 [   INFO    ] unifi_protect_backup.downloader            :  Starting Downloader
2023-01-20 23:13:43 [   INFO    ] unifi_protect_backup.uploader              :  Starting Uploader
2023-01-20 23:13:43 [   DEBUG   ] unifi_protect_backup.event_listener        :  Subscribed to websocket
2023-01-20 23:13:43 [   INFO    ] unifi_protect_backup.missing_event_checker :  Starting Missing Event Checker
2023-01-20 23:13:43 [   DEBUG   ] unifi_protect_backup.missing_event_checker :   Total undownloaded events: 0
2023-01-20 23:13:43 [   DEBUG   ] unifi_protect_backup.missing_event_checker :   Undownloaded events of wanted types: 0

Has anyone else tested the compatibility with Unifi Protect 2.2.6? Is it working for you?

Swallowtail23 commented 1 year ago

I'm running Protect 2.7.18 on UNVR 3.0.13.

No issues with backup running in a docker container.

ep1cman commented 1 year ago

If you open unifi protect and go to the roles tab, select the role of the user you are using for this tool, then check if they are assigned "view" privileges for all the cameras

morkol-dot commented 1 year ago

That's what confused me so much, because I triple-checked the permissions on the cameras and even gave the account more rights. I also changed the password to make sure there is no error. However, your hint pointed me into the right direction: The account had all rights for all cameras, but somehow lost the right to use the Protect app itself:

image

Had to chnage it like this and now it works again. Thanks for helping!