Avatar upload failing

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:

Have you guys seem this before?

Thanks.

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

2 Likes

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.

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

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:

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

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

I am getting:

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.

2 Likes

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:

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

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

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

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.

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

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.

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.

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.

2 Likes

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.

7 Likes