Avatar uploading issue

AI-generated summary

The discussion revolves around an issue with uploading custom avatars in Discourse version 2.5.0.beta2. fb9572a reports that the image uploads successfully to an S3 bucket but fails to save after clicking the save button. The user provides screenshots and details of the issue, including the fact that the image can be accessed directly via the S3 CDN URL.

fb9572a shares admin logs showing the issue and has two questions about asset handling. sam suggests checking if the issue is reproducible on meta.discourse.org, which also uses S3 for uploads. fb9572a reports that the issue is not present on meta.discourse.org, but notes a difference in CDN setup (Cloudflare vs S3 CDN).

sam suggests that the CDN setup might not be the cause of the issue and recommends configuring an S3 CDN. fb9572a clarifies that they are already using an S3 CDN, which works fine for topic images, but not for saving profile pictures. fb9572a shares a link to a similar issue on meta.discourse.org and requests sam to take a look.

Hi there,

I got this problem when uploading a custom image as avator. it is uploaded successfully and can be seen in the popup modal. It’s been upload to s3 bucket and can been seen. However after I click save button, it’s not been saved i guess. Please check the screenshots.

version: 2.5.0.beta2
firefox: lastest
The file upload to S3 and working fine(I can upload image in the topic)

==== Edit ====

I did testing on local env, and found that:
with S3 bucket upload setting enabled, also s3 cdn linked to this bucket, I can upload custom avatar to:
https://xxxxx.cloudfront.net/original/1X/e5d9f57e882bfa7e85c8e1e5c2a6ca256ea15eb7.jpeg

However after click the saving button, the user preference page trying to get avator from
https://xxxx.cloudfront.net/user_avatar/xxxxxx

But I didn’t find this user_avatar folder from s3 bucket.

Thanks

There are some timing issues there, if you fully refresh the page does it self correct?

Are you able to reproduce the issue on meta.discourse.org … we also use s3 for uploads.

Thanks Sam. I just looked into the admin logs and see this.

I have 2 questions:

  1. it’s not reading asset by cdn url here, but it works on topic images.
  2. I manually open this asset, it works fine.

@sam I will try to check here.

its fine here.
emm.. I may missed something.

One difference is here (meta.discourse.org) is by cloudflare, and I did it by s3 cdn.

cloudfront, we use a CDN. I doubt it matters though.

It is worth configuring a CDN anyway, they are very cheap and cut down on traffic costs a lot, perhaps configure an s3 CDN?

Yes we are already uploading images to s3 bucket and have s3 cdn pointing to it. This works fine in the topics. Just don’t know why during saving it can’t fetch the image.

Can´t save profile picture this similar to my situation.
do you mind have a look please @sam