Avatars not Uploading to S3

AI-generated summary

The user markersocial reports issues with avatar uploads not properly migrating to S3 despite successful migration of other uploads. Although new avatar uploads appear to go to S3 initially, the final saved references revert to local URLs. vinothkannans clarifies that the avatars are still stored on S3 and that the local URLs are dynamic proxy URLs used for serving avatars in various sizes. The difference in CDN behavior between meta.discourse.org and the user’s forum is explained as a result of separate CDN configurations for local assets and S3 content.

So I migrated to using S3 for uploads a few months back for one forum. Overall it seemed like a success.

  • Uploads from new posts are going to S3 perfect
  • Migration of old uploads from posts to S3 worked fine using rake uploads:migrate_to_s3
  • Existing avatars did not migrate
  • New avatar uploads are not going to S3
  • New user background and card background images are uploading to S3 perfectly fine

In attempt to fix the problem. I tried running rake avatars:refresh and avatars:clean after following this thread: Problems with avatar uploads due to S3 changes - #21 by Daniel_Lopes. I also tried running rake uploads:migrate_to_s3 again. Didn’t solve the issue though.

Anyone know what I could be missing? :face_with_monocle:

Another observation: I just noticed when I upload a new avatar, the image does successfully upload to s3. I can inspect element prior to saving and see that the url is a s3 (via cdn) url and it works fine. After I save however, all references to the avatar are for a local image (which also works). :orangutan:

Any ideas here @vinothkannans?

@markersocial your avatar uploads are still serving from the S3 storage only. The local URL which appears in the UI is a dynamic proxy URL which used to serve the avatars in many custom sizes.

Thanks @vinothkannans, appreciate it! Really good to know.

I did notice though, when I inspect avatars in a thread on meta.discourse.org I see a cdn url. When I do the same on the other forum (that has a cdn configured for s3), I get a local url. Not sure if that’s a concern.

Because we have a separate CDN for local urls and assets.