After upgrading Discourse from 2.4 to 2.6, Olivier_Baillon encountered a persistent Error 500 on the homepage and category pages, despite successful rebuilds and working admin/user interfaces. Logs repeatedly showed a NoMethodError (undefined method 'hex' for nil:NilClass) originating from app/models/upload.rb and traced to group.rb:767 in flair_url4. Safe mode and plugin deactivation didn’t help 5. Initially suspected category images 8, but none were present 10. michaeld correctly identified corrupted or missing group flair uploads as the culprit and advised removing or reuploading group flair avatars 13. pfaffman confirmed the fix and provided a Rails console snippet to identify and repair affected groups, which resolved the issue. Olivier_Baillon thanked both for their help, acknowledging he wouldn’t have found the solution alone.
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
[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
cd /var/discourse
./launcher enter app
rails c
Group.all.pluck(:id,:flair_icon,:flair_upload_id)
# 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
g.flair_upload
g.save
There are more elegant ways, but if you have just a few this should get you started.