Does anyone have some suggestions how should I go about investigating Discourse losing old uploads?

AI-generated summary

MerryMinstrel is seeking help to investigate missing old uploads on their Discourse forum. They discovered that uploaded pictures from as far back as 2015 are no longer available, despite being stored on S3. The issue appears to be intermittent, with some old uploads still intact, but no clear age cutoff. To debug the issue, MerryMinstrel wants to:

  • Assess the scale of the damage and determine the number of missing files
  • Check for upload deletion logs
  • Verify if files are actually deleted or just moved to a different path in the S3 bucket
  • Identify the trigger for file deletion by Discourse
  • Implement safeguards to prevent future file loss

Recently in my forum I opened a topic I created in 2015 and to my dismay I noticed that uploaded pictures are gone. I did connect to S3 and checked the file paths, no files to be found. So either files are gone of the paths are not correct.

Potentially years worth of posting are gone and I had no idea. As far as I can see some of the old uploads are gone, but not all, and there does not seem to be clear age cutoff. For instance a topic from 2015 has all of its uploads in the first post, but one of the comments has a missing upload.

I would greatly appreciate if somebody could point me in the right direction on how to debug this as I’m not that well versed in Discourse or S3.

Right now my thought process is:

  • Can I asses scale of the damage - how many missing files are displayed in the forum?
  • Are there any upload deletion logs somewhere?
  • Are files actually gone or just moved to a different path in the S3 bucket?
  • If files are being deleted by Discourse, what triggers it?
  • Can I put in any safeguards for it not to happen in the future?