ep1cman / unifi-protect-backup

Python tool to backup unifi event clips in realtime
MIT License
662 stars 33 forks source link

Event failed download after update to Protect v5.0.34 #168

Open wssweb opened 1 month ago

wssweb commented 1 month ago

Description

Videos are failing to download again after updating the Protect app to v5. Fails with 500, no reason given.

What I Did

2024-09-30 16:14:42 [   DEBUG   ] unifi_protect_backup.event_listener        :  Adding event 66face63032fff03e4000447 to queue (Current download queue=1)                          
2024-09-30 16:14:42 [   INFO    ] unifi_protect_backup.downloader_experimental : [66face63032fff03e4000447]  Downloading event: 66face63032fff03e4000447                           
2024-09-30 16:14:42 [   DEBUG   ] unifi_protect_backup.downloader_experimental : [66face63032fff03e4000447]  Remaining Download Queue: 0                                           
2024-09-30 16:14:42 [   DEBUG   ] unifi_protect_backup.downloader_experimental : [66face63032fff03e4000447]  Video Download Buffer: 0.0B/512.0MiB                                  
2024-09-30 16:14:42 [   DEBUG   ] unifi_protect_backup.downloader_experimental : [66face63032fff03e4000447]    Camera: Showroom                                                    
2024-09-30 16:14:42 [   DEBUG   ] unifi_protect_backup.downloader_experimental : [66face63032fff03e4000447]    Type: motion                                                        
2024-09-30 16:14:42 [   DEBUG   ] unifi_protect_backup.downloader_experimental : [66face63032fff03e4000447]    Start: 2024-09-30T10-14-21 (1727712861.494)                         
2024-09-30 16:14:42 [   DEBUG   ] unifi_protect_backup.downloader_experimental : [66face63032fff03e4000447]    End: 2024-09-30T10-14-43 (1727712883.629)                           
2024-09-30 16:14:42 [   DEBUG   ] unifi_protect_backup.downloader_experimental : [66face63032fff03e4000447]    Duration: 22.135s                                                   
2024-09-30 16:14:42 [   DEBUG   ] unifi_protect_backup.downloader_experimental : [66face63032fff03e4000447]    Sleeping (8.331082s) to ensure clip is ready to download...         
2024-09-30 16:14:51 [   DEBUG   ] unifi_protect_backup.downloader_experimental : [66face63032fff03e4000447]    Downloading video...                                                
2024-09-30 16:14:51 [  WARNING  ] unifi_protect_backup.downloader_experimental : [66face63032fff03e4000447]  Event failed download attempt 1                                       
Traceback (most recent call last):                                                                                                                                                 
  File "/usr/lib/python3.12/site-packages/unifi_protect_backup/downloader_experimental.py", line 144, in start                                                                     
    video = await self._download(event)                                                                                                                                            
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^                                                                                                                                            
  File "/usr/lib/python3.12/site-packages/unifi_protect_backup/downloader_experimental.py", line 184, in _download                                                                 
    prepared_video_file = await self._protect.prepare_camera_video(event.camera_id, event.start, event.end)                                                                        
                          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^                                                                        
  File "/usr/lib/python3.12/site-packages/pyunifiprotect/api.py", line 1273, in prepare_camera_video                                                                               
    return await self.api_request(                                                                                                                                                 
           ^^^^^^^^^^^^^^^^^^^^^^^                                                                                                                                                 
  File "/usr/lib/python3.12/site-packages/pyunifiprotect/api.py", line 274, in api_request                                                                                         
    data = await self.api_request_raw(                                                                                                                                             
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^                                                                                                                                             
  File "/usr/lib/python3.12/site-packages/pyunifiprotect/api.py", line 249, in api_request_raw                                                                                     
    await self._os.verify_response(url, response)                                                                                                                                  
  File "/usr/lib/python3.12/site-packages/pyunifiprotect/session.py", line 348, in verify_response                                                                                 
    raise NvrError(msg % (url, response.status, reason))                                                                                                                           
pyunifiprotect.exceptions.NvrError: Request failed: /proxy/protect/api/video/prepare - Status: 500 - Reason:  
2024-09-30 16:15:34 [   DEBUG   ] unifi_protect_backup.event_listener        :  Adding event 66face9d0101ff03e400044d to queue (Current download queue=1)                          
2024-09-30 16:15:34 [   INFO    ] unifi_protect_backup.downloader_experimental : [66face9d0101ff03e400044d]  Downloading event: 66face9d0101ff03e400044d                           
2024-09-30 16:15:34 [   DEBUG   ] unifi_protect_backup.downloader_experimental : [66face9d0101ff03e400044d]  Remaining Download Queue: 0                                           
2024-09-30 16:15:34 [   DEBUG   ] unifi_protect_backup.downloader_experimental : [66face9d0101ff03e400044d]  Video Download Buffer: 0.0B/512.0MiB                                  
2024-09-30 16:15:34 [   DEBUG   ] unifi_protect_backup.downloader_experimental : [66face9d0101ff03e400044d]    Camera: Showroom                                                    
2024-09-30 16:15:34 [   DEBUG   ] unifi_protect_backup.downloader_experimental : [66face9d0101ff03e400044d]    Type: motion                                                        
2024-09-30 16:15:34 [   DEBUG   ] unifi_protect_backup.downloader_experimental : [66face9d0101ff03e400044d]    Start: 2024-09-30T10-15-18 (1727712918.958)                         
2024-09-30 16:15:34 [   DEBUG   ] unifi_protect_backup.downloader_experimental : [66face9d0101ff03e400044d]    End: 2024-09-30T10-15-34 (1727712934.962)                           
2024-09-30 16:15:34 [   DEBUG   ] unifi_protect_backup.downloader_experimental : [66face9d0101ff03e400044d]    Duration: 16.004s                                                   
2024-09-30 16:15:34 [   DEBUG   ] unifi_protect_backup.downloader_experimental : [66face9d0101ff03e400044d]    Sleeping (8.45747s) to ensure clip is ready to download...          
2024-09-30 16:15:41 [   DEBUG   ] unifi_protect_backup.event_listener        :  Adding event 66facea7024bff03e4000452 to queue (Current download queue=1)                          
2024-09-30 16:15:42 [   DEBUG   ] unifi_protect_backup.downloader_experimental : [66face9d0101ff03e400044d]    Downloading video...                                                
2024-09-30 16:15:42 [  WARNING  ] unifi_protect_backup.downloader_experimental : [66face9d0101ff03e400044d]  Event failed download attempt 1                                       
Traceback (most recent call last):                                                                                                                                                 
  File "/usr/lib/python3.12/site-packages/unifi_protect_backup/downloader_experimental.py", line 144, in start                                                                     
    video = await self._download(event)                                                                                                                                            
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^                                                                                                                                            
  File "/usr/lib/python3.12/site-packages/unifi_protect_backup/downloader_experimental.py", line 184, in _download                                                                 
    prepared_video_file = await self._protect.prepare_camera_video(event.camera_id, event.start, event.end)                                                                        
                          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^                                                                        
  File "/usr/lib/python3.12/site-packages/pyunifiprotect/api.py", line 1273, in prepare_camera_video                                                                               
    return await self.api_request(                                                                                                                                                 
           ^^^^^^^^^^^^^^^^^^^^^^^                                                                                                                                                 
  File "/usr/lib/python3.12/site-packages/pyunifiprotect/api.py", line 274, in api_request                                                                                         
    data = await self.api_request_raw(                                                                                                                                             
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^                                                                                                                                             
  File "/usr/lib/python3.12/site-packages/pyunifiprotect/api.py", line 249, in api_request_raw                                                                                     
    await self._os.verify_response(url, response)                                                                                                                                  
  File "/usr/lib/python3.12/site-packages/pyunifiprotect/session.py", line 348, in verify_response                                                                                 
    raise NvrError(msg % (url, response.status, reason))                                                                                                                           
pyunifiprotect.exceptions.NvrError: Request failed: /proxy/protect/api/video/prepare - Status: 500 - Reason:  
2024-09-30 16:15:42 [   INFO    ] unifi_protect_backup.downloader_experimental : [66facea7024bff03e4000452]  Downloading event: 66facea7024bff03e4000452                           
2024-09-30 16:15:42 [   DEBUG   ] unifi_protect_backup.downloader_experimental : [66facea7024bff03e4000452]  Remaining Download Queue: 0                                           
2024-09-30 16:15:42 [   DEBUG   ] unifi_protect_backup.downloader_experimental : [66facea7024bff03e4000452]  Video Download Buffer: 0.0B/512.0MiB                                  
2024-09-30 16:15:42 [   DEBUG   ] unifi_protect_backup.downloader_experimental : [66facea7024bff03e4000452]    Camera: Showroom                                                    
2024-09-30 16:15:42 [   DEBUG   ] unifi_protect_backup.downloader_experimental : [66facea7024bff03e4000452]    Type: motion                                                        
2024-09-30 16:15:42 [   DEBUG   ] unifi_protect_backup.downloader_experimental : [66facea7024bff03e4000452]    Start: 2024-09-30T10-15-29 (1727712929.318)                         
2024-09-30 16:15:42 [   DEBUG   ] unifi_protect_backup.downloader_experimental : [66facea7024bff03e4000452]    End: 2024-09-30T10-15-42 (1727712942.586)                           
2024-09-30 16:15:42 [   DEBUG   ] unifi_protect_backup.downloader_experimental : [66facea7024bff03e4000452]    Duration: 13.268s                                                   
2024-09-30 16:15:42 [   DEBUG   ] unifi_protect_backup.downloader_experimental : [66facea7024bff03e4000452]    Sleeping (7.569812s) to ensure clip is ready to download...         
2024-09-30 16:15:50 [   DEBUG   ] unifi_protect_backup.downloader_experimental : [66facea7024bff03e4000452]    Downloading video...                                                
2024-09-30 16:15:50 [  WARNING  ] unifi_protect_backup.downloader_experimental : [66facea7024bff03e4000452]  Event failed download attempt 1                                       
Traceback (most recent call last):                                                                                                                                                 
  File "/usr/lib/python3.12/site-packages/unifi_protect_backup/downloader_experimental.py", line 144, in start                                                                     
    video = await self._download(event)                                                                                                                                            
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^                                                                                                                                            
  File "/usr/lib/python3.12/site-packages/unifi_protect_backup/downloader_experimental.py", line 184, in _download                                                                 
    prepared_video_file = await self._protect.prepare_camera_video(event.camera_id, event.start, event.end)                                                                        
                          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^                                                                        
  File "/usr/lib/python3.12/site-packages/pyunifiprotect/api.py", line 1273, in prepare_camera_video                                                                               
    return await self.api_request(                                                                                                                                                 
           ^^^^^^^^^^^^^^^^^^^^^^^                                                                                                                                                 
  File "/usr/lib/python3.12/site-packages/pyunifiprotect/api.py", line 274, in api_request                                                                                         
    data = await self.api_request_raw(                                                                                                                                             
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^                                                                                                                                             
  File "/usr/lib/python3.12/site-packages/pyunifiprotect/api.py", line 249, in api_request_raw                                                                                     
    await self._os.verify_response(url, response)                                                                                                                                  
  File "/usr/lib/python3.12/site-packages/pyunifiprotect/session.py", line 348, in verify_response                                                                                 
    raise NvrError(msg % (url, response.status, reason))                                                                                                                           
pyunifiprotect.exceptions.NvrError: Request failed: /proxy/protect/api/video/prepare - Status: 500 - Reason: 
wssweb commented 1 month ago

I noticed I stated getting login errors as well so I rebooted the NVR. Once it came back and up and I restarted the container, I started getting a few successful uploads (still get the errors above however).

2024-09-30 17:01:22 [   DEBUG   ] unifi_protect_backup.uploader              : [66fad6be02715403e4000416]  Uploaded                                                                
2024-09-30 17:01:22 [   INFO    ] unifi_protect_backup.uploader              : [66fad7fd02f35403e4000421]  Uploading event: 66fad7fd02f35403e4000421                               
2024-09-30 17:01:22 [   DEBUG   ] unifi_protect_backup.uploader              : [66fad7fd02f35403e4000421]   Remaining Upload Queue: 2 (74.7MiB)                                    
2024-09-30 17:01:22 [   DEBUG   ] unifi_protect_backup.uploader              : [66fad7fd02f35403e4000421]   Destination: unifi:wss-unifi/unifi_protect_backup/North Parking Lot/202
4-09-30/2024-09-30T10-56-31 motion.mp4                                                                         

I am going to let it run and see if its just a handful of videos it is having a problem with and let them time out to see if the issue persists.

wssweb commented 1 month ago

After stopping the container, rebooting the NVR, logging into the web console using the local admin account (as suggested in: issue #161 ) I was able to start the docker container back up and let it run for a while.

It cleared a bunch of the events out after 10 fails. However it is now hitting a lot of new videos and failing on the first try. Only to pick them back up later in a missing event check where it will successfully upload them.

2024-09-30 17:52:19 [   DEBUG   ] unifi_protect_backup.event_listener        :  Adding event 66fae54602fb5403e400049a to queue (Current download queue=1)                          
2024-09-30 17:52:19 [   INFO    ] unifi_protect_backup.downloader_experimental : [66fae54602fb5403e400049a]  Downloading event: 66fae54602fb5403e400049a                           
2024-09-30 17:52:19 [   DEBUG   ] unifi_protect_backup.downloader_experimental : [66fae54602fb5403e400049a]  Remaining Download Queue: 0                                           
2024-09-30 17:52:19 [   DEBUG   ] unifi_protect_backup.downloader_experimental : [66fae54602fb5403e400049a]  Video Download Buffer: 0.0B/512.0MiB                                  
2024-09-30 17:52:19 [   DEBUG   ] unifi_protect_backup.downloader_experimental : [66fae54602fb5403e400049a]    Camera: North Parking Lot                                           
2024-09-30 17:52:19 [   DEBUG   ] unifi_protect_backup.downloader_experimental : [66fae54602fb5403e400049a]    Type: motion                                                        
2024-09-30 17:52:19 [   DEBUG   ] unifi_protect_backup.downloader_experimental : [66fae54602fb5403e400049a]    Start: 2024-09-30T11-52-00 (1727718720.643)                         
2024-09-30 17:52:19 [   DEBUG   ] unifi_protect_backup.downloader_experimental : [66fae54602fb5403e400049a]    End: 2024-09-30T11-52-20 (1727718740.978)                           
2024-09-30 17:52:19 [   DEBUG   ] unifi_protect_backup.downloader_experimental : [66fae54602fb5403e400049a]    Duration: 20.335s                                                   
2024-09-30 17:52:19 [   DEBUG   ] unifi_protect_backup.downloader_experimental : [66fae54602fb5403e400049a]    Sleeping (9.001853s) to ensure clip is ready to download...         
2024-09-30 17:52:28 [   DEBUG   ] unifi_protect_backup.downloader_experimental : [66fae54602fb5403e400049a]    Downloading video...                                                
2024-09-30 17:52:28 [  WARNING  ] unifi_protect_backup.downloader_experimental : [66fae54602fb5403e400049a]  Event failed download attempt 1                                       
Traceback (most recent call last):                                                                                                                                                 
  File "/usr/lib/python3.12/site-packages/unifi_protect_backup/downloader_experimental.py", line 144, in start                                                                     
    video = await self._download(event)                                                                                                                                            
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^                                                                                                                                            
  File "/usr/lib/python3.12/site-packages/unifi_protect_backup/downloader_experimental.py", line 184, in _download                                                                 
    prepared_video_file = await self._protect.prepare_camera_video(event.camera_id, event.start, event.end)                                                                        
                          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^                                                                        
  File "/usr/lib/python3.12/site-packages/pyunifiprotect/api.py", line 1273, in prepare_camera_video                                                                               
    return await self.api_request(                                                                                                                                                 
           ^^^^^^^^^^^^^^^^^^^^^^^                                                                                                                                                 
  File "/usr/lib/python3.12/site-packages/pyunifiprotect/api.py", line 274, in api_request                                                                                         
    data = await self.api_request_raw(                                                                                                                                             
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^                                                                                                                                             
  File "/usr/lib/python3.12/site-packages/pyunifiprotect/api.py", line 249, in api_request_raw                                                                                     
    await self._os.verify_response(url, response)                                                                                                                                  
  File "/usr/lib/python3.12/site-packages/pyunifiprotect/session.py", line 348, in verify_response                                                                                 
    raise NvrError(msg % (url, response.status, reason))                                                                                                                           
pyunifiprotect.exceptions.NvrError: Request failed: /proxy/protect/api/video/prepare - Status: 500 - Reason: 

Then a few minutes later:

2024-09-30 17:55:52 [   DEBUG   ] unifi_protect_backup.missing_event_checker :  Running check for missing events...                                                                
2024-09-30 17:55:54 [  WARNING  ] unifi_protect_backup.missing_event_checker :   Found missing events, adding to backup queue                                                      
2024-09-30 17:55:54 [   INFO    ] unifi_protect_backup.downloader_experimental : [66fae54602fb5403e400049a]  Downloading event: 66fae54602fb5403e400049a                           
2024-09-30 17:55:54 [   DEBUG   ] unifi_protect_backup.downloader_experimental : [66fae54602fb5403e400049a]  Remaining Download Queue: 0                                           
2024-09-30 17:55:54 [   DEBUG   ] unifi_protect_backup.downloader_experimental : [66fae54602fb5403e400049a]  Video Download Buffer: 0.0B/512.0MiB                                  
2024-09-30 17:55:54 [   DEBUG   ] unifi_protect_backup.downloader_experimental : [66fae54602fb5403e400049a]    Camera: North Parking Lot                                           
2024-09-30 17:55:54 [   DEBUG   ] unifi_protect_backup.downloader_experimental : [66fae54602fb5403e400049a]    Type: motion                                                        
2024-09-30 17:55:54 [   DEBUG   ] unifi_protect_backup.downloader_experimental : [66fae54602fb5403e400049a]    Start: 2024-09-30T11-52-00 (1727718720.643)                         
2024-09-30 17:55:54 [   DEBUG   ] unifi_protect_backup.downloader_experimental : [66fae54602fb5403e400049a]    End: 2024-09-30T11-52-20 (1727718740.978)                           
2024-09-30 17:55:54 [   DEBUG   ] unifi_protect_backup.downloader_experimental : [66fae54602fb5403e400049a]    Duration: 20.335s                                                   
2024-09-30 17:55:54 [   DEBUG   ] unifi_protect_backup.downloader_experimental : [66fae54602fb5403e400049a]    Downloading video...                                                
2024-09-30 17:55:55 [   DEBUG   ] unifi_protect_backup.downloader_experimental : [66fae54602fb5403e400049a]    Downloaded video size: 21.4MiBs                                     
2024-09-30 17:55:55 [   DEBUG   ] unifi_protect_backup.downloader_experimental : [66fae54602fb5403e400049a]    Downloaded video length: 23.792s(+3.457s)                           
2024-09-30 17:55:55 [   DEBUG   ] unifi_protect_backup.downloader_experimental : [66fae54602fb5403e400049a]  Added to upload queue                                                 
2024-09-30 17:55:55 [   INFO    ] unifi_protect_backup.downloader_experimental : [66fae5db00eb0203e400056e]  Downloading event: 66fae5db00eb0203e400056e                           
2024-09-30 17:55:55 [   DEBUG   ] unifi_protect_backup.downloader_experimental : [66fae5db00eb0203e400056e]  Remaining Download Queue: 0                                           
2024-09-30 17:55:55 [   DEBUG   ] unifi_protect_backup.downloader_experimental : [66fae5db00eb0203e400056e]  Video Download Buffer: 21.4MiB/512.0MiB                               
2024-09-30 17:55:55 [   DEBUG   ] unifi_protect_backup.downloader_experimental : [66fae5db00eb0203e400056e]    Camera: Showroom                                                    
2024-09-30 17:55:55 [   DEBUG   ] unifi_protect_backup.downloader_experimental : [66fae5db00eb0203e400056e]    Type: motion                                                        
2024-09-30 17:55:55 [   DEBUG   ] unifi_protect_backup.downloader_experimental : [66fae5db00eb0203e400056e]    Start: 2024-09-30T11-54-28 (1727718868.975)                         
2024-09-30 17:55:55 [   DEBUG   ] unifi_protect_backup.downloader_experimental : [66fae5db00eb0203e400056e]    End: 2024-09-30T11-54-41 (1727718881.59)                            
2024-09-30 17:55:55 [   DEBUG   ] unifi_protect_backup.downloader_experimental : [66fae5db00eb0203e400056e]    Duration: 12.615s                                                   
2024-09-30 17:55:55 [   DEBUG   ] unifi_protect_backup.downloader_experimental : [66fae5db00eb0203e400056e]    Downloading video...                                                
2024-09-30 17:55:55 [   INFO    ] unifi_protect_backup.uploader              : [66fae54602fb5403e400049a]  Uploading event: 66fae54602fb5403e400049a                               
2024-09-30 17:55:55 [   DEBUG   ] unifi_protect_backup.uploader              : [66fae54602fb5403e400049a]   Remaining Upload Queue: 0 (0.0B)                                       
2024-09-30 17:55:55 [   DEBUG   ] unifi_protect_backup.uploader              : [66fae54602fb5403e400049a]   Destination: unifi:wss-unifi/unifi_protect_backup/North Parking Lot/202
4-09-30/2024-09-30T11-52-20 motion.mp4 

On the previous version of protect it had no problem getting the events on the first try. Which leads me to believe something got changed in either the new Protect version or the new OS version. At least it appears to be working still with the event check~

wssweb commented 1 month ago

After letting it run over night it is now failing on a lot of downloads (1 in 10, if not more), and failing to re-acquire them on the event check so they never get uploaded. It seems to be any camera at random. I have checked these in the NVR and all appear to be good, none of them skip or otherwise do not play back.

ep1cman commented 1 month ago

Thanks for reporting all of this. I don’t really know what’s going wrong but recent UniFi protect versions are getting increasingly unstable. Have you tried using the experimental downloader option?

wssweb commented 1 month ago

This is running the experimental downloader (have been using it since you made it). That was basically required for the last major update they did.

ep1cman commented 1 month ago

And without it I am assuming it is even worse?

wssweb commented 1 month ago

I have not tried disabling it and using the stock version. I'll give that a test.

wssweb commented 1 month ago

I am getting mixed results with the standard down loader. I stopped the docker container, flipped the flag for the experimental to false and started it back up. It did not go back and reacquire any of the previous known missing event. So far it is successfully uploading most of the videos on re-attempts after a failure... however it may degrade as time goes one like it did yesterday with the experimental.

The fail errors with the normal downloader are more varied however. Below are some examples I got out of the logs (this includes the successful re-attempts as well as some out right fails). I trimmed the full successful uploads from the log for brevity.

66fc1d3e028f5403e4000c38

2024-10-01 16:03:19 [   DEBUG   ] unifi_protect_backup.event_listener        :  Adding event 66fc1d3e028f5403e4000c38 to queue (Current download queue=1)
2024-10-01 16:03:22 [   INFO    ] unifi_protect_backup.downloader            : [66fc1d3e028f5403e4000c38]  Downloading event: 66fc1d3e028f5403e4000c38
2024-10-01 16:03:22 [   DEBUG   ] unifi_protect_backup.downloader            : [66fc1d3e028f5403e4000c38]  Remaining Download Queue: 0
2024-10-01 16:03:22 [   DEBUG   ] unifi_protect_backup.downloader            : [66fc1d3e028f5403e4000c38]  Video Download Buffer: 64.9MiB/512.0MiB
2024-10-01 16:03:22 [   DEBUG   ] unifi_protect_backup.downloader            : [66fc1d3e028f5403e4000c38]    Camera: North Parking Lot
2024-10-01 16:03:22 [   DEBUG   ] unifi_protect_backup.downloader            : [66fc1d3e028f5403e4000c38]    Type: motion
2024-10-01 16:03:22 [   DEBUG   ] unifi_protect_backup.downloader            : [66fc1d3e028f5403e4000c38]    Start: 2024-10-01T10-03-04 (1727798584.562)
2024-10-01 16:03:22 [   DEBUG   ] unifi_protect_backup.downloader            : [66fc1d3e028f5403e4000c38]    End: 2024-10-01T10-03-20 (1727798600.895)
2024-10-01 16:03:22 [   DEBUG   ] unifi_protect_backup.downloader            : [66fc1d3e028f5403e4000c38]    Duration: 16.333s
2024-10-01 16:03:22 [   DEBUG   ] unifi_protect_backup.downloader            : [66fc1d3e028f5403e4000c38]    Sleeping (6.306286s) to ensure clip is ready to download...
2024-10-01 16:03:28 [   DEBUG   ] unifi_protect_backup.downloader            : [66fc1d3e028f5403e4000c38]    Downloading video...
2024-10-01 16:03:28 [  WARNING  ] unifi_protect_backup.downloader            : [66fc1d3e028f5403e4000c38]      Failed download attempt 1, retying in 1s
2024-10-01 16:03:29 [  WARNING  ] unifi_protect_backup.downloader            : [66fc1d3e028f5403e4000c38]      Failed download attempt 2, retying in 1s
2024-10-01 16:03:30 [  WARNING  ] unifi_protect_backup.downloader            : [66fc1d3e028f5403e4000c38]      Failed download attempt 3, retying in 1s
2024-10-01 16:03:31 [  WARNING  ] unifi_protect_backup.downloader            : [66fc1d3e028f5403e4000c38]      Failed download attempt 4, retying in 1s
2024-10-01 16:03:32 [  WARNING  ] unifi_protect_backup.downloader            : [66fc1d3e028f5403e4000c38]      Failed download attempt 5, retying in 1s
2024-10-01 16:03:33 [   ERROR   ] unifi_protect_backup.downloader            : [66fc1d3e028f5403e4000c38]  Download failed after 5 attempts, abandoning event 66fc1d3e028f5403e4000c38:
2024-10-01 16:03:33 [  WARNING  ] unifi_protect_backup.downloader            : [66fc1d3e028f5403e4000c38]  Event failed download attempt 1

66fc1df703030203e40018c5

2024-10-01 16:06:30 [   DEBUG   ] unifi_protect_backup.event_listener        :  Adding event 66fc1df703030203e40018c5 to queue (Current download queue=1)
2024-10-01 16:06:32 [   INFO    ] unifi_protect_backup.downloader            : [66fc1df703030203e40018c5]  Downloading event: 66fc1df703030203e40018c5
2024-10-01 16:06:32 [   DEBUG   ] unifi_protect_backup.downloader            : [66fc1df703030203e40018c5]  Remaining Download Queue: 0
2024-10-01 16:06:32 [   DEBUG   ] unifi_protect_backup.downloader            : [66fc1df703030203e40018c5]  Video Download Buffer: 15.3MiB/512.0MiB
2024-10-01 16:06:32 [   DEBUG   ] unifi_protect_backup.downloader            : [66fc1df703030203e40018c5]    Camera: West Approach
2024-10-01 16:06:32 [   DEBUG   ] unifi_protect_backup.downloader            : [66fc1df703030203e40018c5]    Type: motion
2024-10-01 16:06:32 [   DEBUG   ] unifi_protect_backup.downloader            : [66fc1df703030203e40018c5]    Start: 2024-10-01T10-06-09 (1727798769.457)
2024-10-01 16:06:32 [   DEBUG   ] unifi_protect_backup.downloader            : [66fc1df703030203e40018c5]    End: 2024-10-01T10-06-31 (1727798791.227)
2024-10-01 16:06:32 [   DEBUG   ] unifi_protect_backup.downloader            : [66fc1df703030203e40018c5]    Duration: 21.77s
2024-10-01 16:06:32 [   DEBUG   ] unifi_protect_backup.downloader            : [66fc1df703030203e40018c5]    Sleeping (6.638547s) to ensure clip is ready to download...
2024-10-01 16:06:38 [   DEBUG   ] unifi_protect_backup.downloader            : [66fc1df703030203e40018c5]    Downloading video...
2024-10-01 16:06:38 [  WARNING  ] unifi_protect_backup.downloader            : [66fc1df703030203e40018c5]      Failed download attempt 1, retying in 1s
2024-10-01 16:06:39 [  WARNING  ] unifi_protect_backup.downloader            : [66fc1df703030203e40018c5]      Failed download attempt 2, retying in 1s
2024-10-01 16:06:40 [  WARNING  ] unifi_protect_backup.downloader            : [66fc1df703030203e40018c5]      Failed download attempt 3, retying in 1s
2024-10-01 16:06:42 [   DEBUG   ] unifi_protect_backup.downloader            : [66fc1df703030203e40018c5]    Downloaded video size: 31.1MiBs
2024-10-01 16:06:42 [   DEBUG   ] unifi_protect_backup.downloader            : [66fc1df703030203e40018c5]    Downloaded video length: 25.029s(+3.259s)
2024-10-01 16:06:42 [   DEBUG   ] unifi_protect_backup.downloader            : [66fc1df703030203e40018c5]  Added to upload queue
2024-10-01 16:06:42 [   INFO    ] unifi_protect_backup.uploader              : [66fc1df703030203e40018c5]  Uploading event: 66fc1df703030203e40018c5
2024-10-01 16:06:42 [   DEBUG   ] unifi_protect_backup.uploader              : [66fc1df703030203e40018c5]   Remaining Upload Queue: 0 (0.0B)
2024-10-01 16:06:42 [   DEBUG   ] unifi_protect_backup.uploader              : [66fc1df703030203e40018c5]   Destination: unifi:wss-unifi/unifi_protect_backup/West Approach/2024-10-01/2024-10-01T10-06-31 motion.mp4
2024-10-01 16:06:54 [   DEBUG   ] unifi_protect_backup.uploader              : [66fc1df703030203e40018c5]  Uploaded

66fc1ef203370203e4001906

2024-10-01 16:10:32 [   DEBUG   ] unifi_protect_backup.event_listener        :  Adding event 66fc1ef203370203e4001906 to queue (Current download queue=1)
2024-10-01 16:10:32 [   INFO    ] unifi_protect_backup.downloader            : [66fc1ef203370203e4001906]  Downloading event: 66fc1ef203370203e4001906
2024-10-01 16:10:32 [   DEBUG   ] unifi_protect_backup.downloader            : [66fc1ef203370203e4001906]  Remaining Download Queue: 0
2024-10-01 16:10:32 [   DEBUG   ] unifi_protect_backup.downloader            : [66fc1ef203370203e4001906]  Video Download Buffer: 0.0B/512.0MiB
2024-10-01 16:10:32 [   DEBUG   ] unifi_protect_backup.downloader            : [66fc1ef203370203e4001906]    Camera: West Approach
2024-10-01 16:10:32 [   DEBUG   ] unifi_protect_backup.downloader            : [66fc1ef203370203e4001906]    Type: motion
2024-10-01 16:10:32 [   DEBUG   ] unifi_protect_backup.downloader            : [66fc1ef203370203e4001906]    Start: 2024-10-01T10-10-20 (1727799020.481)
2024-10-01 16:10:32 [   DEBUG   ] unifi_protect_backup.downloader            : [66fc1ef203370203e4001906]    End: 2024-10-01T10-10-33 (1727799033.275)
2024-10-01 16:10:32 [   DEBUG   ] unifi_protect_backup.downloader            : [66fc1ef203370203e4001906]    Duration: 12.794s
2024-10-01 16:10:32 [   DEBUG   ] unifi_protect_backup.downloader            : [66fc1ef203370203e4001906]    Sleeping (8.525306s) to ensure clip is ready to download...
2024-10-01 16:10:40 [   DEBUG   ] unifi_protect_backup.downloader            : [66fc1ef203370203e4001906]    Downloading video...
2024-10-01 16:10:40 [  WARNING  ] unifi_protect_backup.downloader            : [66fc1ef203370203e4001906]      Failed download attempt 1, retying in 1s
2024-10-01 16:10:42 [   DEBUG   ] unifi_protect_backup.downloader            : [66fc1ef203370203e4001906]    Downloaded video size: 19.5MiBs
2024-10-01 16:10:42 [   DEBUG   ] unifi_protect_backup.downloader            : [66fc1ef203370203e4001906]    Downloaded video length: 17.125s(+4.331s)
2024-10-01 16:10:42 [   DEBUG   ] unifi_protect_backup.downloader            : [66fc1ef203370203e4001906]  Added to upload queue
2024-10-01 16:10:45 [   INFO    ] unifi_protect_backup.uploader              : [66fc1ef203370203e4001906]  Uploading event: 66fc1ef203370203e4001906
2024-10-01 16:10:45 [   DEBUG   ] unifi_protect_backup.uploader              : [66fc1ef203370203e4001906]   Remaining Upload Queue: 0 (0.0B)
2024-10-01 16:10:45 [   DEBUG   ] unifi_protect_backup.uploader              : [66fc1ef203370203e4001906]   Destination: unifi:wss-unifi/unifi_protect_backup/West Approach/2024-10-01/2024-10-01T10-10-33 motion.mp4
2024-10-01 16:10:55 [   DEBUG   ] unifi_protect_backup.uploader              : [66fc1ef203370203e4001906]  Uploaded

66fc1f2901f70203e400191f

2024-10-01 16:11:28 [   DEBUG   ] unifi_protect_backup.event_listener        :  Adding event 66fc1f2901f70203e400191f to queue (Current download queue=2)
2024-10-01 16:11:36 [   INFO    ] unifi_protect_backup.downloader            : [66fc1f2901f70203e400191f]  Downloading event: 66fc1f2901f70203e400191f
2024-10-01 16:11:36 [   DEBUG   ] unifi_protect_backup.downloader            : [66fc1f2901f70203e400191f]  Remaining Download Queue: 1
2024-10-01 16:11:36 [   DEBUG   ] unifi_protect_backup.downloader            : [66fc1f2901f70203e400191f]  Video Download Buffer: 15.0MiB/512.0MiB
2024-10-01 16:11:36 [   DEBUG   ] unifi_protect_backup.downloader            : [66fc1f2901f70203e400191f]    Camera: Showroom
2024-10-01 16:11:36 [   DEBUG   ] unifi_protect_backup.downloader            : [66fc1f2901f70203e400191f]    Type: motion
2024-10-01 16:11:36 [   DEBUG   ] unifi_protect_backup.downloader            : [66fc1f2901f70203e400191f]    Start: 2024-10-01T10-11-15 (1727799075.25)
2024-10-01 16:11:36 [   DEBUG   ] unifi_protect_backup.downloader            : [66fc1f2901f70203e400191f]    End: 2024-10-01T10-11-29 (1727799089.129)
2024-10-01 16:11:36 [   DEBUG   ] unifi_protect_backup.downloader            : [66fc1f2901f70203e400191f]    Duration: 13.879s
2024-10-01 16:11:36 [   DEBUG   ] unifi_protect_backup.downloader            : [66fc1f2901f70203e400191f]    Sleeping (0.191887s) to ensure clip is ready to download...
2024-10-01 16:11:36 [   DEBUG   ] unifi_protect_backup.downloader            : [66fc1f2901f70203e400191f]    Downloading video...
2024-10-01 16:11:36 [  WARNING  ] unifi_protect_backup.downloader            : [66fc1f2901f70203e400191f]      Failed download attempt 1, retying in 1s
2024-10-01 16:11:37 [  WARNING  ] unifi_protect_backup.downloader            : [66fc1f2901f70203e400191f]      Failed download attempt 2, retying in 1s
2024-10-01 16:11:38 [  WARNING  ] unifi_protect_backup.downloader            : [66fc1f2901f70203e400191f]      Failed download attempt 3, retying in 1s
2024-10-01 16:11:39 [  WARNING  ] unifi_protect_backup.downloader            : [66fc1f2901f70203e400191f]      Failed download attempt 4, retying in 1s
2024-10-01 16:11:40 [  WARNING  ] unifi_protect_backup.downloader            : [66fc1f2901f70203e400191f]      Failed download attempt 5, retying in 1s
2024-10-01 16:11:41 [   ERROR   ] unifi_protect_backup.downloader            : [66fc1f2901f70203e400191f]  Download failed after 5 attempts, abandoning event 66fc1f2901f70203e400191f:
2024-10-01 16:11:41 [  WARNING  ] unifi_protect_backup.downloader            : [66fc1f2901f70203e400191f]  Event failed 

66fc1ef203370203e4001906

2024-10-01 16:10:32 [   DEBUG   ] unifi_protect_backup.event_listener        :  Adding event 66fc1ef203370203e4001906 to queue (Current download queue=1)
2024-10-01 16:10:32 [   INFO    ] unifi_protect_backup.downloader            : [66fc1ef203370203e4001906]  Downloading event: 66fc1ef203370203e4001906
2024-10-01 16:10:32 [   DEBUG   ] unifi_protect_backup.downloader            : [66fc1ef203370203e4001906]  Remaining Download Queue: 0
2024-10-01 16:10:32 [   DEBUG   ] unifi_protect_backup.downloader            : [66fc1ef203370203e4001906]  Video Download Buffer: 0.0B/512.0MiB
2024-10-01 16:10:32 [   DEBUG   ] unifi_protect_backup.downloader            : [66fc1ef203370203e4001906]    Camera: West Approach
2024-10-01 16:10:32 [   DEBUG   ] unifi_protect_backup.downloader            : [66fc1ef203370203e4001906]    Type: motion
2024-10-01 16:10:32 [   DEBUG   ] unifi_protect_backup.downloader            : [66fc1ef203370203e4001906]    Start: 2024-10-01T10-10-20 (1727799020.481)
2024-10-01 16:10:32 [   DEBUG   ] unifi_protect_backup.downloader            : [66fc1ef203370203e4001906]    End: 2024-10-01T10-10-33 (1727799033.275)
2024-10-01 16:10:32 [   DEBUG   ] unifi_protect_backup.downloader            : [66fc1ef203370203e4001906]    Duration: 12.794s
2024-10-01 16:10:32 [   DEBUG   ] unifi_protect_backup.downloader            : [66fc1ef203370203e4001906]    Sleeping (8.525306s) to ensure clip is ready to download...
2024-10-01 16:10:40 [   DEBUG   ] unifi_protect_backup.downloader            : [66fc1ef203370203e4001906]    Downloading video...
2024-10-01 16:10:40 [  WARNING  ] unifi_protect_backup.downloader            : [66fc1ef203370203e4001906]      Failed download attempt 1, retying in 1s
2024-10-01 16:10:42 [   DEBUG   ] unifi_protect_backup.downloader            : [66fc1ef203370203e4001906]    Downloaded video size: 19.5MiBs
2024-10-01 16:10:42 [   DEBUG   ] unifi_protect_backup.downloader            : [66fc1ef203370203e4001906]    Downloaded video length: 17.125s(+4.331s)
2024-10-01 16:10:42 [   DEBUG   ] unifi_protect_backup.downloader            : [66fc1ef203370203e4001906]  Added to upload queue
2024-10-01 16:10:45 [   INFO    ] unifi_protect_backup.uploader              : [66fc1ef203370203e4001906]  Uploading event: 66fc1ef203370203e4001906
2024-10-01 16:10:45 [   DEBUG   ] unifi_protect_backup.uploader              : [66fc1ef203370203e4001906]   Remaining Upload Queue: 0 (0.0B)
2024-10-01 16:10:45 [   DEBUG   ] unifi_protect_backup.uploader              : [66fc1ef203370203e4001906]   Destination: unifi:wss-unifi/unifi_protect_backup/West Approach/2024-10-01/2024-10-01T10-10-33 motion.mp4
2024-10-01 16:10:55 [   DEBUG   ] unifi_protect_backup.uploader              : [66fc1ef203370203e4001906]  Uploaded

66fc21cd02be0203e40019a6

2024-10-01 16:22:49 [   DEBUG   ] unifi_protect_backup.event_listener        :  Adding event 66fc21cd02be0203e40019a6 to queue (Current download queue=1)                                            
2024-10-01 16:22:49 [   INFO    ] unifi_protect_backup.downloader            : [66fc21cd02be0203e40019a6]  Downloading event: 66fc21cd02be0203e40019a6                                               
2024-10-01 16:22:49 [   DEBUG   ] unifi_protect_backup.downloader            : [66fc21cd02be0203e40019a6]  Remaining Download Queue: 0                                                               
2024-10-01 16:22:49 [   DEBUG   ] unifi_protect_backup.downloader            : [66fc21cd02be0203e40019a6]  Video Download Buffer: 0.0B/512.0MiB                                                      
2024-10-01 16:22:49 [   DEBUG   ] unifi_protect_backup.downloader            : [66fc21cd02be0203e40019a6]    Camera: West Approach                                                                   
2024-10-01 16:22:49 [   DEBUG   ] unifi_protect_backup.downloader            : [66fc21cd02be0203e40019a6]    Type: motion                                                                            
2024-10-01 16:22:49 [   DEBUG   ] unifi_protect_backup.downloader            : [66fc21cd02be0203e40019a6]    Start: 2024-10-01T10-22-31 (1727799751.41)                                              
2024-10-01 16:22:49 [   DEBUG   ] unifi_protect_backup.downloader            : [66fc21cd02be0203e40019a6]    End: 2024-10-01T10-22-50 (1727799770.038)                                               
2024-10-01 16:22:49 [   DEBUG   ] unifi_protect_backup.downloader            : [66fc21cd02be0203e40019a6]    Duration: 18.628s                                                                       
2024-10-01 16:22:49 [   DEBUG   ] unifi_protect_backup.downloader            : [66fc21cd02be0203e40019a6]    Sleeping (8.344799s) to ensure clip is ready to download...                             
2024-10-01 16:22:57 [   DEBUG   ] unifi_protect_backup.downloader            : [66fc21cd02be0203e40019a6]    Downloading video...                                                                    
2024-10-01 16:22:57 [  WARNING  ] unifi_protect_backup.downloader            : [66fc21cd02be0203e40019a6]      Failed download attempt 1, retying in 1s                                              
Traceback (most recent call last):                                                                                                                                                                   
  File "/usr/lib/python3.12/site-packages/unifi_protect_backup/downloader.py", line 185, in _download                                                                                                
    assert isinstance(video, bytes)                                                                                                                                                                  
           ^^^^^^^^^^^^^^^^^^^^^^^^                                                                                                                                                                  
AssertionError                                                                                                                                                                                       
2024-10-01 16:22:58 [   DEBUG   ] unifi_protect_backup.downloader            : [66fc21cd02be0203e40019a6]    Downloaded video size: 1.1MiBs                                                          
2024-10-01 16:22:58 [   DEBUG   ] unifi_protect_backup.downloader            : [66fc21cd02be0203e40019a6]    Downloaded video length: 22.196s(+3.568s)                                               
2024-10-01 16:22:58 [   DEBUG   ] unifi_protect_backup.downloader            : [66fc21cd02be0203e40019a6]  Added to upload queue                                                                     
2024-10-01 16:22:58 [   INFO    ] unifi_protect_backup.uploader              : [66fc21cd02be0203e40019a6]  Uploading event: 66fc21cd02be0203e40019a6                                                 
2024-10-01 16:22:58 [   DEBUG   ] unifi_protect_backup.uploader              : [66fc21cd02be0203e40019a6]   Remaining Upload Queue: 0 (0.0B)                                                         
2024-10-01 16:22:58 [   DEBUG   ] unifi_protect_backup.uploader              : [66fc21cd02be0203e40019a6]   Destination: unifi:wss-unifi/unifi_protect_backup/West Approach/2024-10-01/2024-10-01T10-
22-50 motion.mp4                                                                                                                                                                                     
2024-10-01 16:23:01 [   DEBUG   ] unifi_protect_backup.uploader              : [66fc21cd02be0203e40019a6]  Uploaded               
Swallowtail23 commented 1 month ago
2024-10-02T08:47:32.865646333+10:00 stderr F 2024-10-01 22:47:32 [  WARNING  ] unifi_protect_backup.downloader            : [66fc7bf601cfda03e40085a1]      Failed download attempt 2, retying in 1s
2024-10-02T08:47:32.865646333+10:00 stderr F Traceback (most recent call last):
2024-10-02T08:47:32.865646333+10:00 stderr F   File "/usr/lib/python3.12/site-packages/unifi_protect_backup/downloader.py", line 185, in _download
2024-10-02T08:47:32.865646333+10:00 stderr F     assert isinstance(video, bytes)
2024-10-02T08:47:32.865646333+10:00 stderr F            ^^^^^^^^^^^^^^^^^^^^^^^^
2024-10-02T08:47:32.865646333+10:00 stderr F AssertionError
2024-10-02T08:47:33.904580895+10:00 stderr F 2024-10-01 22:47:33 [  WARNING  ] unifi_protect_backup.downloader            : [66fc7bf601cfda03e40085a1]      Failed download attempt 3, retying in 1s
2024-10-02T08:47:33.904580895+10:00 stderr F Traceback (most recent call last):
2024-10-02T08:47:33.904580895+10:00 stderr F   File "/usr/lib/python3.12/site-packages/unifi_protect_backup/downloader.py", line 185, in _download
2024-10-02T08:47:33.904580895+10:00 stderr F     assert isinstance(video, bytes)
2024-10-02T08:47:33.904580895+10:00 stderr F            ^^^^^^^^^^^^^^^^^^^^^^^^
2024-10-02T08:47:33.904580895+10:00 stderr F AssertionError
2024-10-02T08:47:34.956652324+10:00 stderr F 2024-10-01 22:47:34 [  WARNING  ] unifi_protect_backup.downloader            : [66fc7bf601cfda03e40085a1]      Failed download attempt 4, retying in 1s
2024-10-02T08:47:34.956652324+10:00 stderr F Traceback (most recent call last):
2024-10-02T08:47:34.956652324+10:00 stderr F   File "/usr/lib/python3.12/site-packages/unifi_protect_backup/downloader.py", line 185, in _download
2024-10-02T08:47:34.956652324+10:00 stderr F     assert isinstance(video, bytes)
2024-10-02T08:47:34.956652324+10:00 stderr F            ^^^^^^^^^^^^^^^^^^^^^^^^
2024-10-02T08:47:34.956652324+10:00 stderr F AssertionError
2024-10-02T08:47:36.002039866+10:00 stderr F 2024-10-01 22:47:36 [  WARNING  ] unifi_protect_backup.downloader            : [66fc7bf601cfda03e40085a1]      Failed download attempt 5, retying in 1s
2024-10-02T08:47:36.002039866+10:00 stderr F Traceback (most recent call last):
2024-10-02T08:47:36.002039866+10:00 stderr F   File "/usr/lib/python3.12/site-packages/unifi_protect_backup/downloader.py", line 185, in _download
2024-10-02T08:47:36.002039866+10:00 stderr F     assert isinstance(video, bytes)
2024-10-02T08:47:36.002039866+10:00 stderr F            ^^^^^^^^^^^^^^^^^^^^^^^^
2024-10-02T08:47:36.002039866+10:00 stderr F AssertionError
2024-10-02T08:47:37.003336185+10:00 stderr F 2024-10-01 22:47:37 [   ERROR   ] unifi_protect_backup.downloader            : [66fc7bf601cfda03e40085a1]  Download failed after 5 attempts, abandoning event 66fc7bf601cfda03e40085a1:
2024-10-02T08:47:37.003719519+10:00 stderr F 2024-10-01 22:47:37 [  WARNING  ] unifi_protect_backup.downloader            : [66fc7bf601cfda03e40085a1]  Event failed download attempt 1
2024-10-02T08:47:37.003719519+10:00 stderr F Traceback (most recent call last):
2024-10-02T08:47:37.003719519+10:00 stderr F   File "/usr/lib/python3.12/site-packages/unifi_protect_backup/downloader.py", line 145, in start
2024-10-02T08:47:37.003719519+10:00 stderr F     assert video is not None
2024-10-02T08:47:37.003719519+10:00 stderr F            ^^^^^^^^^^^^^^^^^
2024-10-02T08:47:37.003719519+10:00 stderr F AssertionError
2024-10-02T08:50:53.154329867+10:00 stderr F 2024-10-01 22:50:53 [   DEBUG   ] unifi_protect_backup.missing_event_checker :  Running check for missing events...
2024-10-02T08:56:07.830137275+10:00 stderr F 2024-10-01 22:56:07 [   DEBUG   ] unifi_protect_backup.missing_event_checker :  Running check for missing events...

Similar issue here - not all videos, but probably 3 or 4 times a day across 10 relatively busy cameras.

Running Protect 5.0.34.

Swallowtail23 commented 1 month ago

Note in addition to above, event 66fc7bf601cfda03e40085a1 was picked up later by missing events check and successfully uploaded.

wssweb commented 1 month ago

I let mine run over night and interestingly when I filter the log for the ones that fully fail and abandon the event, I get 8 fails an hour... they fail roughly in the same time frame as well.

2024-10-02 06:00:30 [   ERROR   ] unifi_protect_backup.downloader            : [66fad272037eff03e40004a0]  Download failed after 5 attempts, abandoning event 66fad272037eff03e40004a0:
2024-10-02 06:08:09 [   ERROR   ] unifi_protect_backup.downloader            : [66fad237031eff03e4000491]  Download failed after 5 attempts, abandoning event 66fad237031eff03e4000491:
2024-10-02 06:15:57 [   ERROR   ] unifi_protect_backup.downloader            : [66fad24a03d1ff03e4000496]  Download failed after 5 attempts, abandoning event 66fad24a03d1ff03e4000496:
2024-10-02 06:23:43 [   ERROR   ] unifi_protect_backup.downloader            : [66fad3f2037fff03e40004bd]  Download failed after 5 attempts, abandoning event 66fad3f2037fff03e40004bd:
2024-10-02 06:31:26 [   ERROR   ] unifi_protect_backup.downloader            : [66fad3f1012aff03e40004bc]  Download failed after 5 attempts, abandoning event 66fad3f1012aff03e40004bc:
2024-10-02 06:39:06 [   ERROR   ] unifi_protect_backup.downloader            : [66fad43c00c0ff03e40004e0]  Download failed after 5 attempts, abandoning event 66fad43c00c0ff03e40004e0:
2024-10-02 06:46:56 [   ERROR   ] unifi_protect_backup.downloader            : [66fad4260024ff03e40004d7]  Download failed after 5 attempts, abandoning event 66fad4260024ff03e40004d7:
2024-10-02 06:54:31 [   ERROR   ] unifi_protect_backup.downloader            : [66fad48100bfff03e40004f5]  Download failed after 5 attempts, abandoning event 66fad48100bfff03e40004f5:
2024-10-02 07:02:07 [   ERROR   ] unifi_protect_backup.downloader            : [66fad46402a5ff03e40004e8]  Download failed after 5 attempts, abandoning event 66fad46402a5ff03e40004e8:
2024-10-02 07:09:42 [   ERROR   ] unifi_protect_backup.downloader            : [66fad4c6015bff03e40004fc]  Download failed after 5 attempts, abandoning event 66fad4c6015bff03e40004fc:
2024-10-02 07:17:18 [   ERROR   ] unifi_protect_backup.downloader            : [66fad442034aff03e40004e1]  Download failed after 5 attempts, abandoning event 66fad442034aff03e40004e1:
2024-10-02 07:24:53 [   ERROR   ] unifi_protect_backup.downloader            : [66fad45b03bfff03e40004e7]  Download failed after 5 attempts, abandoning event 66fad45b03bfff03e40004e7:
2024-10-02 07:32:28 [   ERROR   ] unifi_protect_backup.downloader            : [66fad512027cff03e4000507]  Download failed after 5 attempts, abandoning event 66fad512027cff03e4000507:
2024-10-02 07:40:03 [   ERROR   ] unifi_protect_backup.downloader            : [66fad5460128ff03e400050d]  Download failed after 5 attempts, abandoning event 66fad5460128ff03e400050d:
2024-10-02 07:47:39 [   ERROR   ] unifi_protect_backup.downloader            : [66fad57a01a4ff03e4000514]  Download failed after 5 attempts, abandoning event 66fad57a01a4ff03e4000514:
2024-10-02 07:55:18 [   ERROR   ] unifi_protect_backup.downloader            : [66fad42001cbff03e40004d2]  Download failed after 5 attempts, abandoning event 66fad42001cbff03e40004d2:
2024-10-02 08:02:53 [   ERROR   ] unifi_protect_backup.downloader            : [66fad57002d1ff03e4000512]  Download failed after 5 attempts, abandoning event 66fad57002d1ff03e4000512:
2024-10-02 08:10:28 [   ERROR   ] unifi_protect_backup.downloader            : [66fad41b02d7ff03e40004c9]  Download failed after 5 attempts, abandoning event 66fad41b02d7ff03e40004c9:
2024-10-02 08:18:04 [   ERROR   ] unifi_protect_backup.downloader            : [66fad414013dff03e40004c8]  Download failed after 5 attempts, abandoning event 66fad414013dff03e40004c8:
2024-10-02 08:25:39 [   ERROR   ] unifi_protect_backup.downloader            : [66fad4ff02ddff03e4000502]  Download failed after 5 attempts, abandoning event 66fad4ff02ddff03e4000502:
2024-10-02 08:33:14 [   ERROR   ] unifi_protect_backup.downloader            : [66facc390039ff03e40003f0]  Download failed after 5 attempts, abandoning event 66facc390039ff03e40003f0:
2024-10-02 08:40:50 [   ERROR   ] unifi_protect_backup.downloader            : [66facd520127ff03e4000424]  Download failed after 5 attempts, abandoning event 66facd520127ff03e4000424:
2024-10-02 08:48:25 [   ERROR   ] unifi_protect_backup.downloader            : [66facd7f0209ff03e400042f]  Download failed after 5 attempts, abandoning event 66facd7f0209ff03e400042f:
2024-10-02 08:56:00 [   ERROR   ] unifi_protect_backup.downloader            : [66facea7024bff03e4000452]  Download failed after 5 attempts, abandoning event 66facea7024bff03e4000452:
2024-10-02 09:03:35 [   ERROR   ] unifi_protect_backup.downloader            : [66fad0a6028cff03e4000470]  Download failed after 5 attempts, abandoning event 66fad0a6028cff03e4000470:
2024-10-02 09:11:10 [   ERROR   ] unifi_protect_backup.downloader            : [66facd1e02d8ff03e400041e]  Download failed after 5 attempts, abandoning event 66facd1e02d8ff03e400041e:
2024-10-02 09:18:46 [   ERROR   ] unifi_protect_backup.downloader            : [66face63032fff03e4000447]  Download failed after 5 attempts, abandoning event 66face63032fff03e4000447:
2024-10-02 09:26:21 [   ERROR   ] unifi_protect_backup.downloader            : [66facda30119ff03e4000434]  Download failed after 5 attempts, abandoning event 66facda30119ff03e4000434:
2024-10-02 09:33:56 [   ERROR   ] unifi_protect_backup.downloader            : [66facd0500c5ff03e4000418]  Download failed after 5 attempts, abandoning event 66facd0500c5ff03e4000418:
2024-10-02 09:41:31 [   ERROR   ] unifi_protect_backup.downloader            : [66fad0f40152ff03e4000476]  Download failed after 5 attempts, abandoning event 66fad0f40152ff03e4000476:
2024-10-02 09:49:07 [   ERROR   ] unifi_protect_backup.downloader            : [66facce8027fff03e4000411]  Download failed after 5 attempts, abandoning event 66facce8027fff03e4000411:
2024-10-02 09:56:42 [   ERROR   ] unifi_protect_backup.downloader            : [66face9d0101ff03e400044d]  Download failed after 5 attempts, abandoning event 66face9d0101ff03e400044d:
2024-10-02 10:04:17 [   ERROR   ] unifi_protect_backup.downloader            : [66facd6f008cff03e4000429]  Download failed after 5 attempts, abandoning event 66facd6f008cff03e4000429:
2024-10-02 10:11:52 [   ERROR   ] unifi_protect_backup.downloader            : [66fad03d0212ff03e4000464]  Download failed after 5 attempts, abandoning event 66fad03d0212ff03e4000464:
2024-10-02 10:19:28 [   ERROR   ] unifi_protect_backup.downloader            : [66faccdd02c7ff03e400040c]  Download failed after 5 attempts, abandoning event 66faccdd02c7ff03e400040c:
2024-10-02 10:27:03 [   ERROR   ] unifi_protect_backup.downloader            : [66face0a0017ff03e4000441]  Download failed after 5 attempts, abandoning event 66face0a0017ff03e4000441:
2024-10-02 10:34:38 [   ERROR   ] unifi_protect_backup.downloader            : [66fad05b0128ff03e400046a]  Download failed after 5 attempts, abandoning event 66fad05b0128ff03e400046a:
2024-10-02 10:42:14 [   ERROR   ] unifi_protect_backup.downloader            : [66facc9401a8ff03e40003fc]  Download failed after 5 attempts, abandoning event 66facc9401a8ff03e40003fc:
2024-10-02 10:49:49 [   ERROR   ] unifi_protect_backup.downloader            : [66facff8020dff03e400045e]  Download failed after 5 attempts, abandoning event 66facff8020dff03e400045e:
2024-10-02 10:57:24 [   ERROR   ] unifi_protect_backup.downloader            : [66facc5002a0ff03e40003f1]  Download failed after 5 attempts, abandoning event 66facc5002a0ff03e40003f1:
2024-10-02 11:04:59 [   ERROR   ] unifi_protect_backup.downloader            : [66facca60021ff03e4000401]  Download failed after 5 attempts, abandoning event 66facca60021ff03e4000401:
2024-10-02 11:12:35 [   ERROR   ] unifi_protect_backup.downloader            : [66faccc002b3ff03e4000406]  Download failed after 5 attempts, abandoning event 66faccc002b3ff03e4000406:
2024-10-02 11:20:10 [   ERROR   ] unifi_protect_backup.downloader            : [66facde700c5ff03e400043b]  Download failed after 5 attempts, abandoning event 66facde700c5ff03e400043b:
2024-10-02 11:27:45 [   ERROR   ] unifi_protect_backup.downloader            : [66fad1fb018eff03e400048a]  Download failed after 5 attempts, abandoning event 66fad1fb018eff03e400048a:
2024-10-02 11:35:20 [   ERROR   ] unifi_protect_backup.downloader            : [66fad19a0360ff03e4000483]  Download failed after 5 attempts, abandoning event 66fad19a0360ff03e4000483:
2024-10-02 11:42:56 [   ERROR   ] unifi_protect_backup.downloader            : [66fad3ef02abff03e40004bb]  Download failed after 5 attempts, abandoning event 66fad3ef02abff03e40004bb:
2024-10-02 11:50:31 [   ERROR   ] unifi_protect_backup.downloader            : [66fad293023aff03e40004aa]  Download failed after 5 attempts, abandoning event 66fad293023aff03e40004aa:
2024-10-02 11:58:06 [   ERROR   ] unifi_protect_backup.downloader            : [66fad2b50290ff03e40004b0]  Download failed after 5 attempts, abandoning event 66fad2b50290ff03e40004b0:
2024-10-02 12:05:41 [   ERROR   ] unifi_protect_backup.downloader            : [66fad1340164ff03e400047c]  Download failed after 5 attempts, abandoning event 66fad1340164ff03e400047c:
2024-10-02 12:13:17 [   ERROR   ] unifi_protect_backup.downloader            : [66fad23600c3ff03e4000490]  Download failed after 5 attempts, abandoning event 66fad23600c3ff03e4000490:
2024-10-02 12:20:52 [   ERROR   ] unifi_protect_backup.downloader            : [66fad27d0074ff03e40004a5]  Download failed after 5 attempts, abandoning event 66fad27d0074ff03e40004a5:
2024-10-02 12:28:27 [   ERROR   ] unifi_protect_backup.downloader            : [66facbf403e4ff03e40003ea]  Download failed after 5 attempts, abandoning event 66facbf403e4ff03e40003ea:
2024-10-02 12:36:02 [   ERROR   ] unifi_protect_backup.downloader            : [66fad272037eff03e40004a0]  Download failed after 5 attempts, abandoning event 66fad272037eff03e40004a0:
2024-10-02 12:43:38 [   ERROR   ] unifi_protect_backup.downloader            : [66fad237031eff03e4000491]  Download failed after 5 attempts, abandoning event 66fad237031eff03e4000491:
2024-10-02 12:51:14 [   ERROR   ] unifi_protect_backup.downloader            : [66fad24a03d1ff03e4000496]  Download failed after 5 attempts, abandoning event 66fad24a03d1ff03e4000496:
2024-10-02 12:58:49 [   ERROR   ] unifi_protect_backup.downloader            : [66fad3f2037fff03e40004bd]  Download failed after 5 attempts, abandoning event 66fad3f2037fff03e40004bd:
2024-10-02 13:06:24 [   ERROR   ] unifi_protect_backup.downloader            : [66fad3f1012aff03e40004bc]  Download failed after 5 attempts, abandoning event 66fad3f1012aff03e40004bc:
2024-10-02 13:13:59 [   ERROR   ] unifi_protect_backup.downloader            : [66fad43c00c0ff03e40004e0]  Download failed after 5 attempts, abandoning event 66fad43c00c0ff03e40004e0:
2024-10-02 13:21:35 [   ERROR   ] unifi_protect_backup.downloader            : [66fad4260024ff03e40004d7]  Download failed after 5 attempts, abandoning event 66fad4260024ff03e40004d7:
2024-10-02 13:29:10 [   ERROR   ] unifi_protect_backup.downloader            : [66fad48100bfff03e40004f5]  Download failed after 5 attempts, abandoning event 66fad48100bfff03e40004f5:
2024-10-02 13:36:45 [   ERROR   ] unifi_protect_backup.downloader            : [66fad46402a5ff03e40004e8]  Download failed after 5 attempts, abandoning event 66fad46402a5ff03e40004e8:
2024-10-02 13:44:20 [   ERROR   ] unifi_protect_backup.downloader            : [66fad4c6015bff03e40004fc]  Download failed after 5 attempts, abandoning event 66fad4c6015bff03e40004fc:
2024-10-02 13:51:56 [   ERROR   ] unifi_protect_backup.downloader            : [66fad442034aff03e40004e1]  Download failed after 5 attempts, abandoning event 66fad442034aff03e40004e1:
2024-10-02 13:59:31 [   ERROR   ] unifi_protect_backup.downloader            : [66fad45b03bfff03e40004e7]  Download failed after 5 attempts, abandoning event 66fad45b03bfff03e40004e7:
2024-10-02 14:07:07 [   ERROR   ] unifi_protect_backup.downloader            : [66fad512027cff03e4000507]  Download failed after 5 attempts, abandoning event 66fad512027cff03e4000507:
wssweb commented 1 month ago

It is also creating a massive download que

2024-10-02 15:02:29 [  WARNING  ] unifi_protect_backup.missing_event_checker :   Found missing events, adding to backup queue
2024-10-02 15:03:14 [  WARNING  ] unifi_protect_backup.downloader            : [66facc390039ff03e40003f0]      Failed download attempt 2, retying in 1s
Traceback (most recent call last):
  File "/usr/lib/python3.12/site-packages/unifi_protect_backup/downloader.py", line 185, in _download
    assert isinstance(video, bytes)
           ^^^^^^^^^^^^^^^^^^^^^^^^
AssertionError
2024-10-02 15:04:45 [  WARNING  ] unifi_protect_backup.downloader            : [66facc390039ff03e40003f0]      Failed download attempt 3, retying in 1s
Traceback (most recent call last):
  File "/usr/lib/python3.12/site-packages/unifi_protect_backup/downloader.py", line 185, in _download
    assert isinstance(video, bytes)
           ^^^^^^^^^^^^^^^^^^^^^^^^
AssertionError
2024-10-02 15:05:45 [   DEBUG   ] unifi_protect_backup.event_listener        :  Adding event 66fd606201590203e4002ea7 to queue (Current download queue=283)
2024-10-02 15:06:01 [   DEBUG   ] unifi_protect_backup.event_listener        :  Adding event 66fd614f00270203e4002eb0 to queue (Current download queue=284)
2024-10-02 15:06:05 [   DEBUG   ] unifi_protect_backup.event_listener        :  Adding event 66fd615003c50203e4002eb1 to queue (Current download queue=285)
2024-10-02 15:06:11 [   DEBUG   ] unifi_protect_backup.event_listener        :  Adding event 66fd615c036e5403e400147f to queue (Current download queue=286)
2024-10-02 15:06:17 [  WARNING  ] unifi_protect_backup.downloader            : [66facc390039ff03e40003f0]      Failed download attempt 4, retying in 1s
Traceback (most recent call last):
  File "/usr/lib/python3.12/site-packages/unifi_protect_backup/downloader.py", line 185, in _download
    assert isinstance(video, bytes)
           ^^^^^^^^^^^^^^^^^^^^^^^^
AssertionError
2024-10-02 15:06:39 [   DEBUG   ] unifi_protect_backup.event_listener        :  Adding event 66fd617303df0203e4002ebc to queue (Current download queue=287)
2024-10-02 15:06:48 [   DEBUG   ] unifi_protect_backup.event_listener        :  Adding event 66fd6183022c5403e4001485 to queue (Current download queue=288)
2024-10-02 15:06:58 [   DEBUG   ] unifi_protect_backup.event_listener        :  Adding event 66fd618b02700203e4002ec1 to queue (Current download queue=289)
2024-10-02 15:07:02 [   DEBUG   ] unifi_protect_backup.event_listener        :  Adding event 66fd616902f20203e4002ebb to queue (Current download queue=290)
2024-10-02 15:07:29 [   DEBUG   ] unifi_protect_backup.missing_event_checker :  Running check for missing events...
2024-10-02 15:07:36 [   DEBUG   ] unifi_protect_backup.event_listener        :  Adding event 66fd61b1036f5403e400148b to queue (Current download queue=291)
2024-10-02 15:07:40 [   DEBUG   ] unifi_protect_backup.event_listener        :  Adding event 66fd61a4020a0203e4002ecb to queue (Current download queue=292)
2024-10-02 15:07:48 [  WARNING  ] unifi_protect_backup.downloader            : [66facc390039ff03e40003f0]      Failed download attempt 5, retying in 1s
Traceback (most recent call last):
  File "/usr/lib/python3.12/site-packages/unifi_protect_backup/downloader.py", line 185, in _download
    assert isinstance(video, bytes)
           ^^^^^^^^^^^^^^^^^^^^^^^^
AssertionError
2024-10-02 15:07:49 [   ERROR   ] unifi_protect_backup.downloader            : [66facc390039ff03e40003f0]  Download failed after 5 attempts, abandoning event 66facc390039ff03e40003f0:
2024-10-02 15:07:49 [  WARNING  ] unifi_protect_backup.downloader            : [66facc390039ff03e40003f0]  Event failed download attempt 1
Traceback (most recent call last):
  File "/usr/lib/python3.12/site-packages/unifi_protect_backup/downloader.py", line 145, in start
    assert video is not None
           ^^^^^^^^^^^^^^^^^
AssertionError
2024-10-02 15:07:49 [   INFO    ] unifi_protect_backup.downloader            : [66facd520127ff03e4000424]  Downloading event: 66facd520127ff03e4000424
2024-10-02 15:07:49 [   DEBUG   ] unifi_protect_backup.downloader            : [66facd520127ff03e4000424]  Remaining Download Queue: 291
2024-10-02 15:07:49 [   DEBUG   ] unifi_protect_backup.downloader            : [66facd520127ff03e4000424]  Video Download Buffer: 0.0B/512.0MiB
2024-10-02 15:07:49 [   DEBUG   ] unifi_protect_backup.downloader            : [66facd520127ff03e4000424]    Camera: Showroom
2024-10-02 15:07:49 [   DEBUG   ] unifi_protect_backup.downloader            : [66facd520127ff03e4000424]    Type: motion
2024-10-02 15:07:49 [   DEBUG   ] unifi_protect_backup.downloader            : [66facd520127ff03e4000424]    Start: 2024-09-30T10-09-48 (1727712588.073)
2024-10-02 15:07:49 [   DEBUG   ] unifi_protect_backup.downloader            : [66facd520127ff03e4000424]    End: 2024-09-30T10-10-01 (1727712601.903)
2024-10-02 15:07:49 [   DEBUG   ] unifi_protect_backup.downloader            : [66facd520127ff03e4000424]    Duration: 13.83s
2024-10-02 15:07:49 [   DEBUG   ] unifi_protect_backup.downloader            : [66facd520127ff03e4000424]    Downloading video...
2024-10-02 15:07:59 [   DEBUG   ] unifi_protect_backup.event_listener        :  Adding event 66fd61c401930203e4002ed1 to queue (Current download queue=292)
2024-10-02 15:08:27 [   DEBUG   ] unifi_protect_backup.event_listener        :  Adding event 66fd61e002160203e4002ed7 to queue (Current download queue=293)
ep1cman commented 1 month ago

I’m really not sure how to approach resolving this other than retrying like the tool already does. This assertion error occurs when UniFi protects simply returns an empty response instead of the requested video. I suspect it’s simply unable to process the video in time.

The experimental downloaded used a slightly different approach (that the web ui now uses) that first asks UniFi protect to generate the video locally and then downloads it as a secondary step.

wssweb commented 1 month ago

I rolled back to Protect 4.1.53 yesterday around noon. This resolves the problems with no errors in the past 16 hours.

apt update
apt-get install --reinstall --allow-downgrades unifi-protect=4.1.53 -y
apt install ms=4.2.10
reboot

This was non destructive for me, keeping all settings/recordings on the stacked NVR Pros.

There are just a handful of warnings left now, all of which get resolved by the missing event check (or its a warning about time offset). These might have to do with Unifi OS 4.0.18 which I did not roll back to 4.0.6, or could just be a fluke. The update notes didn't really indicate any changes on it that would mess with Protect imo. Will have to let it run a few days to see what all gets logged. Previously on OS 4.0.6 and Protect 4.1.53 there were no errors or warnings of any kind getting logged.

Rolling back the OS requires a factory reset as far as I'm aware so I can live with the warnings, especially since they are not harming anything :)

Whatever they changed in 5.0.33 / 5.0.34 to add 3rd party camera support seems to have changed a lot of stuff with the way things get recorded and connect to the NVR unfortunately. Maybe ubiquiti will publish some API docs one day!

Swallowtail23 commented 1 month ago

I'm not running into this often enough to overwhelm the downloader... e.g.:

2024-10-04T08:24:00.489053329+10:00 stderr F 2024-10-03 22:24:00 [   DEBUG   ] unifi_protect_backup.downloader            : [66ff196c019bda03e400d148]    Downloading video...
2024-10-04T08:24:00.547841939+10:00 stderr F 2024-10-03 22:24:00 [  WARNING  ] unifi_protect_backup.downloader            : [66ff196c019bda03e400d148]      Failed download attempt 1, retying in 1s
2024-10-04T08:24:00.547841939+10:00 stderr F Traceback (most recent call last):
2024-10-04T08:24:00.547841939+10:00 stderr F   File "/usr/lib/python3.12/site-packages/unifi_protect_backup/downloader.py", line 185, in _download
2024-10-04T08:24:00.547841939+10:00 stderr F     assert isinstance(video, bytes)
2024-10-04T08:24:00.547841939+10:00 stderr F            ^^^^^^^^^^^^^^^^^^^^^^^^
2024-10-04T08:24:00.547841939+10:00 stderr F AssertionError
2024-10-04T08:24:01.588141853+10:00 stderr F 2024-10-03 22:24:01 [  WARNING  ] unifi_protect_backup.downloader            : [66ff196c019bda03e400d148]      Failed download attempt 2, retying in 1s
2024-10-04T08:24:01.588141853+10:00 stderr F Traceback (most recent call last):
2024-10-04T08:24:01.588141853+10:00 stderr F   File "/usr/lib/python3.12/site-packages/unifi_protect_backup/downloader.py", line 185, in _download
2024-10-04T08:24:01.588141853+10:00 stderr F     assert isinstance(video, bytes)
2024-10-04T08:24:01.588141853+10:00 stderr F            ^^^^^^^^^^^^^^^^^^^^^^^^
2024-10-04T08:24:01.588141853+10:00 stderr F AssertionError
2024-10-04T08:24:02.625555787+10:00 stderr F 2024-10-03 22:24:02 [  WARNING  ] unifi_protect_backup.downloader            : [66ff196c019bda03e400d148]      Failed download attempt 3, retying in 1s
2024-10-04T08:24:02.625555787+10:00 stderr F Traceback (most recent call last):
2024-10-04T08:24:02.625555787+10:00 stderr F   File "/usr/lib/python3.12/site-packages/unifi_protect_backup/downloader.py", line 185, in _download
2024-10-04T08:24:02.625555787+10:00 stderr F     assert isinstance(video, bytes)
2024-10-04T08:24:02.625555787+10:00 stderr F            ^^^^^^^^^^^^^^^^^^^^^^^^
2024-10-04T08:24:02.625555787+10:00 stderr F AssertionError
2024-10-04T08:24:03.731613262+10:00 stderr F 2024-10-03 22:24:03 [   DEBUG   ] unifi_protect_backup.downloader            : [66ff196c019bda03e400d148]    Downloaded video size: 4.3MiBs
2024-10-04T08:24:03.781060733+10:00 stderr F 2024-10-03 22:24:03 [   DEBUG   ] unifi_protect_backup.downloader            : [66ff196c019bda03e400d148]    Downloaded video length: 19.750s(+4.674s)
2024-10-04T08:24:03.781106362+10:00 stderr F 2024-10-03 22:24:03 [   DEBUG   ] unifi_protect_backup.downloader            : [66ff196c019bda03e400d148]  Added to upload queue
2024-10-04T08:24:03.782099635+10:00 stderr F 2024-10-03 22:24:03 [   INFO    ] unifi_protect_backup.uploader              : [66ff196c019bda03e400d148]  Uploading event: 66ff196c019bda03e400d148
2024-10-04T08:24:03.782145384+10:00 stderr F 2024-10-03 22:24:03 [   DEBUG   ] unifi_protect_backup.uploader              : [66ff196c019bda03e400d148]   Remaining Upload Queue: 0 (0.0B)
2024-10-04T08:24:03.782252032+10:00 stderr F 2024-10-03 22:24:03 [   DEBUG   ] unifi_protect_backup.uploader              : [66ff196c019bda03e400d148]   Destination: Wasabi:simonandkate.net/Unifi-Protect-Backup/Front Camera/2024-10-04/2024-10-04T08-23-52 smartDetectZone (person).mp4
2024-10-04T08:24:05.948439421+10:00 stderr F 2024-10-03 22:24:05 [   DEBUG   ] unifi_protect_backup.uploader              : [66ff196c019bda03e400d148]  Uploaded

So for now I'm staying on Protect 5, will see how it continues to hold up. I am not using alternative experimental download option.

drhex2000 commented 1 month ago

Even connecting to unifi protect is very hit and miss:

2024-10-25 14:18:17 [ WARNING ] unifi_protect_backup.event_listener : Lost connection to Unifi Protect. 2024-10-25 14:18:17 [ WARNING ] unifi_protect_backup.event_listener : Attempting reconnect... 2024-10-25 14:18:17 [ ERROR ] unifi_protect_backup.event_listener : Unexpected exception occurred while trying to reconnect: Traceback (most recent call last): File "C:\Program Files\Python\lib\site-packages\unifi_protect_backup\event_listener.py", line 117, in _check_websocket_and_reconnect await self._protect.update(force=True) File "C:\Program Files\Python\lib\site-packages\pyunifiprotect\api.py", line 673, in update self._bootstrap = await self.get_bootstrap() File "C:\Program Files\Python\lib\site-packages\pyunifiprotect\api.py", line 991, in get_bootstrap data = await self.api_request_obj("bootstrap") File "C:\Program Files\Python\lib\site-packages\pyunifiprotect\api.py", line 379, in api_request_obj data = await self.api_request( File "C:\Program Files\Python\lib\site-packages\pyunifiprotect\api.py", line 358, in api_request data = await self.api_request_raw( File "C:\Program Files\Python\lib\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/bootstrap - Status: 401 - Reason: {'code': 401, 'message': 'Unauthorized'} 2024-10-25 14:18:27 [ WARNING ] unifi_protect_backup.event_listener : Attempting reconnect... 2024-10-25 14:18:28 [ ERROR ] unifi_protect_backup.event_listener : Unexpected exception occurred while trying to reconnect: Traceback (most recent call last): File "C:\Program Files\Python\lib\site-packages\unifi_protect_backup\event_listener.py", line 117, in _check_websocket_and_reconnect await self._protect.update(force=True) File "C:\Program Files\Python\lib\site-packages\pyunifiprotect\api.py", line 673, in update self._bootstrap = await self.get_bootstrap() File "C:\Program Files\Python\lib\site-packages\pyunifiprotect\api.py", line 991, in get_bootstrap data = await self.api_request_obj("bootstrap") File "C:\Program Files\Python\lib\site-packages\pyunifiprotect\api.py", line 379, in api_request_obj data = await self.api_request( File "C:\Program Files\Python\lib\site-packages\pyunifiprotect\api.py", line 358, in api_request data = await self.api_request_raw( File "C:\Program Files\Python\lib\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/bootstrap - Status: 401 - Reason: {'code': 401, 'message': 'Unauthorized'} 2024-10-25 14:18:38 [ WARNING ] unifi_protect_backup.event_listener : Attempting reconnect... 2024-10-25 14:18:38 [ ERROR ] unifi_protect_backup.event_listener : Unexpected exception occurred while trying to reconnect: Traceback (most recent call last): File "C:\Program Files\Python\lib\site-packages\unifi_protect_backup\event_listener.py", line 117, in _check_websocket_and_reconnect await self._protect.update(force=True) File "C:\Program Files\Python\lib\site-packages\pyunifiprotect\api.py", line 673, in update self._bootstrap = await self.get_bootstrap() File "C:\Program Files\Python\lib\site-packages\pyunifiprotect\api.py", line 991, in get_bootstrap data = await self.api_request_obj("bootstrap") File "C:\Program Files\Python\lib\site-packages\pyunifiprotect\api.py", line 379, in api_request_obj data = await self.api_request( File "C:\Program Files\Python\lib\site-packages\pyunifiprotect\api.py", line 358, in api_request data = await self.api_request_raw( File "C:\Program Files\Python\lib\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/bootstrap - Status: 401 - Reason: {'code': 401, 'message': 'Unauthorized'}

drhex2000 commented 1 month ago

Also, installing with pip on Windows server it sticks to 0.10.7? PS C:\Windows\System32> pip show unifi-protect-backup Name: unifi_protect_backup Version: 0.10.7 Summary: Python tool to backup unifi event clips in realtime. Home-page: https://github.com/ep1cman/unifi-protect-backup Author: sebastian.goscik Author-email: sebastian@goscik.com License: MIT Location: c:\program files\python\lib\site-packages Requires: aiolimiter, aiorun, aiosqlite, apprise, async-lru, click, expiring-dict, python-dateutil, pyunifiprotect Required-by:

PS C:\Windows\System32> pip install -U unifi-protect-backup Requirement already satisfied: unifi-protect-backup in c:\program files\python\lib\site-packages (0.10.7) Requirement already satisfied: aiolimiter<2.0.0,>=1.1.0 in c:\program files\python\lib\site-packages (from unifi-protect-backup) (1.1.0) Requirement already satisfied: aiorun<2024.0.0,>=2023.7.2 in c:\program files\python\lib\site-packages (from unifi-protect-backup) (2023.7.2) Requirement already satisfied: aiosqlite<0.18.0,>=0.17.0 in c:\program files\python\lib\site-packages (from unifi-protect-backup) (0.17.0) Requirement already satisfied: apprise<2.0.0,>=1.5.0 in c:\program files\python\lib\site-packages (from unifi-protect-backup) (1.7.4) Requirement already satisfied: async-lru<3.0.0,>=2.0.4 in c:\program files\python\lib\site-packages (from unifi-protect-backup) (2.0.4) Requirement already satisfied: click==8.0.1 in c:\program files\python\lib\site-packages (from unifi-protect-backup) (8.0.1) Requirement already satisfied: expiring-dict<2.0.0,>=1.1.0 in c:\program files\python\lib\site-packages (from unifi-protect-backup) (1.1.0) Requirement already satisfied: python-dateutil<3.0.0,>=2.8.2 in c:\program files\python\lib\site-packages (from unifi-protect-backup) (2.8.2) Requirement already satisfied: pyunifiprotect<6.0.0,>=5.0.2 in c:\program files\python\lib\site-packages (from unifi-protect-backup) (5.0.2) Requirement already satisfied: colorama in c:\program files\python\lib\site-packages (from click==8.0.1->unifi-protect-backup) (0.4.5) Requirement already satisfied: typing_extensions>=3.7.2 in c:\program files\python\lib\site-packages (from aiosqlite<0.18.0,>=0.17.0->unifi-protect-backup) (4.3.0) Requirement already satisfied: certifi in c:\program files\python\lib\site-packages (from apprise<2.0.0,>=1.5.0->unifi-protect-backup) (2023.5.7) Requirement already satisfied: requests in c:\program files\python\lib\site-packages (from apprise<2.0.0,>=1.5.0->unifi-protect-backup) (2.31.0) Requirement already satisfied: requests-oauthlib in c:\program files\python\lib\site-packages (from apprise<2.0.0,>=1.5.0->unifi-protect-backup) (1.3.1) Requirement already satisfied: markdown in c:\program files\python\lib\site-packages (from apprise<2.0.0,>=1.5.0->unifi-protect-backup) (3.4.3) Requirement already satisfied: PyYAML in c:\program files\python\lib\site-packages (from apprise<2.0.0,>=1.5.0->unifi-protect-backup) (6.0) Requirement already satisfied: sortedcontainers in c:\program files\python\lib\site-packages (from expiring-dict<2.0.0,>=1.1.0->unifi-protect-backup) (2.4.0) Requirement already satisfied: six>=1.5 in c:\program files\python\lib\site-packages (from python-dateutil<3.0.0,>=2.8.2->unifi-protect-backup) (1.16.0) Requirement already satisfied: aiofiles in c:\program files\python\lib\site-packages (from pyunifiprotect<6.0.0,>=5.0.2->unifi-protect-backup) (22.1.0) Requirement already satisfied: aiohttp in c:\program files\python\lib\site-packages (from pyunifiprotect<6.0.0,>=5.0.2->unifi-protect-backup) (3.8.3) Requirement already satisfied: aioshutil in c:\program files\python\lib\site-packages (from pyunifiprotect<6.0.0,>=5.0.2->unifi-protect-backup) (1.1) Requirement already satisfied: async-timeout in c:\program files\python\lib\site-packages (from pyunifiprotect<6.0.0,>=5.0.2->unifi-protect-backup) (4.0.2) Requirement already satisfied: dateparser in c:\program files\python\lib\site-packages (from pyunifiprotect<6.0.0,>=5.0.2->unifi-protect-backup) (1.1.1) Requirement already satisfied: orjson in c:\program files\python\lib\site-packages (from pyunifiprotect<6.0.0,>=5.0.2->unifi-protect-backup) (3.8.0) Requirement already satisfied: packaging in c:\program files\python\lib\site-packages (from pyunifiprotect<6.0.0,>=5.0.2->unifi-protect-backup) (21.3) Requirement already satisfied: pillow in c:\program files\python\lib\site-packages (from pyunifiprotect<6.0.0,>=5.0.2->unifi-protect-backup) (9.2.0) Requirement already satisfied: pydantic!=1.9.1 in c:\program files\python\lib\site-packages (from pyunifiprotect<6.0.0,>=5.0.2->unifi-protect-backup) (1.10.2) Requirement already satisfied: pyjwt in c:\program files\python\lib\site-packages (from pyunifiprotect<6.0.0,>=5.0.2->unifi-protect-backup) (2.5.0) Requirement already satisfied: typer>0.6 in c:\program files\python\lib\site-packages (from typer[all]>0.6->pyunifiprotect<6.0.0,>=5.0.2->unifi-protect-backup) (0.6.1) Requirement already satisfied: yarl>=1.9 in c:\program files\python\lib\site-packages (from pyunifiprotect<6.0.0,>=5.0.2->unifi-protect-backup) (1.9.4) Requirement already satisfied: shellingham<2.0.0,>=1.3.0 in c:\program files\python\lib\site-packages (from typer[all]>0.6->pyunifiprotect<6.0.0,>=5.0.2->unifi-protect-backup) (1.5.0) Requirement already satisfied: rich<13.0.0,>=10.11.0 in c:\program files\python\lib\site-packages (from typer[all]>0.6->pyunifiprotect<6.0.0,>=5.0.2->unifi-protect-backup) (12.5.1) Requirement already satisfied: idna>=2.0 in c:\program files\python\lib\site-packages (from yarl>=1.9->pyunifiprotect<6.0.0,>=5.0.2->unifi-protect-backup) (3.4) Requirement already satisfied: multidict>=4.0 in c:\program files\python\lib\site-packages (from yarl>=1.9->pyunifiprotect<6.0.0,>=5.0.2->unifi-protect-backup) (6.0.2) Requirement already satisfied: attrs>=17.3.0 in c:\program files\python\lib\site-packages (from aiohttp->pyunifiprotect<6.0.0,>=5.0.2->unifi-protect-backup) (22.1.0) Requirement already satisfied: charset-normalizer<3.0,>=2.0 in c:\program files\python\lib\site-packages (from aiohttp->pyunifiprotect<6.0.0,>=5.0.2->unifi-protect-backup) (2.1.1) Requirement already satisfied: frozenlist>=1.1.1 in c:\program files\python\lib\site-packages (from aiohttp->pyunifiprotect<6.0.0,>=5.0.2->unifi-protect-backup) (1.3.1) Requirement already satisfied: aiosignal>=1.1.2 in c:\program files\python\lib\site-packages (from aiohttp->pyunifiprotect<6.0.0,>=5.0.2->unifi-protect-backup) (1.2.0) Requirement already satisfied: pytz in c:\program files\python\lib\site-packages (from dateparser->pyunifiprotect<6.0.0,>=5.0.2->unifi-protect-backup) (2022.2.1) Requirement already satisfied: regex!=2019.02.19,!=2021.8.27,<2022.3.15 in c:\program files\python\lib\site-packages (from dateparser->pyunifiprotect<6.0.0,>=5.0.2->unifi-protect-backup) (2022.3.2) Requirement already satisfied: tzlocal in c:\program files\python\lib\site-packages (from dateparser->pyunifiprotect<6.0.0,>=5.0.2->unifi-protect-backup) (4.2) Requirement already satisfied: pyparsing!=3.0.5,>=2.0.2 in c:\program files\python\lib\site-packages (from packaging->pyunifiprotect<6.0.0,>=5.0.2->unifi-protect-backup) (3.0.9) Requirement already satisfied: urllib3<3,>=1.21.1 in c:\program files\python\lib\site-packages (from requests->apprise<2.0.0,>=1.5.0->unifi-protect-backup) (2.0.3) Requirement already satisfied: oauthlib>=3.0.0 in c:\program files\python\lib\site-packages (from requests-oauthlib->apprise<2.0.0,>=1.5.0->unifi-protect-backup) (3.2.2) Requirement already satisfied: commonmark<0.10.0,>=0.9.0 in c:\program files\python\lib\site-packages (from rich<13.0.0,>=10.11.0->typer[all]>0.6->pyunifiprotect<6.0.0,>=5.0.2->unifi-protect-backup) (0.9.1) Requirement already satisfied: pygments<3.0.0,>=2.6.0 in c:\program files\python\lib\site-packages (from rich<13.0.0,>=10.11.0->typer[all]>0.6->pyunifiprotect<6.0.0,>=5.0.2->unifi-protect-backup) (2.13.0) Requirement already satisfied: pytz-deprecation-shim in c:\program files\python\lib\site-packages (from tzlocal->dateparser->pyunifiprotect<6.0.0,>=5.0.2->unifi-protect-backup) (0.1.0.post0) Requirement already satisfied: tzdata in c:\program files\python\lib\site-packages (from tzlocal->dateparser->pyunifiprotect<6.0.0,>=5.0.2->unifi-protect-backup) (2022.4)