/user_avatar returns HTTP 500 after new update

AI-generated summary

After a recent update, users are experiencing HTTP 500 errors when loading avatars, with images showing as broken links. avidseeker reports that the issue occurs when accessing avatars via user_avatar URLs, even when S3 upload is disabled. The console shows a 500 error for avatar image requests. avidseeker identifies the root cause: Discourse cannot connect to the S3 server, resulting in a Network is unreachable error for IPv6 addresses. NateDhaliwal asks if a firewall is blocking the connection, but avidseeker confirms no firewall is involved. The issue appears to be related to the backend’s inability to communicate with the S3 server, despite other image uploads working. MoRanYue and tobiaseigen also comment on the issue, with the latter asking about the user’s ability to resolve the problem.

All avatars showing up like this:

image

When opened in a new tab `http://forum.example.org/user_avatar/forum.example.org/user/48/681_2.png\` responds with HTTP 500.

I’m using an S3 upload for images (blackblaze). Seems that an avatar image is uploaded there. Tried disabling it, still the same issue.

Doesn’t seem like a proxy issue. Tried binding port to the server, same issue. Opening `http://localhost:8082/user_avatar/forum.example.org/user/48/681_2.png\` results in:

This only happened after new update: 3.6.0.beta2-latest

Already ran the two rake avatars:refresh and rake posts:rebake as instructed in similar issues.

Any errors in the browser console or in /logs?

Yes,

console og:

681_2.png:1 
 GET https://forum.example.org/user_avatar/forum.example.org/othman/24/681_2.png 500 (Internal Server Error)
Image		
(anonymous)	@	ajax.js:133
XMLHttpRequest.send		
o	@	ajax.js:188
A	@	ajax.js:201
#Qa	@	chat-api.js:583
listCurrentUserChannels	@	chat-api.js:299
(anonymous)	@	chat.js:210
loadChannels	@	chat.js:209
(anonymous)	@	chat-setup.js:140
eZ	@	plugin-api.gjs:3522
g	@	chat-setup.js:44
initialize	@	chat-setup.js:199
(anonymous)	@	app.js:239
Promise.then		
(anonymous)	@	start-app.js:8
await in (anonymous)		
(anonymous)	@	discourse-boot.js:13
(anonymous)	@	discourse-boot.js:1

Found the problem:

Discourse seems that it can’t communicate with the S3 server

Message (506 copies reported)

Failed to process hijacked response correctly : Errno::ENETUNREACH : Failed to open TCP connection to 2605:72c0:6fd:b3::b005:1:80 (Network is unreachable - connect(2) for "2605:72c0:6fd:b3::b005:1" port 80)

Backtrace

/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/net-http-0.6.0/lib/net/http.rb:1665:in `initialize'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/net-http-0.6.0/lib/net/http.rb:1665:in `open'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/net-http-0.6.0/lib/net/http.rb:1665:in `block in connect'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/timeout-0.4.3/lib/timeout.rb:185:in `block in timeout'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/timeout-0.4.3/lib/timeout.rb:192:in `timeout'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/net-http-0.6.0/lib/net/http.rb:1663:in `connect'
/var/www/discourse/lib/final_destination/http.rb:27:in `block in connect'
/var/www/discourse/lib/final_destination/http.rb:17:in `each'
/var/www/discourse/lib/final_destination/http.rb:17:in `each_with_index'
/var/www/discourse/lib/final_destination/http.rb:17:in `connect'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/net-http-0.6.0/lib/net/http.rb:1642:in `do_start'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/net-http-0.6.0/lib/net/http.rb:1631:in `start'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/net-http-0.6.0/lib/net/http.rb:1070:in `start'
/var/www/discourse/lib/final_destination.rb:544:in `safe_session'
/var/www/discourse/lib/final_destination.rb:479:in `safe_get'
/var/www/discourse/lib/final_destination.rb:170:in `get'
/var/www/discourse/lib/file_helper.rb:91:in `download'
/var/www/discourse/app/controllers/user_avatars_controller.rb:176:in `proxy_avatar'
/var/www/discourse/app/controllers/user_avatars_controller.rb:144:in `show_in_site'
/var/www/discourse/app/controllers/user_avatars_controller.rb:90:in `block (2 levels) in show'
/var/www/discourse/lib/hijack.rb:68:in `instance_eval'
/var/www/discourse/lib/hijack.rb:68:in `block (2 levels) in hijack'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/i18n-1.14.7/lib/i18n.rb:353:in `with_locale'
/var/www/discourse/lib/hijack.rb:68:in `block in hijack'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/concurrent-ruby-1.3.5/lib/concurrent-ruby/concurrent/promises.rb:911:in `callback_on_resolution'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/concurrent-ruby-1.3.5/lib/concurrent-ruby/concurrent/promises.rb:797:in `call_callback'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/concurrent-ruby-1.3.5/lib/concurrent-ruby/concurrent/promises.rb:803:in `call_callbacks'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/concurrent-ruby-1.3.5/lib/concurrent-ruby/concurrent/promises.rb:692:in `resolve_with'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/concurrent-ruby-1.3.5/lib/concurrent-ruby/concurrent/promises.rb:1325:in `resolve'
/var/www/discourse/lib/scheduler/defer.rb:125:in `block in do_work'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/rails_multisite-7.0.0/lib/rails_multisite/connection_management/null_instance.rb:49:in `with_connection'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/rails_multisite-7.0.0/lib/rails_multisite/connection_management.rb:17:in `with_connection'
/var/www/discourse/lib/scheduler/defer.rb:119:in `do_work'
/var/www/discourse/lib/scheduler/defer.rb:105:in `block (2 levels) in start_thread'

Is there a firewall or some network limitation here?

No. What’s confusing is that this same backend works for images in regular posts but not avatars.

Yeah, this is so weird.

@avidseeker were you able to resolve your issue?