Somehow I keep having issues with avatars. I’m on the last version (v2.2.0.beta3 +3).
This is something noticed a few weeks ago but I’m only having the time to debug now. At first, I thought it could be a problem with the customizations I did through my theme plugin, but I don’t think that’s the case.
Some images show up but some others don’t. Has anyone seem something like that?
Here’s an example of an image that should be showing up (both urls seem correct): https://app.thewatercooler.io/user_avatar/app.thewatercooler.io/tammycravit/45/1089_1.png
And here’s another one that works: https://app.thewatercooler.io/user_avatar/app.thewatercooler.io/robertwilliams/45/1456_1.png
I think the problem might be related to Gravatar. I’m checking the database and looks like the users where the images are not showing up are the ones that Discourse is trying to download from Gravatar (with no success).
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.
I also noticed that the reference that discourse has for the file is not the same URL that I can get from the bucket itself. For example, this the link I get from S3 directly (using their UI):
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.
If you think having some Gravatar images might help, here’s a list of the one that I noticed the issue:
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.
Yeah, I had to change after one of the last updates (I explained what happened here Avatar upload failing)
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.