Avatars not Uploading to S3

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

2 Likes

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:

1 Like

Any ideas here @vinothkannans?

1 Like

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

https://github.com/discourse/discourse/blob/master/config/routes.rb#L479

2 Likes

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.

1 Like

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

3 Likes

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.