Somehow all mp4 files in s3 storage are removed after a few days

We enabled “s3 uploads”, everything works fine until we enabled “mp4” as another “authorized extensions” - every mp4 files are missing after a few days.

The url looks like this: https://{bucket_name}}.mp4

it definitely works on the first day, but after a few days, they are gone!

What could go wrong there?

When did you last update Discourse? There has been a bug in the last few weeks relating to uploads, which is now fixed.


v2.0.2, I will see if I can update…

I checked recent commits: Search · upload s3 · GitHub

But I couldn’t find anything related to this bug after v2.02…

Is your Discourse instance public? And if so, would you be happy to post a link to the site? (Or PM it to me if you prefer)


Unfortunately, it is not public.

We do massive update every few months. I hope can I find a commit to cherry-pick.

If you search for “Uploads”, you will find many commits (the bug isn’t specific to S3).

There have been a lot of changes since 2.0.5. It might be possible for you to cherry pick the correct commits, but I wouldn’t recommend it. The best course of action would be to update to the latest version.

:warning: If you really cannot do that, you could disable the “clean up uploads” setting to prevent anything being deleted from S3. However, this is risky because when you do upgrade you will need to “rebake” all your posts before re-enabling the setting. Otherwise you will risk losing all your uploads.


I would highly recommend you re-evaluate your internal practices or seek paid hosting. Pick a Discourse branch (beta, stable of tests passed) extract all your custom code into plugins.