# User cannot use custom avatar with Amazon S3

**URL:** https://meta.discourse.org/t/user-cannot-use-custom-avatar-with-amazon-s3/25583
**Category:** Bug
**Created:** [2월 23, 2015, 9:22오후 UTC](https://meta.discourse.org/t/user-cannot-use-custom-avatar-with-amazon-s3/25583 "2015-02-23T21:22:33Z")
**Posts on this page:** 20
**Page:** 2

<div class="post-metadata">

### Author: ![codinghorror](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/codinghorror/32/110067_2.png) [@codinghorror](https://meta.discourse.org/u/codinghorror)
#### Post date: [2월 28, 2015, 1:24오전 UTC](https://meta.discourse.org/t/user-cannot-use-custom-avatar-with-amazon-s3/25583/21 "2015-02-28T01:24:50Z")

</div>

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

---

<div class="post-metadata">

### Author: ![franklyn](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/franklyn/32/39199_2.png) [@franklyn](https://meta.discourse.org/u/franklyn)
#### Post date: [2월 28, 2015, 3:30오전 UTC](https://meta.discourse.org/t/user-cannot-use-custom-avatar-with-amazon-s3/25583/22 "2015-02-28T03:30:05Z")

</div>

> [@codinghorror](#):
>
> Can anyone repro this on [http://try.discourse.org](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.

---

<div class="post-metadata">

### Author: ![sethd](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sethd/32/121999_2.png) [@sethd](https://meta.discourse.org/u/sethd)
#### Post date: [3월 3, 2015, 2:57오후 UTC](https://meta.discourse.org/t/user-cannot-use-custom-avatar-with-amazon-s3/25583/24 "2015-03-03T14:57:09Z")

</div>

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](https://meta.discourse.org/t/avatar-upload-not-working/20075/24).

---

<div class="post-metadata">

### Author: ![Vocino](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/vocino/32/85136_2.png) [@Vocino](https://meta.discourse.org/u/Vocino)
#### Post date: [3월 4, 2015, 4:03오후 UTC](https://meta.discourse.org/t/user-cannot-use-custom-avatar-with-amazon-s3/25583/25 "2015-03-04T16:03:41Z")

</div>

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.

---

<div class="post-metadata">

### Author: ![czhou1801](https://avatars.discourse-cdn.com/v4/letter/c/8baadc/32.png) [@czhou1801](https://meta.discourse.org/u/czhou1801)
#### Post date: [3월 4, 2015, 4:28오후 UTC](https://meta.discourse.org/t/user-cannot-use-custom-avatar-with-amazon-s3/25583/26 "2015-03-04T16:28:46Z")

</div>

> [@Vocino](#):
>
> We are running v1.3.0.beta2+9

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.

---

<div class="post-metadata">

### Author: ![sethd](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sethd/32/121999_2.png) [@sethd](https://meta.discourse.org/u/sethd)
#### Post date: [3월 4, 2015, 4:35오후 UTC](https://meta.discourse.org/t/user-cannot-use-custom-avatar-with-amazon-s3/25583/27 "2015-03-04T16:35:11Z")

</div>

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

---

<div class="post-metadata">

### Author: ![sam](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sam/32/102149_2.png) [@sam](https://meta.discourse.org/u/sam)
#### Post date: [3월 4, 2015, 10:23오후 UTC](https://meta.discourse.org/t/user-cannot-use-custom-avatar-with-amazon-s3/25583/28 "2015-03-04T22:23:07Z")

</div>

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)

---

<div class="post-metadata">

### Author: ![zogstrip](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/zogstrip/32/512781_2.png) [@zogstrip](https://meta.discourse.org/u/zogstrip)
#### Post date: [3월 4, 2015, 10:25오후 UTC](https://meta.discourse.org/t/user-cannot-use-custom-avatar-with-amazon-s3/25583/29 "2015-03-04T22:25:40Z")

</div>

> [@sam](#):
>
> 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](https://github.com/discourse/discourse/blob/master/lib/tasks/uploads.rake#L22-L79) for that, but it’ll require some ❤ since it hasn’t been used much nor has it been updated in a while…

---

<div class="post-metadata">

### Author: ![Vocino](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/vocino/32/85136_2.png) [@Vocino](https://meta.discourse.org/u/Vocino)
#### Post date: [3월 5, 2015, 12:00오전 UTC](https://meta.discourse.org/t/user-cannot-use-custom-avatar-with-amazon-s3/25583/30 "2015-03-05T00:00:00Z")

</div>

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

---

<div class="post-metadata">

### Author: ![sam](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sam/32/102149_2.png) [@sam](https://meta.discourse.org/u/sam)
#### Post date: [3월 5, 2015, 12:10오전 UTC](https://meta.discourse.org/t/user-cannot-use-custom-avatar-with-amazon-s3/25583/31 "2015-03-05T00:10:52Z")

</div>

> [@Vocino](#):
>
> 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.

---

<div class="post-metadata">

### Author: ![codinghorror](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/codinghorror/32/110067_2.png) [@codinghorror](https://meta.discourse.org/u/codinghorror)
#### Post date: [3월 5, 2015, 1:23오전 UTC](https://meta.discourse.org/t/user-cannot-use-custom-avatar-with-amazon-s3/25583/32 "2015-03-05T01:23:52Z")

</div>

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 ;))

---

<div class="post-metadata">

### Author: ![chapel](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/chapel/32/122414_2.png) [@chapel](https://meta.discourse.org/u/chapel)
#### Post date: [3월 5, 2015, 2:29오전 UTC](https://meta.discourse.org/t/user-cannot-use-custom-avatar-with-amazon-s3/25583/33 "2015-03-05T02:29:15Z")

</div>

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.

---

<div class="post-metadata">

### Author: ![codinghorror](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/codinghorror/32/110067_2.png) [@codinghorror](https://meta.discourse.org/u/codinghorror)
#### Post date: [3월 5, 2015, 2:44오전 UTC](https://meta.discourse.org/t/user-cannot-use-custom-avatar-with-amazon-s3/25583/34 "2015-03-05T02:44:12Z")

</div>

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

---

<div class="post-metadata">

### Author: ![ky\_metro](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/ky_metro/32/42807_2.png) [@ky\_metro](https://meta.discourse.org/u/ky_metro)
#### Post date: [3월 5, 2015, 2:50오전 UTC](https://meta.discourse.org/t/user-cannot-use-custom-avatar-with-amazon-s3/25583/35 "2015-03-05T02:50:00Z")

</div>

> [@chapel](#):
>
> 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.

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.

---

<div class="post-metadata">

### Author: ![zogstrip](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/zogstrip/32/512781_2.png) [@zogstrip](https://meta.discourse.org/u/zogstrip)
#### Post date: [3월 5, 2015, 3:50오후 UTC](https://meta.discourse.org/t/user-cannot-use-custom-avatar-with-amazon-s3/25583/36 "2015-03-05T15:50:00Z")

</div>

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](https://github.com/refile/refile) which support different backends.

---

<div class="post-metadata">

### Author: ![sethd](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sethd/32/121999_2.png) [@sethd](https://meta.discourse.org/u/sethd)
#### Post date: [3월 7, 2015, 5:17오후 UTC](https://meta.discourse.org/t/user-cannot-use-custom-avatar-with-amazon-s3/25583/37 "2015-03-07T17:17:38Z")

</div>

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.

![](https://global.discourse-cdn.com/meta/original/3X/d/2/d23dd8b35355ffa799910dcbc921f5573e5bc0c4.png)

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

 ![](https://global.discourse-cdn.com/meta/original/3X/0/4/04193de2ab7a3359ec59e0adc4a72c2cb5ca795d.png) 

Any idea on what happened?

@codinghorror

---

<div class="post-metadata">

### Author: ![sethd](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sethd/32/121999_2.png) [@sethd](https://meta.discourse.org/u/sethd)
#### Post date: [3월 7, 2015, 5:42오후 UTC](https://meta.discourse.org/t/user-cannot-use-custom-avatar-with-amazon-s3/25583/38 "2015-03-07T17:42:07Z")

</div>

Weird, they randomly started working again:

 ![](https://global.discourse-cdn.com/meta/original/3X/a/4/a4c3f944e865cb5f122f12662b56f1748ea89251.png)

---

<div class="post-metadata">

### Author: ![riking](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/riking/32/170938_2.png) [@riking](https://meta.discourse.org/u/riking)
#### Post date: [3월 7, 2015, 5:51오후 UTC](https://meta.discourse.org/t/user-cannot-use-custom-avatar-with-amazon-s3/25583/39 "2015-03-07T17:51:28Z")

</div>

Probably a scheduled job kicking in.

---

<div class="post-metadata">

### Author: ![fantasticfears](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/fantasticfears/32/119608_2.png) [@fantasticfears](https://meta.discourse.org/u/fantasticfears)
#### Post date: [3월 8, 2015, 5:11오후 UTC](https://meta.discourse.org/t/user-cannot-use-custom-avatar-with-amazon-s3/25583/40 "2015-03-08T17:11:59Z")

</div>

FYI: refile’s local storage backend doesn’t support partitions

And also need to wrap a library for process through its rack app…

---

<div class="post-metadata">

### Author: ![NomNuggetNom](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/nomnuggetnom/32/122685_2.png) [@NomNuggetNom](https://meta.discourse.org/u/NomNuggetNom)
#### Post date: [3월 17, 2015, 3:04오전 UTC](https://meta.discourse.org/t/user-cannot-use-custom-avatar-with-amazon-s3/25583/41 "2015-03-17T03:04:52Z")

</div>

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.

[이전 페이지](https://meta.discourse.org/t/user-cannot-use-custom-avatar-with-amazon-s3/25583.md?page=1)

[다음 페이지](https://meta.discourse.org/t/user-cannot-use-custom-avatar-with-amazon-s3/25583.md?page=3)
