Files storage is growing

Our files storage is growing and growing. We will hit our 1TB disk limit soon.
How to prune old files?

We run

docker-compose --file ./docker-compose.yml exec worker sentry cleanup --days 90 -l INFO

regularly, but the files space does not decrease at all.

How to get rid of old files?

--- /var/lib/docker/volumes/sentry-data/_data --------------------------------------------------------------------------------------------------------------------
                         /..
  788.0 GiB [##########] /files
  186.4 MiB [          ] /releasefile-cache
   26.9 MiB [          ] /dsym-cache
   72.0 KiB [          ] /custom-packages

Running Sentry 21.4.037b2bca

Thanks for any hint!

Is there some documentation that makes you think sentry cleanup operates on file storage? What happens if you do something like …

find /var/lib/docker/volumes/sentry-data/_data/files/ -mindepth 1 -mtime +90 -delete

Seems likely that there is some metadata in the database so that hard-deleting files under the hood will leave some orphan records that results in a degraded user experience. Also seems sensible that sentry cleanup would clean up file storage … :thinking:

1 Like

Hi @chadwhitacre ,

we added the manual deletion to our cron job. But yes from a user point of view I would expect that with sentry cleanup everything gets cleaned up :slight_smile:

Kind regards,
Markus

The code for sentry cleanup does include a cleanup_unused_files function. Any clues in there about why this might not be doing the trick for you?