unifi-protect-backup
unifi-protect-backup copied to clipboard
Only half of the videos are actually downloading, the other half are failing to.
- Unifi Protect Backup version: no idea, I don't see any version on the docker's log output. I pull the latest image when deploying.
- Unifi Protect version: 4.0.19
- Python version: Whatever's on the Docker
- Operating System: Whatever's on the Docker, host is Debian based TrueNAS
- Are you using a docker container or native?: Docker
Description
Getting sporadic and random download failures. About 50% hit or miss when downloading videos.
What I Did
I restarted the UNVR and the docker and force pulled a new image.
2024-05-22 06:22:43 [ DEBUG ] unifi_protect_backup.unifi_protect_backup_core : Config:
2024-05-22 06:22:43 [ DEBUG ] unifi_protect_backup.unifi_protect_backup_core : address='unvr.th.cybercloudhub.org'
2024-05-22 06:22:43 [ DEBUG ] unifi_protect_backup.unifi_protect_backup_core : port=443
2024-05-22 06:22:43 [ DEBUG ] unifi_protect_backup.unifi_protect_backup_core : username='unifiprotectbackupagent'
2024-05-22 06:22:43 [ DEBUG ] unifi_protect_backup.unifi_protect_backup_core : password=REDACTED
2024-05-22 06:22:43 [ DEBUG ] unifi_protect_backup.unifi_protect_backup_core : verify_ssl=False
2024-05-22 06:22:43 [ DEBUG ] unifi_protect_backup.unifi_protect_backup_core : rclone_destination='local:/data'
2024-05-22 06:22:43 [ DEBUG ] unifi_protect_backup.unifi_protect_backup_core : retention=relativedelta(months=+2)
2024-05-22 06:22:43 [ DEBUG ] unifi_protect_backup.unifi_protect_backup_core : rclone_args=''
2024-05-22 06:22:43 [ DEBUG ] unifi_protect_backup.unifi_protect_backup_core : rclone_purge_args=''
2024-05-22 06:22:43 [ DEBUG ] unifi_protect_backup.unifi_protect_backup_core : ignore_cameras=()
2024-05-22 06:22:43 [ DEBUG ] unifi_protect_backup.unifi_protect_backup_core : verbose=1
2024-05-22 06:22:43 [ DEBUG ] unifi_protect_backup.unifi_protect_backup_core : detection_types=['motion', 'person', 'vehicle', 'ring']
2024-05-22 06:22:43 [ 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'
2024-05-22 06:22:43 [ DEBUG ] unifi_protect_backup.unifi_protect_backup_core : sqlite_path='/config/database/events.sqlite'
2024-05-22 06:22:43 [ DEBUG ] unifi_protect_backup.unifi_protect_backup_core : download_buffer_size=8.0GiB
2024-05-22 06:22:43 [ DEBUG ] unifi_protect_backup.unifi_protect_backup_core : purge_interval=relativedelta(days=+1)
2024-05-22 06:22:43 [ DEBUG ] unifi_protect_backup.unifi_protect_backup_core : apprise_notifiers=()
2024-05-22 06:22:43 [ DEBUG ] unifi_protect_backup.unifi_protect_backup_core : skip_missing=False
2024-05-22 06:22:43 [ DEBUG ] unifi_protect_backup.unifi_protect_backup_core : download_rate_limit=None events per minute
2024-05-22 06:22:43 [ DEBUG ] unifi_protect_backup.unifi_protect_backup_core : max_event_length=7200s
2024-05-22 06:22:43 [ INFO ] unifi_protect_backup.unifi_protect_backup_core : Starting...
2024-05-22 06:22:43 [ INFO ] unifi_protect_backup.unifi_protect_backup_core : Checking rclone configuration...
2024-05-22 06:22:43 [ DEBUG ] unifi_protect_backup.unifi_protect_backup_core : rclone found: /usr/bin/rclone
2024-05-22 06:22:43 [ INFO ] unifi_protect_backup.unifi_protect_backup_core : Connecting to Unifi Protect...
2024-05-22 06:22:45 [ INFO ] unifi_protect_backup.unifi_protect_backup_core : Found cameras:
2024-05-22 06:22:45 [ INFO ] unifi_protect_backup.unifi_protect_backup_core : - 65ddc07102a16503e70003f7: Interior Camera
2024-05-22 06:22:45 [ INFO ] unifi_protect_backup.unifi_protect_backup_core : - 65ddc07102706503e70003f5: Back Yard Camera
2024-05-22 06:22:45 [ INFO ] unifi_protect_backup.unifi_protect_backup_core : - 65ddc07101fc6503e70003ee: Garage Camera
2024-05-22 06:22:45 [ INFO ] unifi_protect_backup.unifi_protect_backup_core : - 65ddc07102516503e70003f3: Front Door Camera
2024-05-22 06:22:45 [ INFO ] unifi_protect_backup.unifi_protect_backup_core : - 65ddc07102886503e70003f6: Server Room Camera
2024-05-22 06:22:45 [ INFO ] unifi_protect_backup.unifi_protect_backup_core : - 65ddc07102196503e70003ef: Left Yard Camera
2024-05-22 06:22:45 [ INFO ] unifi_protect_backup.unifi_protect_backup_core : - 65ddc071022e6503e70003f0: Right Yard Camera
2024-05-22 06:22:45 [ DEBUG ] unifi_protect_backup.unifi_protect_backup_core : NVR TZ: Asia/Bangkok
2024-05-22 06:22:45 [ DEBUG ] unifi_protect_backup.unifi_protect_backup_core : Local TZ: +07
2024-05-22 06:22:45 [ DEBUG ] unifi_protect_backup.downloader : ffprobe found: /usr/bin/ffprobe
2024-05-22 06:22:45 [ INFO ] unifi_protect_backup.unifi_protect_backup_core : Starting Tasks...
2024-05-22 06:22:45 [ INFO ] unifi_protect_backup.downloader : Starting Downloader
2024-05-22 06:22:45 [ INFO ] unifi_protect_backup.uploader : Starting Uploader
2024-05-22 06:22:45 [ DEBUG ] unifi_protect_backup.event_listener : Subscribed to websocket
2024-05-22 06:22:45 [ INFO ] unifi_protect_backup.missing_event_checker : Starting Missing Event Checker
2024-05-22 06:22:45 [ DEBUG ] unifi_protect_backup.missing_event_checker : Running check for missing events...
2024-05-22 06:22:45 [ WARNING ] unifi_protect_backup.missing_event_checker : Found missing events, adding to backup queue
2024-05-22 06:22:45 [ INFO ] unifi_protect_backup.downloader : [661b4a170261cf03e4101899] Downloading event: 661b4a170261cf03e4101899
2024-05-22 06:22:45 [ DEBUG ] unifi_protect_backup.downloader : [661b4a170261cf03e4101899] Remaining Download Queue: 311
2024-05-22 06:22:45 [ DEBUG ] unifi_protect_backup.downloader : [661b4a170261cf03e4101899] Video Download Buffer: 0.0B/8.0GiB
2024-05-22 06:22:45 [ DEBUG ] unifi_protect_backup.downloader : [661b4a170261cf03e4101899] Camera: Front Door Camera
2024-05-22 06:22:45 [ DEBUG ] unifi_protect_backup.downloader : [661b4a170261cf03e4101899] Type: smartDetectZone (vehicle)
2024-05-22 06:22:45 [ DEBUG ] unifi_protect_backup.downloader : [661b4a170261cf03e4101899] Start: 2024-04-14T10-14-29 (1713064469.226)
2024-05-22 06:22:45 [ DEBUG ] unifi_protect_backup.downloader : [661b4a170261cf03e4101899] End: 2024-04-14T10-14-37 (1713064477.466)
2024-05-22 06:22:45 [ DEBUG ] unifi_protect_backup.downloader : [661b4a170261cf03e4101899] Duration: 8.24s
2024-05-22 06:22:45 [ DEBUG ] unifi_protect_backup.downloader : [661b4a170261cf03e4101899] Downloading video...
2024-05-22 06:22:46 [ DEBUG ] unifi_protect_backup.downloader : [661b4a170261cf03e4101899] Downloaded video size: 8.1MiBs
2024-05-22 06:22:47 [ DEBUG ] unifi_protect_backup.downloader : [661b4a170261cf03e4101899] Downloaded video length: 10.250s(+2.010s)
2024-05-22 06:22:47 [ DEBUG ] unifi_protect_backup.downloader : [661b4a170261cf03e4101899] Added to upload queue
2024-05-22 06:22:47 [ INFO ] unifi_protect_backup.downloader : [661e54c40024cf03e4125898] Downloading event: 661e54c40024cf03e4125898
2024-05-22 06:22:47 [ DEBUG ] unifi_protect_backup.downloader : [661e54c40024cf03e4125898] Remaining Download Queue: 733
2024-05-22 06:22:47 [ DEBUG ] unifi_protect_backup.downloader : [661e54c40024cf03e4125898] Video Download Buffer: 8.1MiB/8.0GiB
2024-05-22 06:22:47 [ INFO ] unifi_protect_backup.uploader : [661b4a170261cf03e4101899] Uploading event: 661b4a170261cf03e4101899
2024-05-22 06:22:47 [ DEBUG ] unifi_protect_backup.uploader : [661b4a170261cf03e4101899] Remaining Upload Queue: 0 (0.0B)
2024-05-22 06:22:47 [ DEBUG ] unifi_protect_backup.uploader : [661b4a170261cf03e4101899] Destination: local:/data/Front Door Camera/2024-04-14/2024-04-14T10-14-29 smartDetectZone (vehicle).mp4
2024-05-22 06:22:47 [ DEBUG ] unifi_protect_backup.downloader : [661e54c40024cf03e4125898] Camera: Right Yard Camera
2024-05-22 06:22:47 [ DEBUG ] unifi_protect_backup.downloader : [661e54c40024cf03e4125898] Type: smartDetectZone (person)
2024-05-22 06:22:47 [ DEBUG ] unifi_protect_backup.downloader : [661e54c40024cf03e4125898] Start: 2024-04-16T17-36-49 (1713263809.641)
2024-05-22 06:22:47 [ DEBUG ] unifi_protect_backup.downloader : [661e54c40024cf03e4125898] End: 2024-04-16T17-37-06 (1713263826.021)
2024-05-22 06:22:47 [ DEBUG ] unifi_protect_backup.downloader : [661e54c40024cf03e4125898] Duration: 16.38s
2024-05-22 06:22:47 [ DEBUG ] unifi_protect_backup.downloader : [661e54c40024cf03e4125898] Downloading video...
2024-05-22 06:22:47 [ DEBUG ] unifi_protect_backup.uploader : [661b4a170261cf03e4101899] Uploaded
2024-05-22 06:22:48 [ ERROR ] unifi_protect_backup.missing_event_checker : Unexpected exception occurred during missing event check:
Traceback (most recent call last):
File "/usr/lib/python3.11/site-packages/unifi_protect_backup/missing_event_checker.py", line 151, in start
async for event in self._get_missing_events():
File "/usr/lib/python3.11/site-packages/unifi_protect_backup/missing_event_checker.py", line 65, in _get_missing_events
events_chunk = await self._protect.get_events(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3.11/site-packages/pyunifiprotect/api.py", line 935, in get_events
response = await self.get_events_raw(
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3.11/site-packages/pyunifiprotect/api.py", line 894, in get_events_raw
return await self.api_request_list("events", params=params)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3.11/site-packages/pyunifiprotect/api.py", line 400, in api_request_list
data = await self.api_request(
^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3.11/site-packages/pyunifiprotect/api.py", line 358, in api_request
data = await self.api_request_raw(
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3.11/site-packages/pyunifiprotect/api.py", line 333, in api_request_raw
raise NotAuthorized(msg % (url, response.status, reason))
pyunifiprotect.exceptions.NotAuthorized: Request failed: /proxy/protect/api/events - Status: 401 - Reason: {'code': 401, 'message': 'Unauthorized'}
2024-05-22 06:22:48 [ DEBUG ] unifi_protect_backup.downloader : [661e54c40024cf03e4125898] Downloaded video size: 9.1MiBs
2024-05-22 06:22:48 [ DEBUG ] unifi_protect_backup.downloader : [661e54c40024cf03e4125898] Downloaded video length: 18.250s(+1.870s)
2024-05-22 06:22:48 [ DEBUG ] unifi_protect_backup.downloader : [661e54c40024cf03e4125898] Added to upload queue
2024-05-22 06:22:48 [ INFO ] unifi_protect_backup.downloader : [661be0db0064cf03e4108744] Downloading event: 661be0db0064cf03e4108744
2024-05-22 06:22:48 [ DEBUG ] unifi_protect_backup.downloader : [661be0db0064cf03e4108744] Remaining Download Queue: 1231
2024-05-22 06:22:48 [ DEBUG ] unifi_protect_backup.downloader : [661be0db0064cf03e4108744] Video Download Buffer: 9.1MiB/8.0GiB
2024-05-22 06:22:48 [ DEBUG ] unifi_protect_backup.downloader : [661be0db0064cf03e4108744] Camera: Front Door Camera
2024-05-22 06:22:48 [ DEBUG ] unifi_protect_backup.downloader : [661be0db0064cf03e4108744] Type: smartDetectZone (vehicle)
2024-05-22 06:22:48 [ DEBUG ] unifi_protect_backup.downloader : [661be0db0064cf03e4108744] Start: 2024-04-14T20-57-44 (1713103064.732)
2024-05-22 06:22:48 [ DEBUG ] unifi_protect_backup.downloader : [661be0db0064cf03e4108744] End: 2024-04-14T20-57-51 (1713103071.334)
2024-05-22 06:22:48 [ DEBUG ] unifi_protect_backup.downloader : [661be0db0064cf03e4108744] Duration: 6.602s
2024-05-22 06:22:48 [ DEBUG ] unifi_protect_backup.downloader : [661be0db0064cf03e4108744] Downloading video...
2024-05-22 06:22:48 [ INFO ] unifi_protect_backup.uploader : [661e54c40024cf03e4125898] Uploading event: 661e54c40024cf03e4125898
2024-05-22 06:22:48 [ DEBUG ] unifi_protect_backup.uploader : [661e54c40024cf03e4125898] Remaining Upload Queue: 0 (0.0B)
2024-05-22 06:22:48 [ DEBUG ] unifi_protect_backup.uploader : [661e54c40024cf03e4125898] Destination: local:/data/Right Yard Camera/2024-04-16/2024-04-16T17-36-49 smartDetectZone (person).mp4
2024-05-22 06:22:48 [ DEBUG ] unifi_protect_backup.uploader : [661e54c40024cf03e4125898] Uploaded
2024-05-22 06:22:49 [ WARNING ] unifi_protect_backup.downloader : [661be0db0064cf03e4108744] Failed download attempt 1, retying in 1s
Traceback (most recent call last):
File "/usr/lib/python3.11/site-packages/unifi_protect_backup/downloader.py", line 185, in _download
assert isinstance(video, bytes)
AssertionError
2024-05-22 06:22:50 [ WARNING ] unifi_protect_backup.downloader : [661be0db0064cf03e4108744] Failed download attempt 2, retying in 1s
Traceback (most recent call last):
File "/usr/lib/python3.11/site-packages/unifi_protect_backup/downloader.py", line 185, in _download
assert isinstance(video, bytes)
AssertionError
2024-05-22 06:22:51 [ WARNING ] unifi_protect_backup.downloader : [661be0db0064cf03e4108744] Failed download attempt 3, retying in 1s
Traceback (most recent call last):
File "/usr/lib/python3.11/site-packages/unifi_protect_backup/downloader.py", line 185, in _download
assert isinstance(video, bytes)
AssertionError
2024-05-22 06:22:53 [ WARNING ] unifi_protect_backup.downloader : [661be0db0064cf03e4108744] Failed download attempt 4, retying in 1s
Traceback (most recent call last):
File "/usr/lib/python3.11/site-packages/unifi_protect_backup/downloader.py", line 185, in _download
assert isinstance(video, bytes)
AssertionError
2024-05-22 06:22:54 [ WARNING ] unifi_protect_backup.downloader : [661be0db0064cf03e4108744] Failed download attempt 5, retying in 1s
Traceback (most recent call last):
File "/usr/lib/python3.11/site-packages/unifi_protect_backup/downloader.py", line 185, in _download
assert isinstance(video, bytes)
AssertionError
2024-05-22 06:22:55 [ ERROR ] unifi_protect_backup.downloader : [661be0db0064cf03e4108744] Download failed after 5 attempts, abandoning event 661be0db0064cf03e4108744:
2024-05-22 06:22:55 [ WARNING ] unifi_protect_backup.downloader : [661be0db0064cf03e4108744] Event failed download attempt 1
Traceback (most recent call last):
File "/usr/lib/python3.11/site-packages/unifi_protect_backup/downloader.py", line 145, in start
assert video is not None
^^^^^^^^^^^^^^^^^
AssertionError