[Support]: Frigate does not delete recording DB entries when it should #19524
Checklist
Describe the problem you are havingMy mask/zones were not properly configured, and so Frigate saved way too many clips and recordings. I deleted excess clips and recordings, and restarted frigate. Frigate didn't prune the corresponding records from the database.
I understand that Frigate is trying to be defensive here, but I don't think it should. Alternatively, provide the user with some way of triggering the pruning manually. (minor issue) The warning message should say "64%" not "0.636..%". Steps to reproduce
sudo find clips -type d -mtime +7 -delete
sudo find recordings -type d -mtime +7 -exec rm -rf "{}" \;
Version0.16.0 Release Candidate 4 In which browser(s) are you experiencing the issue with?Mozilla Firefox 131.0b9 Frigate config filen/adocker-compose file or Docker CLI commandn/aRelevant Frigate log output2025-08-15 08:31:13.327834970 [2025-08-15 08:31:13] frigate.record.util INFO : Deleting 114398 recording DB entries with missing files
2025-08-15 08:31:13.336716389 [2025-08-15 08:31:13] frigate.record.util WARNING : Deleting 0.636960% of recordings DB entries, could be due to configuration error. Aborting.Relevant go2rtc log outputn/aOperating systemOther Linux Install methodDocker Compose Network connectionWired Camera make and modeln/a Screenshots of the Frigate UI's System metrics pagesn/a Any other information that may be helpfulNo response |
Replies: 5 comments 2 replies
It absolutely should, there are plenty of cases where a NAS isn't online when it should be, or any other number of situations that would lead to the entire DB being wiped if it did not work this way. There is no harm in these entries staying in the DB and they will be cleaned up naturally, or you can run a SQL command manually if that is preferred. The warning you see
is specifically for the sync_recordings feature. Frigate still runs its usual cleanup logic |
This is not a bug, rather it is intentional behavior to prevent users who have misconfigured Frigate from losing a large number of their recordings. It's not something we want to change. I will put up a fix for the decimal place issue. We don't recommend manual pruning. The UI allows manual deletion of tracked objects from the Review and Explore pane. Recordings would then be automatically cleaned up by the recording maintainer. |
@NickM-27 I thought the sync recording feature's purpose was to delete DB records if the files don't exist on the disk. "Ask AI" on the docs site suggests I had the wrong idea:
But, then there's this comment:
And the comment in the reference config:
I guess this feature doesn't work as I thought it did. Fair enough. What is it for, then? Is the "Ask AI" response correct? I think the comment in the reference doc should be updated accordingly. |
|
Ok, thanks! I appreciate the clarification. Feel free to close this discussion. |
It absolutely should, there are plenty of cases where a NAS isn't online when it should be, or any other number of situations that would lead to the entire DB being wiped if it did not work this way. There is no harm in these entries staying in the DB and they will be cleaned up naturally, or you can run a SQL command manually if that is preferred.
The warning you see
is specifically for the sync_recordings feature. Frigate still runs its usual cleanup logic