Running the rake tasks had no results. I will try to debug more tomorrow.
Does Upload.find(1282) return an upload record?
Thanks for replying. Yes, it does and the file exists in the bucket too.
@sam updating from Beta to Stable now and I'll post back here in a bit. Should I run the rake tasks to refresh everything again?
Hmm that is the problem here. I'll have a look at this tomorrow to see if I can reproduce with the given image.
Thank you so much! I'm now updating to get Sam's commit and will run the rake tasks to refresh again, and see what happens.
The problem seems to be widespread actually. Now I'm on tests-passed branch, and I ran both refresh and clean rake tasks, but no luck. The weird thing is that I'm also noticing the same issue with some users that have custom_uploads as well. The ones with custom uploads have optimized_images, but deleting them has no effect either.
But that's not the S3 endpoint I have set on my settings page (I have the default). I just changed my s3 endpoint to https://s3-us-west-2.amazonaws.com but no luck either.
Did you happen to reconfigure SiteSetting.s3_region recently? It looks like that site setting has been configured to be us-east-1 when it should be us-west-2.
https://thewatercooler.s3.dualstack.us-west-2.amazonaws.com/original/2X/d/de05564186252ab863d84df88dc83bfa45b0dd70.jpeg works while https://thewatercooler.s3.dualstack.us-east-1.amazonaws.com/original/2X/d/de05564186252ab863d84df88dc83bfa45b0dd70.jpeg doesn't.
I'm gonna write a rake task to update all the images. I wasn't sure if changing the region could have affected it since it always worked before the other thread.
I will post my gist with my script to update the images in a bit to maybe help others in the future.
Does that mean the region was incorrectly set initially before it was corrected? You can remap the URLs with bundle exec script/discourse remap //thewatercooler.s3.dualstack.us-east-1.amazonaws.com //thewatercooler.s3.dualstack.us-west-2.amazonaws.com. Please take a backup before running that in case it doesn't remap correctly.
Awesome, will run the script now. I don't understand what happened. I never touched the bucket settings on Discourse and my bucket was always west. For some reason it worked before. What I'm noticing is that images stored under 1x don't use the dualstack url format and all my old uploads are 1x. Don't know if something changed in the code recently that could have affected that.
All the 1X urls work independent of the region but the 2X ones have the region on the url.
Does OnceoffLog.where(job_name: "CorrectMissingDualstackUrls") return anything for you?
Running Remap and the rake tasks to refresh and clean the avatars solved the problem.
Just curious, which rake tasks did you run?