User cannot use custom avatar with Amazon S3

Can anyone repro this on http://try.discourse.org or here on meta?

Cannot repro on both.
Info that may help:

  • All uploaded files are stored on S3 before 1.3.0beta.
  • discourse site uses HTTPS
  • After upgraded to 1.3.0 beta, if user tries to upload custom avatar it seems that the image is successfully uploaded but the image is not applied to avatar. Log and trace can be found in previous posts. This bug happens no matter we use S3 or local storage to store the uploaded files.
  • Previously uploaded images in posts can be shown correctly.

Hope this helps.

4 Likes

Actually this is fixed in 1.3.0.beta2. It appeared to be unchanged when uploading a profile pic but after inspecting the javascript console I realized there was a different error related to CORS, after enabling on my S3 bucket it works fine. The previous script error was the one discussed in: Avatar upload not working.

1 Like

We are running v1.3.0.beta2+9 and have been updating in desperate hopes of this being fixed but it persists. Backgrounds on profiles are broken too.

This is a major bug. It was difficult to find anything on these Meta forums about it using search. This seems to be game-breaking, in my opinion and should have major attention.

2 Likes

we, at 1.3.0.beta2+7, hoped the bug had been fixed. but not.
we found a temporary fix:
if you modify your profile picture a little bid, like resizing, and upload the new profile picture, then the new one will be able to be used.

We guess what happens is the following:
the discourse system takes the uploaded picture and saves it somewhere, but for some reason it loses access to the picture. Since discourse system knows the pictureā€™s existing and it just refuses to take the re-uploaded picture. Then users cannot reset their profile picture.

1 Like

Are you sure itā€™s the same exact error? Mine was definitely fixed with the beta2 release.

I strongly recommend you disable S3 images we are definitely going to remove this feature.

Instead I would prefer to focus efforts on a process from moving off s3 images. (rebaking and transferring images locally)

Thereā€™s a rake task for that, but itā€™ll require some :heart: since it hasnā€™t been used much nor has it been updated in a whileā€¦

2 Likes

@sam, Iā€™m not sure I understand. Are you saying disable S3 across the board? I see no feature or setting to store avatars on the web/discourse server while placing attachments on S3.

Are you suggesting that Discourse forums put all attachments on their web servers? That seems like a disaster. What am I missing?

Yes that is what I am suggesting, S3 support has been a nightmare for us, we often need to resize images and the code required to do so becomes significantly more complex when the source of truth is in the cloud. We keep hitting support issues here for a feature we do not even use for any of our customers.

Instead:

If you want performance, add a origin pull CDN, many companies provide this, including amazon.

If you want reliability set up automatic backups, which you can even send to amazon.

1 Like

We will also help anyone affected by this S3 issue, whether they are paying customers or not. Since we are withdrawing the feature.

(However, we will prioritize helping nice and patient people ;))

3 Likes

What about attachments? They donā€™t change often and seem like a good fit for S3.

Wouldnā€™t it be possible to split the functionality and keep attachments as S3 if enabled, while avatars would always be local?

If you use attachments heavily, I could see that being a problem long term, as eventually you would run out of disk space and need to upgrade. It could get out of hand. Not to mention S3 is purpose built for that type of use case.

2 Likes

Probably kick that to plugin and make sure the hooks are there.

1 Like

This. Iā€™m in the process of migrating a photo-heavy forum, my users build stuff and love to share pics. S3 would have been perfect. As it is, Iā€™m now imposing a 1 MB file size limit to make things fit, but even at that it wonā€™t last forever.

Origin pull is great for speed but it doesnā€™t alleviate storage issues.

On the other hand I know Iā€™m an edge case, most forums arenā€™t heavily image based. I completely understand why you guys are removing S3 support - still, Iā€™m sad to see it go.

The main issue with S3 is not that we have code to handle another storage is that there are a lot of differences between a local storage and an external storage. We do our best to properly resize and optimize images to make sure we donā€™t waste bandwidth and this is making external storage a PITA to deal with.

Like @sam said, we are deprecating S3 because none of our paying customers are using it. This is impacting the quality of that feature and itā€™s generating more support requests than we can deal with.

That said, it might not be permanent. Iā€™ve had on my mind for a while now to replace our custom file handling with a library like refile which support different backends.

9 Likes

Actually I spoke too soon. Discourse is now pointing to a transparent 1x1px image after uploading the custom avatar image. It was working for a while but just out the blue it quit working. I have disabled S3 uploads but it has no affect, still the same.

I went to the admin and looked at the users and I noticed many of the users are showing this same problem:

Any idea on what happened?

@codinghorror

Weird, they randomly started working again:

Probably a scheduled job kicking in.

FYI: refileā€™s local storage backend doesnā€™t support partitions

And also need to wrap a library for process through its rack appā€¦

Ouch. This is a nasty little problem for us and probably for others to. Would love to hear more updates about how the transition away from S3 will happen.