2.6 버전으로 업그레이드 후 카테고리 페이지와 홈 페이지에서 500 오류 발생

안녕하세요,

2017년부터 운영해 온 포럼을 2.4에서 2.6으로 업그레이드했습니다.
업그레이드 과정에서 PostgreSQL 9.5가 Postgres 12로 교체된 것을 확인했습니다.

재빌드 작업은 오류 없이 완료되었지만, 홈페이지(또는 oops 메시지)에서 500 오류가 발생합니다.
카테고리 페이지에서도 동일한 오류가 나타납니다.
관리자 화면은 정상 작동하며, 사용자 프로필, 사용자 목록, 개별 게시글도 정상적으로 표시됩니다.
관리자 화면의 상위 추천(top refered) 기능만 작동하지 않습니다.

해결 방법을 알지 못하겠습니다.
많은 도움 부탁드립니다.

설치된 플러그인이 있나요?

/logs에 뭐가 있나요?

맞습니다, /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’

불행히도 안전 모드로 전환하고 모든 것을 비활성화해도 문제가 해결되지 않았습니다.
여전히 오류가 발생합니다.

로그에서 이 오류가 매우 자주 발생합니다:

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:

그리고 관리자 대시보드에서 일부 지표(최상위 추천 주제)가 오류를 발생시킵니다:
“죄송합니다. 요청에 시간이 너무 오래 걸립니다.”

한 번 이런 문제를 본 적이 있는데, 원인은 카테고리 이미지가 없었던 것이었습니다. Discourse가 이미지 크기를 가져오려다 실패하는 것입니다.

카테고리 이미지를 모두 제거해 보시는 것을 권장합니다.

복구를 시도했는데 오류가 발생합니다:

[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

카테고리 이미지가 없습니다 :frowning:

음 :thinking:
그룹 플레어일까요?

문제가 그룹 플레어에서 비롯된 것인지 어떻게 알 수 있으며, 이를 어떻게 해결할 수 있나요?
매우 감사합니다

그룹에서 아바타 플레어를 제거하거나 다시 업로드해 보시고, 문제가 해결되는지 확인해 보세요.

해결됐네요, @michaeld! 잘하셨습니다. @Olivier_Baillon, 마이클의 게시물을 해결책으로 표시할 수 있습니다!

다른 분들도 같은 문제를 겪고 계신다면 다음과 같은 방법으로 처리할 수 있습니다:

cd /var/discourse
./launcher enter app
rails c
Group.all.pluck(:id,:flair_icon,:flair_upload_id)
# `flair_upload_id`가 있는 그룹에 대해
 g=Group.find(GROUP_ID_FROM_THE_LIST) # 이것은 id이며 flair_upload_id가 아닙니다
g.flair_upload
g.save

더 우아한 방법도 있지만, 대상이 몇 개뿐이라면 이 방법으로 시작해 보시기 바랍니다.

THANKS @michaeld and @pfaffman
저 혼자서는 절대 못 찾았을 거예요.
정말 감사합니다