Problem with file attachments


Good day,

We are having problems with user-uploaded file attachments disappearing. The files will appear for a while and then start returning 404s. I have not yet determined how/when they disappear, the one I’m specifically looking at right now was posted 12/17/2017.

The url looks right, like this, but the server returns a 404:

I just tried adding a picture to a post, and it’s displaying correctly. The url for that image (that returns a 200) is this:

(we use a subfolder installation)

I have multiple questions:

  1. What might cause the pictures to “go missing”, and how can I troubleshoot / fix?

  2. I’ve been having random problems with user uploaded images not working. Would you recommend moving to a subdomain installation instead of a subfolder install (it doesn’t seem to be the issue since it appears that the actual file is missing and not that there is a problem with the URL).

  3. Would it be more stable to move to using S3 for user images? This post by @codinghorror suggests that it’s NOT a good idea:

But then this later post by @zogstrip says that the meta site’s images WERE moved to S3:


Thank you,


(Alan Tan) #4

You can try running the following commands to see which uploads are missing:

./launcher enter app
rake uploads:missing

Once you have an idea of what is missing, you can try to look for them in the tombstone folder /var/www/discourse/public/uploads/default/tombstone.


Thanks @tgxworld. I’ll take a look at that.

Any suggestions on why this would be happening and/or if we would have more or less problems if I moved uploads to S3?

(Jay Pfaffman) #6

In the meantime, you might set


That will keep more images from getting deleted (though it increases the chance that someone will use your site to serve images you don’t want them do).