Oh, makes indeed more sense
You could check locally with any ssh client that you like, depending on your setup, the files should be in something like /var/discourse/shared/standalone/uploads/default/original/2X/
so you might ls -R /var/discourse/shared/standalone/uploads/ | grep 4064b to find the 4064b…d.png
Talking about the same Discourse instance as @masterakay here.
We switched over to s3 over 2 years ago, none of the files in the local uploads directory are newer than 2018.
As I understand, images are uploaded in the “original” folder, and processed (cropped, reduced in size, etc.) and put in the “optimized” folder. The URLs used by discourse when uploading images are still from the “/original/1X/” folder. Somehow, with the upgrade, the “1X” folder is gone.
There’s a “default” folder which as a lot of uploads (images, etc.) as well as cropped versions. There are about 10k files here making it ~2.5 GB.
The problem is the image URL in the posts always have the “original” one.
Something we noticed is that the missing files are a subset of the files in the “default” folder.
New uploads work without issues and are stored in “/original/2X/”.
Does anyone have ideas where the “/original/1X/” folder may have gone and if it possible to bring it back?
The problem happened because those settings are not supposed to be the same value – search the setup topic for the line “Do I really need to use separate buckets for uploads and backups?”
A maintenance job ran on the contents of the backup bucket and affected the uploads because their values overlapped.
@sam we should probably enforce that in code, not just documentation
To fix up your site, there’s two steps:
First, you’ll need to change the backups prefix – adding /backups to the end as described in the setup topic, is sufficient.
After, move everything in the S3 bucket back into the correct place. Everything in the top “default” folder should get put back at the top level.
E.g. there’s probably “default/originals” folder there which should be moved up.
You’ll have to use the AWS web console or some other tool to browse the bucket.
Hey @schleifer that makes sense and added the backups prefix to the bucket name.
As for the existing uploads, all the uploads are in /default/ (not in sub-folders). The image urls in posts (and everywhere else) use /original/* or /optimized/*.
If we move everything in the default folder up one level (to the root), then the images will be in /*.
And no, there aren’t any folders within defaults, just upload files. It seems to contain files with standard 40-char hash filename as well as some with suffixes like “_2_10x10” (which I presume are from optimized).
How do you suggest fixing this? Fixing all posts with new links will take time. Is it possible to somehow group the files in the correct folders based on this filename?