Problem with file attachments


#1

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:
/forum/uploads/default/original/1X/87e1ab068c9032f0d67d3fc004ff72c4d4a7aaed.jpg

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:
/forum/uploads/default/original/1X/3010fecd22455b030e3aca1fe64cce64de9a335d.jpeg

(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:

Suggestions?

Thank you,

Stephen


(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.


#5

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

SiteSetting.clean_up_uploads=false

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).