Error 500 on category page and homepage after upgrade to 2.6


I just have upgraded my forum ( working since 2017 ) to 2.6 ( from 2.4)
During the upgrade i notice that Postgresql 9.5 has been replaced by postgres 12.

the rebuild operation has ended without errors but i have an error 500 on homepage ( or a oops message )
Same error on category page.
The admin is working, the user profil is working , the user list is working, a single post is working.
The top refered in admin is not working.

I have no ideas to solve that.
Thanks you very much

Any plugin installed?

1 Like

Anything in /logs ?

1 Like

You are right, i have many many times the same error in /logs

NoMethodError (undefined method hex' for nil:NilClass) app/models/upload.rb:180:in base62_sha1’
app/models/upload.rb:174:in short_path' app/models/upload.rb:146:in short_path’
app/models/group.rb:767:in flair_url' (eval):5:in _fast_attributes’
lib/freedom_patches/ams_include_without_root.rb:54:in include!' lib/freedom_patches/ams_include_without_root.rb:57:in include!’
lib/freedom_patches/ams_include_without_root.rb:57:in include!' app/controllers/application_controller.rb:440:in serialize_data’
app/controllers/application_controller.rb:449:in render_serialized' lib/topic_list_responder.rb:16:in block (2 levels) in respond_with_list’
lib/topic_list_responder.rb:9:in respond_with_list' app/controllers/list_controller.rb:102:in block (2 levels) in class:ListController’
app/controllers/list_controller.rb:107:in public_send' app/controllers/list_controller.rb:107:in block (2 levels) in class:ListController’
app/controllers/application_controller.rb:340:in block in with_resolved_locale' app/controllers/application_controller.rb:340:in with_resolved_locale’
lib/middleware/omniauth_bypass_middleware.rb:68:in call' lib/content_security_policy/middleware.rb:12:in call’
lib/middleware/anonymous_cache.rb:336:in call' config/initializers/100-quiet_logger.rb:19:in call’
config/initializers/100-silence_logger.rb:31:in call' lib/middleware/enforce_hostname.rb:22:in call’
lib/middleware/request_tracker.rb:176:in `call’

Unfortunatly, go to safe mode and unactive everything d’ont resolve the problem.
I still have the error.

I have many many times this error in logs :

NoMethodError (undefined method hex' for nil:NilClass) app/models/upload.rb:180:in base62_sha1’ app/models/upload.rb:174:in short_path' app/models/upload.rb:146:in short_path’ app/models/group.rb:

And in the admin dashboard, some metrix ( Top Referred Topics ) give an error :
“sorry, request take too much time”

I have seen this once, the issue was that the category images were missing. Discourse tries to retrieve their dimensions and fails.

You might try to remove any category images.

1 Like

I tried to restore but i have an error :

[2020-08-27 10:06:41] Pausing sidekiq…
[2020-08-27 10:06:41] Waiting up to 60 seconds for Sidekiq to finish running jobs…
[2020-08-27 10:38:40] EXCEPTION: ERROR: deadlock detected
DETAIL: Process 594 waits for AccessExclusiveLock on relation 1113165 of database 16569; blocked by process 1617.
Process 1617 waits for AccessShareLock on relation 1113221 of database 16569; blocked by process 594.
HINT: See server log for query details.
CONTEXT: SQL statement “ALTER TABLE public.categories SET SCHEMA backup;”
PL/pgSQL function inline_code_block line 11 at EXECUTE

We don’t have category image :frowning:

Hmm :thinking:
Group flair maybe?

how to know if the problem come from group flair and how to solve that ?
Thanks you very much

Try to remove or reupload the group avatar flair from any groups and see if it solves the issue.


That did it, @michaeld! Nice work. @Olivier_Baillon, you can mark Michael’s post as the solution!

If anyone else has this, you’d do something like:

cd /var/discourse
./launcher enter app
rails c
# for the groups that have `flair_upload_id` something like
g=Group.find(GROUP_ID_FROM_THE_LIST) # that's id not flair_upload_id

There are more elegant ways, but if you have just a few this should get you started.


THANKS @michaeld and @pfaffman
I would never have found that myself.
Thanks you very much

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.