Closed kitleyn closed 11 months ago
This is a tricky problem to solve, something has clearly gone horribly wrong with unifi protect.
What I think I will do is as some sort of maximum event length setting that defaults to say 2h, anything longer will get ignored. If users want longer events they can change the setting.
Implemented a maximum length option in v0.10. Please comment back if you still have issues
Description
During my initial upload of historic events I noticed that two events were causing the container to run out of memory and crash. Logs showed the below entries. Both are Ring events from a G4 doorbell and seem to last an unusually long time (34.5hrs and 4.55hrs respectively). I assume this is a Unifi bug causing them to be this long but open to feedback. From some quick calculations, I estimate these files to be ~26.5GiB and ~3.5GiB respectively which is obviously far too big to load into the buffer and also exceeds both the memory allocations of my Docker container and the disk space of the host. How could these rogue events be excluded and/or alerted from unifi-protect-backup in the future through some file size limit or duration limit? Has anybody else seen these types of long running events from Unifi Protect API?
Many thanks
What I Did
To force skip these files/events, I stopped the container, edited the sqlite DB to include the ID and associated data of the entries and then restarted. This prevented them from being uploaded but was a manual process.