# Caricamento avatar non riuscito

**URL:** https://meta.discourse.org/t/avatar-upload-failing/96880
**Category:** Bug
**Created:** [10 Settembre 2018, 6:28pm UTC](https://meta.discourse.org/t/avatar-upload-failing/96880 "2018-09-10T18:28:36Z")
**Posts on this page:** 16
**Page:** 1

<div class="post-metadata">

### Author: ![Daniel\_Lopes](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/daniel_lopes/32/374589_2.png) [@Daniel\_Lopes](https://meta.discourse.org/u/Daniel_Lopes)
#### Post date: [10 Settembre 2018, 6:28pm UTC](https://meta.discourse.org/t/avatar-upload-failing/96880/1 "2018-09-10T18:28:36Z")

</div>

I’m not sure this is a bug with the last version (2.1.0.beta6) or if it’s something with my installation yet, but I’m posting here until I figure it out.

When I upload a custom avatar image I’m getting this error:

 ![39%20AM](https://global.discourse-cdn.com/meta/original/3X/e/3/e37f36e06505e3c1dec538db5b5656af549680af.png)

Have you guys seem this before?

Thanks.

---

<div class="post-metadata">

### Author: ![Daniel\_Lopes](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/daniel_lopes/32/374589_2.png) [@Daniel\_Lopes](https://meta.discourse.org/u/Daniel_Lopes)
#### Post date: [10 Settembre 2018, 9:42pm UTC](https://meta.discourse.org/t/avatar-upload-failing/96880/2 "2018-09-10T21:42:45Z")

</div>

Trying to see if the issue could be the region of the upload. I thought this setting was optional, but I’m changing it now just to see if something could have changed (my bucket is us-west and the log is showing us-east as the site setting was set to us-east).

---

<div class="post-metadata">

### Author: ![Daniel\_Lopes](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/daniel_lopes/32/374589_2.png) [@Daniel\_Lopes](https://meta.discourse.org/u/Daniel_Lopes)
#### Post date: [10 Settembre 2018, 10:09pm UTC](https://meta.discourse.org/t/avatar-upload-failing/96880/3 "2018-09-10T22:09:01Z")

</div>

Somehow changing the region doesn’t seem to reflect on the uploads. The log still points to us-east1 even after chaging to us-west using the admin. Tried rebuilding the container just to make sure but no luck, so far.

---

<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: [10 Settembre 2018, 10:13pm UTC](https://meta.discourse.org/t/avatar-upload-failing/96880/4 "2018-09-10T22:13:46Z")

</div>

Make sure you get the absolute latest version of Discourse (not just beta 6), rebuild, and try again.

---

<div class="post-metadata">

### Author: ![Daniel\_Lopes](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/daniel_lopes/32/374589_2.png) [@Daniel\_Lopes](https://meta.discourse.org/u/Daniel_Lopes)
#### Post date: [10 Settembre 2018, 10:34pm UTC](https://meta.discourse.org/t/avatar-upload-failing/96880/5 "2018-09-10T22:34:11Z")

</div>

Yeah, I can’t figure out what’s going on for now. I will come back to this later today. Basically the error I’m getting is:

```plaintext
/var/www/discourse/vendor/bundle/ruby/2.5.0/gems/logster-1.2.11/lib/logster/logger.rb:94:in `add_with_opts'
/var/www/discourse/vendor/bundle/ruby/2.5.0/gems/logster-1.2.11/lib/logster/logger.rb:51:in `add'
/usr/local/lib/ruby/2.5.0/logger.rb:545:in `error'
/var/www/discourse/app/models/optimized_image.rb:62:in `block in create_for'
/var/www/discourse/app/models/optimized_image.rb:18:in `block (2 levels) in lock'
/var/www/discourse/lib/distributed_mutex.rb:21:in `synchronize'
/var/www/discourse/lib/distributed_mutex.rb:5:in `synchronize'
/var/www/discourse/app/models/optimized_image.rb:17:in `block in lock'
/var/www/discourse/lib/distributed_mutex.rb:21:in `synchronize'
/var/www/discourse/lib/distributed_mutex.rb:5:in `synchronize'
/var/www/discourse/app/models/optimized_image.rb:16:in `lock'
/var/www/discourse/app/models/optimized_image.rb:41:in `create_for'
/var/www/discourse/app/models/upload.rb:64:in `get_optimized_image'
/var/www/discourse/app/controllers/user_avatars_controller.rb:188:in `get_optimized_image'
/var/www/discourse/app/controllers/user_avatars_controller.rb:122:in `show_in_site'
/var/www/discourse/app/controllers/user_avatars_controller.rb:87:in `block (2 levels) in show'
/var/www/discourse/lib/hijack.rb:56:in `instance_eval'
/var/www/discourse/lib/hijack.rb:56:in `block in hijack'
/var/www/discourse/lib/scheduler/defer.rb:70:in `block in do_work'
/var/www/discourse/vendor/bundle/ruby/2.5.0/gems/rails_multisite-2.0.4/lib/rails_multisite/connection_management.rb:63:in `with_connection'
/var/www/discourse/lib/scheduler/defer.rb:68:in `do_work'
/var/www/discourse/lib/scheduler/defer.rb:59:in `block (2 levels) in start_thread'

```

And I made sure I updated everything (first via UI and also via git pull and rebuild) as @codinghorror mentioned.

---

<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: [10 Settembre 2018, 10:58pm UTC](https://meta.discourse.org/t/avatar-upload-failing/96880/6 "2018-09-10T22:58:28Z")

</div>

This looks like a general issue, all your s3 uploads are broken:

I am getting:

```plaintext
The bucket you are attempting to access must be addressed using the specified endpoint. Please send all future requests to this endpoint.

```

What are your s3 settings? (without passwords)

Also… one giant edge case is that you maybe have non functioning, yet available ipv6 in your container.

---

<div class="post-metadata">

### Author: ![Daniel\_Lopes](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/daniel_lopes/32/374589_2.png) [@Daniel\_Lopes](https://meta.discourse.org/u/Daniel_Lopes)
#### Post date: [10 Settembre 2018, 11:07pm UTC](https://meta.discourse.org/t/avatar-upload-failing/96880/7 "2018-09-10T23:07:09Z")

</div>

Yeah, it’s a general issue.

Don’t know if there’s a better way to grab the settings but through the admin I have:

 ![screencapture-app-thewatercooler-io-admin-site_settings-category-all_results-2018-09-10-16_06_05](https://global.discourse-cdn.com/meta/original/3X/a/6/a6372e1e38490ff939c63577f05947303fbd1806.png)

The enforce path style I checked today to see if it could be the issue.

---

<div class="post-metadata">

### Author: ![Daniel\_Lopes](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/daniel_lopes/32/374589_2.png) [@Daniel\_Lopes](https://meta.discourse.org/u/Daniel_Lopes)
#### Post date: [10 Settembre 2018, 11:12pm UTC](https://meta.discourse.org/t/avatar-upload-failing/96880/8 "2018-09-10T23:12:49Z")

</div>

Unchecking force path style solved the widespread issue but no luck with avatars yet.

---

<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: [10 Settembre 2018, 11:23pm UTC](https://meta.discourse.org/t/avatar-upload-failing/96880/9 "2018-09-10T23:23:28Z")

</div>

This is odd, your region is us-west in the screenshot and the errors are from US east, where is the actual bucket?

---

<div class="post-metadata">

### Author: ![Daniel\_Lopes](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/daniel_lopes/32/374589_2.png) [@Daniel\_Lopes](https://meta.discourse.org/u/Daniel_Lopes)
#### Post date: [10 Settembre 2018, 11:28pm UTC](https://meta.discourse.org/t/avatar-upload-failing/96880/10 "2018-09-10T23:28:02Z")

</div>

Bucket is west (oregon) and I can’t get Discourse to recognize the west one. I bet that’s the issue. Gonna try to change directly in the database now.

---

<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: [10 Settembre 2018, 11:28pm UTC](https://meta.discourse.org/t/avatar-upload-failing/96880/11 "2018-09-10T23:28:59Z")

</div>

But I just changed my avatar there and uploaded a custom one and it all worked fine.

Is it the case you just have a few stuck bad uploads in play?

Try with a completely new image …

Force path style should not be required

---

<div class="post-metadata">

### Author: ![Daniel\_Lopes](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/daniel_lopes/32/374589_2.png) [@Daniel\_Lopes](https://meta.discourse.org/u/Daniel_Lopes)
#### Post date: [10 Settembre 2018, 11:32pm UTC](https://meta.discourse.org/t/avatar-upload-failing/96880/12 "2018-09-10T23:32:56Z")

</div>

Yeah, it seems to be just some specific images. I will tell the users that are having issues to try another photo. Not a big deal.

Thanks, Sam.

---

<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: [10 Settembre 2018, 11:35pm UTC](https://meta.discourse.org/t/avatar-upload-failing/96880/13 "2018-09-10T23:35:06Z")

</div>

We can fix the bad images with a rake job, depends on how much of a pain it is.

Very curious why this suddenly played up.

---

<div class="post-metadata">

### Author: ![Daniel\_Lopes](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/daniel_lopes/32/374589_2.png) [@Daniel\_Lopes](https://meta.discourse.org/u/Daniel_Lopes)
#### Post date: [10 Settembre 2018, 11:48pm UTC](https://meta.discourse.org/t/avatar-upload-failing/96880/14 "2018-09-10T23:48:20Z")

</div>

I think it’s not a big deal. We had two support tickets, and that was it.

I have no idea either. I think it might be some cache because before the region was set to East (Virginia) (default value) and today while trying to debug this, I noticed the difference and changed to West (Oregon). So this might have fixed, but the old images were probably somehow cached.

The thing I don’t understand is why this became an issue only last week when I updated to the latest beta.

---

<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: [10 Settembre 2018, 11:51pm UTC](https://meta.discourse.org/t/avatar-upload-failing/96880/15 "2018-09-10T23:51:37Z")

</div>

We have been working really hard over the past few weeks stabalizing issues around uploads. There are a mountain of fixes we had to apply. My guess is that somewhere between fixes something happened.

---

<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: [11 Settembre 2018, 4:45pm UTC](https://meta.discourse.org/t/avatar-upload-failing/96880/16 "2018-09-11T16:45:56Z")

</div>


