ep1cman / unifi-protect-backup

Python tool to backup unifi event clips in realtime
MIT License
576 stars 25 forks source link

Problem since upgrade to Unifi OS 3.2.7 with docker image #118

Closed bionic80 closed 6 months ago

bionic80 commented 7 months ago

Description

2023-12-04 02:05:49 [ DEBUG ] unifi_protect_backup.unifi_protect_backup_core : Config: 2023-12-04 02:05:49 [ DEBUG ] unifi_protect_backup.unifi_protect_backup_core : address='10.1.1.252' 2023-12-04 02:05:49 [ DEBUG ] unifi_protect_backup.unifi_protect_backup_core : port=443 2023-12-04 02:05:49 [ DEBUG ] unifi_protect_backup.unifi_protect_backup_core : username='protectuser' 2023-12-04 02:05:49 [ DEBUG ] unifi_protect_backup.unifi_protect_backup_core : password=REDACTED 2023-12-04 02:05:49 [ DEBUG ] unifi_protect_backup.unifi_protect_backup_core : verify_ssl=False 2023-12-04 02:05:49 [ DEBUG ] unifi_protect_backup.unifi_protect_backup_core : rclone_destination='local:/data' 2023-12-04 02:05:49 [ DEBUG ] unifi_protect_backup.unifi_protect_backup_core : retention=relativedelta(days=+7) 2023-12-04 02:05:49 [ DEBUG ] unifi_protect_backup.unifi_protect_backup_core : rclone_args='' 2023-12-04 02:05:49 [ DEBUG ] unifi_protect_backup.unifi_protect_backup_core : rclone_purge_args='' 2023-12-04 02:05:49 [ DEBUG ] unifi_protect_backup.unifi_protect_backup_core : ignore_cameras=() 2023-12-04 02:05:49 [ DEBUG ] unifi_protect_backup.unifi_protect_backup_core : verbose=1 2023-12-04 02:05:49 [ DEBUG ] unifi_protect_backup.unifi_protect_backup_core : detection_types=['motion', 'person', 'vehicle', 'ring'] 2023-12-04 02:05:49 [ DEBUG ] unifi_protect_backup.unifi_protect_backup_core : file_structure_format='{camera_name}/{event.start:%Y-%m-%d}/{event.start:%Y-%m-%dT%H-%M-%S} {detection_type}.mp4' 2023-12-04 02:05:49 [ DEBUG ] unifi_protect_backup.unifi_protect_backup_core : sqlite_path='/config/database/events.sqlite' 2023-12-04 02:05:49 [ DEBUG ] unifi_protect_backup.unifi_protect_backup_core : download_buffer_size=512.0MiB 2023-12-04 02:05:49 [ DEBUG ] unifi_protect_backup.unifi_protect_backup_core : purge_interval=relativedelta(days=+1) 2023-12-04 02:05:49 [ DEBUG ] unifi_protect_backup.unifi_protect_backup_core : apprise_notifiers=() 2023-12-04 02:05:49 [ DEBUG ] unifi_protect_backup.unifi_protect_backup_core : skip_missing=False 2023-12-04 02:05:49 [ DEBUG ] unifi_protect_backup.unifi_protect_backup_core : download_rate_limit=None events per minute 2023-12-04 02:05:49 [ DEBUG ] unifi_protect_backup.unifi_protect_backup_core : max_event_length=7200s 2023-12-04 02:05:49 [ INFO ] unifi_protect_backup.unifi_protect_backup_core : Starting... 2023-12-04 02:05:49 [ INFO ] unifi_protect_backup.unifi_protect_backup_core : Checking rclone configuration... 2023-12-04 02:05:49 [ DEBUG ] unifi_protect_backup.unifi_protect_backup_core : rclone found: /usr/bin/rclone 2023-12-04 02:05:49 [ INFO ] unifi_protect_backup.unifi_protect_backup_core : Connecting to Unifi Protect... 2023-12-04 02:05:52 [ WARNING ] unifi_protect_backup.unifi_protect_backup_core : Failed to connect to UniFi Protect, retrying in 0s... Traceback (most recent call last): File "/usr/lib/python3.11/site-packages/unifi_protect_backup/unifi_protect_backup_core.py", line 190, in start await self._protect.update() File "/usr/lib/python3.11/site-packages/pyunifiprotect/api.py", line 600, in update self._bootstrap = await self.get_bootstrap() ^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3.11/site-packages/pyunifiprotect/api.py", line 776, in get_bootstrap return Bootstrap.from_unifi_dict(**data, api=self) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3.11/site-packages/pyunifiprotect/data/base.py", line 124, in from_unifi_dict data = cls.unifi_dict_to_dict(data) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3.11/site-packages/pyunifiprotect/data/bootstrap.py", line 202, in unifi_dict_to_dict return super().unifi_dict_to_dict(data) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3.11/site-packages/pyunifiprotect/data/base.py", line 356, in unifi_dict_to_dict data[key] = cls._clean_protect_obj_dict(data[key], unifi_dicts[key], api) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3.11/site-packages/pyunifiprotect/data/base.py", line 302, in _clean_protect_obj_dict items[key] = cls._clean_protect_obj(value, klass, api) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3.11/site-packages/pyunifiprotect/data/base.py", line 286, in _clean_protect_obj return klass.unifi_dict_to_dict(data=data) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3.11/site-packages/pyunifiprotect/data/devices.py", line 910, in unifi_dict_to_dict return super().unifi_dict_to_dict(data) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3.11/site-packages/pyunifiprotect/data/base.py", line 916, in unifi_dict_to_dict return super().unifi_dict_to_dict(data) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3.11/site-packages/pyunifiprotect/data/base.py", line 788, in unifi_dict_to_dict return super().unifi_dict_to_dict(data) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3.11/site-packages/pyunifiprotect/data/base.py", line 339, in unifi_dict_to_dict data[key] = convert_unifi_data(data[key], cls.fields[key]) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3.11/site-packages/pyunifiprotect/utils.py", line 239, in convert_unifidata return type(value) ^^^^^^^^^^^^ File "/usr/lib/python3.11/uuid.py", line 179, in init int = int_(hex, 16) ^^^^^^^^^^^^^ ValueError: invalid literal for int() with base 16: '00000000000000 0 000000000000000'

What I Did

docker stop  goofy_fermi
docker rm goofy_fermi

docker pull docker pull ghcr.io/ep1cman/unifi-protect-backup:0.10.2

docker run  --hostname=ivy --env=UFP_ADDRESS=10.1.1.252 --env=UFP_SSL_VERIFY=false --env=UFP_USERNAME=protectuser --env=UFP_PASSWORD=******************* --volume=/mnt/Merlin/MediaShare/<path>:/data --volume=/mnt/Merlin/MediaShare/<path>/db:/config/database/ --network=host --workdir=/app --restart=always --runtime=runc --detach=true ghcr.io/epcman/unifi-protect-backup:0.10.2

tool was running before unifi cloud key upgrade to RC version. Downgraded back to main channel update did not correct issue.

ep1cman commented 7 months ago

This looks like a bug in pyunifiprotect, please report here: https://github.com/AngellusMortis/pyunifiprotect/ and link back to the issue here. Once fixed upstream I can update the version of pyunifiprotect we use.

ep1cman commented 7 months ago

In fact, it seems its already been reported: https://github.com/AngellusMortis/pyunifiprotect/issues/322

bionic80 commented 7 months ago

awesome, so I can add to the corpus of data and troubleshooting! Do you want me to merge to this one or close yours?

On Mon, Dec 4, 2023 at 5:28 AM Sebastian Goscik @.***> wrote:

In fact, it seems its already been reported: AngellusMortis/pyunifiprotect#322 https://github.com/AngellusMortis/pyunifiprotect/issues/322

— Reply to this email directly, view it on GitHub https://github.com/ep1cman/unifi-protect-backup/issues/118#issuecomment-1838438921, or unsubscribe https://github.com/notifications/unsubscribe-auth/AO46GNPEOQXOCTLT2EC4KODYHWXWPAVCNFSM6AAAAABAFH2KKCVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQMZYGQZTQOJSGE . You are receiving this because you authored the thread.Message ID: @.***>

AngellusMortis commented 7 months ago

Crossposting this comment for more visbility: https://github.com/AngellusMortis/pyunifiprotect/issues/322#issuecomment-1841378565

Not able to reproduce this on my UNVR. I will need someone that has the issue to provide me with their bootstrap (https://{ip}/proxy/protect/api/bootstrap), or at least be able to tell me what field is having the issue (the one that has all of the zeroes).

ep1cman commented 6 months ago

Thanks for the patch @AngellusMortis!

A new version is now pushed that should resolve this