Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Occasionally failing to download an event #435

Open
hawkins6423 opened this issue Apr 22, 2024 · 1 comment
Open

Occasionally failing to download an event #435

hawkins6423 opened this issue Apr 22, 2024 · 1 comment

Comments

@hawkins6423
Copy link

Thanks for putting this project together. I will get a lot of use out of this and I'd be happy to contribute however python is not my cup of tea.

I'm intermittently getting the error below. It seems to be random. I have several cameras and I'm running 5x containers, all separate databases and protect users. Each container is reading from 4 cameras, controlled by Protect permissions. I mention this because I observed the normal behavior to be not concurrent (one camera, one download at a time), and I'm not sure if there are concurrency limitations with the Protect API.

backup_protect_inside_3-1   | 2024-04-22 14:38:03 [   INFO    ] unifi_protect_backup.downloader            : [6626763e00f65103e400597e]  Downloading event: 6626763e00f65103e400597e
backup_protect_inside_3-1   | 2024-04-22 14:38:03 [   DEBUG   ] unifi_protect_backup.downloader            : [6626763e00f65103e400597e]  Remaining Download Queue: 0
backup_protect_inside_3-1   | 2024-04-22 14:38:03 [   DEBUG   ] unifi_protect_backup.downloader            : [6626763e00f65103e400597e]  Video Download Buffer: 0.0B/256.0MiB
backup_protect_inside_3-1   | 2024-04-22 14:38:03 [   DEBUG   ] unifi_protect_backup.downloader            : [6626763e00f65103e400597e]    Camera: 10 Kitchen
backup_protect_inside_3-1   | 2024-04-22 14:38:03 [   DEBUG   ] unifi_protect_backup.downloader            : [6626763e00f65103e400597e]    Type: motion
backup_protect_inside_3-1   | 2024-04-22 14:38:03 [   DEBUG   ] unifi_protect_backup.downloader            : [6626763e00f65103e400597e]    Start: 2024-04-22T10-37-47 (1713796667.0)
backup_protect_inside_3-1   | 2024-04-22 14:38:03 [   DEBUG   ] unifi_protect_backup.downloader            : [6626763e00f65103e400597e]    End: 2024-04-22T10-38-01 (1713796681.25)
backup_protect_inside_3-1   | 2024-04-22 14:38:03 [   DEBUG   ] unifi_protect_backup.downloader            : [6626763e00f65103e400597e]    Duration: 14.25s
backup_protect_inside_3-1   | 2024-04-22 14:38:03 [   DEBUG   ] unifi_protect_backup.downloader            : [6626763e00f65103e400597e]    Sleeping (5.35772s) to ensure clip is ready to download...
backup_protect_inside_3-1   | 2024-04-22 14:38:05 [   DEBUG   ] unifi_protect_backup.event_listener        :  Adding event 6626764803615103e40059a0 to queue (Current download queue=1)
backup_protect_inside_3-1   | 2024-04-22 14:38:07 [   DEBUG   ] unifi_protect_backup.event_listener        :  Adding event 6626764802a85103e400599f to queue (Current download queue=2)
backup_protect_inside_3-1   | 2024-04-22 14:38:07 [   DEBUG   ] unifi_protect_backup.missing_event_checker :  Running check for missing events...
backup_protect_inside_3-1   | 2024-04-22 14:38:08 [   DEBUG   ] unifi_protect_backup.downloader            : [6626763e00f65103e400597e]    Downloading video...
backup_protect_inside_3-1   | 2024-04-22 14:38:08 [  WARNING  ] unifi_protect_backup.downloader            : [6626763e00f65103e400597e]  Event failed download attempt 1
backup_protect_inside_3-1   | Traceback (most recent call last):
backup_protect_inside_3-1   |   File "/usr/lib/python3.11/site-packages/unifi_protect_backup/downloader.py", line 144, in start
backup_protect_inside_3-1   |     video = await self._download(event)
backup_protect_inside_3-1   |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^
backup_protect_inside_3-1   |   File "/usr/lib/python3.11/site-packages/unifi_protect_backup/downloader.py", line 184, in _download
backup_protect_inside_3-1   |     video = await self._protect.get_camera_video(event.camera_id, event.start, event.end)
backup_protect_inside_3-1   |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
backup_protect_inside_3-1   |   File "/usr/lib/python3.11/site-packages/pyunifiprotect/api.py", line 1328, in get_camera_video
backup_protect_inside_3-1   |     camera = self._bootstrap.cameras[camera_id]
backup_protect_inside_3-1   |              ~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^
backup_protect_inside_3-1   | KeyError: '65e600f401570403e40448ad'
@danielfernau
Copy link
Owner

Hi there, sorry for the late reply. These logs do not look like they're from my application. Maybe it's from another integration or project...?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants