읽은 후에도 알림이 다시 나타납니다 [Private Topics 플러그인]

안녕하세요, 저는 3.2.0.beta4-dev 버전(자체 호스팅)을 사용하고 있으며 이 커밋을 적용한 상태입니다. 업데이트 이후 사용자들이 UI에서 이중/삼중 알림을 경험하기 시작했습니다. (여기서 말하는 것은 이메일 등이 아니라 Discourse UI를 의미합니다.)

클릭해서 읽은 후에도 알림이 다시 나타나는 경우가 있습니다. 저 역시 같은 문제를 겪고 있습니다. 이 문제를 어떻게 해결해야 하는지, 또는 유용한 로그를 어떻게 제공해야 하는지 모르겠습니다. 이것이 전역적인 문제인지, 아니면 제 인스턴스만의 문제인지 확인해 보고자 이 문제를 공유합니다.

RAM 문제인 것 같습니다. 디스코urs 인스턴스에 RAM이 얼마나 있나요?

혹시 'Discourse UI’를 말씀하시는 건가요?

하지만 이 서버는 거의 2개월 동안 운영되어 왔고, 이 문제는 이전에는 발생하지 않았습니다. 현재 제 서버에는 4GB의 RAM이 있으며, 그중 절반은 비어 있습니다. 2GB의 스왑 공간도 비어 있습니다.

업데이트 때문일 수도 있고, 플러그인 때문일 수도 있다고 생각합니다. 확실하지는 않습니다. 다음 단계로 모든 플러그인을 비활성화해 보고 도움이 되는지 확인해 볼 생각입니다.

네, 첫 번째 게시글에 사진을 첨부했습니다. Discourse UI 알림을 의미합니다.

확장 기능을 여러 개 비활성화했는데도 문제가 계속됩니다. 혹시 다른 생각이 있으신가요, 아니면 3.2.0.beta3-dev 버전으로 다운그레이드할 수 있을까요? 감사합니다.

다시 인사드립니다. 아무도 도와줄 의무는 없으며, 여기는 커뮤니티 포럼이고 저는 유료 고객이 아니라는 점도 잘 알고 있습니다. 하지만 이 버그는 저와 사용자들 모두에게 정말로 답답한 상황입니다. 2개월 전 Discourse 덕분에 커뮤니티를 만들었고, 현재 월간 활성 사용자가 458명입니다. 하지만 이 버그가 발생하기 시작한 지(20일 전) 이후로 제가 할 수 있는 모든 방법을 시도해 보았습니다. 사용자 경험 측면에서 꽤 심각한 문제이며, 지금은 Flarum이나 다른 포럼 플랫폼으로 이주할 스크립트를 찾아보고 있습니다. 아래를 한번 보시죠:

output

사용자들이 계속해서 같은 알림을 반복적으로 받고 있습니다. 20일 전, 5일 전, 혹은 언제든 과거의 알림을 계속 받게 됩니다. 모든 알림을 삭제해도 몇 시간 뒤에는 같은 알림이 다시 뜨며, 이를 수정할 방법이 전혀 없습니다!

다시 한번 말씀드리지만, 제가 어떤 위치에 있는지 잘 알고 있습니다. 이는 커뮤니티 플랫폼이므로 불평할 권리가 없다는 점을 인지하고 있습니다. 하지만 이 게시물 이후에도 아무도 도움을 주지 않는다면, 우리 이전 게시물과 토픽(토픽 1,200개, 게시물 12,700개)이 모두 삭제되는 것을 감수하더라도 다른 곳으로 떠나야 할 것입니다…

참고로 저는 Discourse의 지지자였습니다. 제 YouTube 채널에서 이 소프트웨어에 대한 영상을 제작한 바 있습니다. 터키 커뮤니티는 주로 구식 포럼을 사용하는데, 저는 이전에 Discourse를 사용해 좋은 경험을 했기 때문에 제 포럼을 열면서 이 소프트웨어를 사람들에게 알리고 싶었습니다.

어쨌든 저는 현재 포럼에서 다른 사람들의 해결책과 노고를 잃고 싶지 않습니다. 따라서 다시 한번 정중히 도움을 요청드립니다. 감사합니다.

호기심이 생겨서 여쭤보는데, 반복되는 알림이 있는 게시물들 사이에 공통점이 있는지 찾아볼 수 있을까요?

제 이해로는 사용자마다 다른 것 같습니다. 하지만 반복적으로 발생합니다. 제 계정에서는 같은 알림이 계속 반복되고 있습니다. 다만 21일 이전 게시물에서는 이런 문제가 발생하지 않습니다. 3.2.0beta4 업데이트를 진행했고, 또한 우리 포럼에 확장 기능을 추가했기 때문입니다.

처음에는 확장 기능이 원인이 될 것 같아 모든 확장 기능을 비활성화해 보았지만, 문제는 해결되지 않았습니다. 참고로 확장 기능을 삭제하고 완전히 다시 구축하는 것이 좋을지 모르겠습니다.

그 후 beta4 버전 때문인 것 같아서, 해당 문제가 없었던 beta3로 다운그레이드해 보았지만, 여전히 문제가 지속되었습니다.

불행히도 이 문제에 대한 다른 보고가 없어 사이트에서 정확히 어떤 일이 일어나고 있는지 파악하기가 어렵습니다. 표준 설치 환경인가요?

/logs 또는 /sidekiq 페이지에 더 많은 정보를 제공할 수 있는 내용이 있을까요?

네. 비활성화만으로는 문제의 원인을 완전히 제거하지 못할 수 있습니다. 그런데 최근에 어떤 플러그인을 설치하셨나요? 특정 플러그인에 대해 문제가 보고된 적이 있는지 확인해 볼 수 있을 것 같습니다.

네, 정확히 원인을 파악하기가 어렵다는 걸 이해합니다. 그래서 시간이 지나면 사라지기를 바랐지만, 그렇지 않았습니다.

다음과 같은 문제와 동일한 문제를 겪고 있는 것 같습니다: Users getting notifictations from long ago

네, 표준 설치를 사용 중이지만, 유일한 차이점은 Cloudflare 뒤에 있다는 점입니다. Cloudflare 때문이라고 생각하실 수 있지만, 이전에는 그런 문제가 없었습니다. Cloudflare 때문일 가능성은 낮다고 봅니다.

알림과 관련된 내용은 찾지 못했지만, 이 분야 전문가가 아니므로 몇 가지 내용을 공유해 보겠습니다. 혹시 눈여겨볼 만한 것이 보일지도 모르니까요.

경고(Warnings):


MaxMindDB (/var/www/discourse/vendor/data/GeoLite2-ASN.mmdb) could not be found: No such file or directory @ rb_sysopen - /var/www/discourse/vendor/data/GeoLite2-ASN.mmdb
Deprecation notice: `SiteSetting.anonymous_posting_min_trust_level` has been deprecated. Please use `SiteSetting.anonymous_posting_allowed_groups` instead. (removal in Discourse 3.3) At /var/www/disc
Failed to send push notification : WebPush::Unauthorized : host: fcm.googleapis.com, #<Net::HTTPForbidden 403 Forbidden readbody=true> body: the VAPID credentials in the authorization header do not co
Deprecation notice: `SiteSetting.anonymous_posting_min_trust_level` has been deprecated. Please use `SiteSetting.anonymous_posting_allowed_groups` instead. (removal in Discourse 3.3) At /var/www/disc
Failed to handle exception in exception app middleware : ArgumentError : Empty list of attributes passed
Failed to handle exception in exception app middleware : ArgumentError : Empty list of attributes passed
Deprecation notice: `SiteSetting.anonymous_posting_min_trust_level` has been deprecated. Please use `SiteSetting.anonymous_posting_allowed_groups` instead. (removal in Discourse 3.3) At /var/www/disc
DiscoTOC theme/component is throwing errors: TypeError: Cannot read properties of null (reading 'en')
Deprecation notice: `SiteSetting.anonymous_posting_min_trust_level` has been deprecated. Please use `SiteSetting.anonymous_posting_allowed_groups` instead. (removal in Discourse 3.3) At /var/www/disc
Deprecation notice: `SiteSetting.anonymous_posting_min_trust_level` has been deprecated. Please use `SiteSetting.anonymous_posting_allowed_groups` instead. (removal in Discourse 3.3) At /var/www/disc
Deprecation notice: `SiteSetting.anonymous_posting_min_trust_level` has been deprecated. Please use `SiteSetting.anonymous_posting_allowed_groups` instead. (removal in Discourse 3.3) At /var/www/disc
Deprecation notice: `SiteSetting.anonymous_posting_min_trust_level` has been deprecated. Please use `SiteSetting.anonymous_posting_allowed_groups` instead. (removal in Discourse 3.3) At /var/www/disc
Deprecation notice: `SiteSetting.anonymous_posting_min_trust_level` has been deprecated. Please use `SiteSetting.anonymous_posting_allowed_groups` instead. (removal in Discourse 3.3) At /var/www/disc
Deprecation notice: `SiteSetting.anonymous_posting_min_trust_level` has been deprecated. Please use `SiteSetting.anonymous_posting_allowed_groups` instead. (removal in Discourse 3.3) At /var/www/disc
Deprecation notice: `SiteSetting.anonymous_posting_min_trust_level` has been deprecated. Please use `SiteSetting.anonymous_posting_allowed_groups` instead. (removal in Discourse 3.3) At /var/www/disc
Deprecation notice: `SiteSetting.anonymous_posting_min_trust_level` has been deprecated. Please use `SiteSetting.anonymous_posting_allowed_groups` instead. (removal in Discourse 3.3) At /var/www/disc
Deprecation notice: `SiteSetting.anonymous_posting_min_trust_level` has been deprecated. Please use `SiteSetting.anonymous_posting_allowed_groups` instead. (removal in Discourse 3.3) At /var/www/disc
Deprecation notice: `SiteSetting.anonymous_posting_min_trust_level` has been deprecated. Please use `SiteSetting.anonymous_posting_allowed_groups` instead. (removal in Discourse 3.3) At /var/www/disc
Failed to handle exception in exception app middleware : ArgumentError : Empty list of attributes passed
Failed to send push notification : WebPush::Unauthorized : host: updates.push.services.mozilla.com, #<Net::HTTPUnauthorized 401 Unauthorized readbody=true> body: {"code":401,"errno":109,"error":"Unaut
Deprecation notice: `SiteSetting.anonymous_posting_min_trust_level` has been deprecated. Please use `SiteSetting.anonymous_posting_allowed_groups` instead. (removal in Discourse 3.3) At /var/www/disc
Deprecation notice: `SiteSetting.anonymous_posting_min_trust_level` has been deprecated. Please use `SiteSetting.anonymous_posting_allowed_groups` instead. (removal in Discourse 3.3) At /var/www/disc
Deprecation notice: `SiteSetting.anonymous_posting_min_trust_level` has been deprecated. Please use `SiteSetting.anonymous_posting_allowed_groups` instead. (removal in Discourse 3.3) At /var/www/disc
Deprecation notice: `SiteSetting.anonymous_posting_min_trust_level` has been deprecated. Please use `SiteSetting.anonymous_posting_allowed_groups` instead. (removal in Discourse 3.3) At /var/www/disc
Deprecation notice: `SiteSetting.anonymous_posting_min_trust_level` has been deprecated. Please use `SiteSetting.anonymous_posting_allowed_groups` instead. (removal in Discourse 3.3) At /var/www/disc
Deprecation notice: `SiteSetting.anonymous_posting_min_trust_level` has been deprecated. Please use `SiteSetting.anonymous_posting_allowed_groups` instead. (removal in Discourse 3.3) At /var/www/disc
Failed to handle exception in exception app middleware : ActiveRecord::RecordNotUnique : PG::UniqueViolation: ERROR: duplicate key value violates unique constraint "index_topic_tags_on_topic_id_and_t
Deprecation notice: `SiteSetting.anonymous_posting_min_trust_level` has been deprecated. Please use `SiteSetting.anonymous_posting_allowed_groups` instead. (removal in Discourse 3.3) At /var/www/disc
Deprecation notice: `SiteSetting.anonymous_posting_min_trust_level` has been deprecated. Please use `SiteSetting.anonymous_posting_allowed_groups` instead. (removal in Discourse 3.3) At /var/www/disc
Deprecation notice: `SiteSetting.anonymous_posting_min_trust_level` has been deprecated. Please use `SiteSetting.anonymous_posting_allowed_groups` instead. (removal in Discourse 3.3) At /var/www/disc
Failed to process hijacked response correctly : EOFError : end of file reached
Deprecation notice: `SiteSetting.anonymous_posting_min_trust_level` has been deprecated. Please use `SiteSetting.anonymous_posting_allowed_groups` instead. (removal in Discourse 3.3) At /var/www/disc
Deprecation notice: `SiteSetting.anonymous_posting_min_trust_level` has been deprecated. Please use `SiteSetting.anonymous_posting_allowed_groups` instead. (removal in Discourse 3.3) At /var/www/disc
Deprecation notice: `SiteSetting.anonymous_posting_min_trust_level` has been deprecated. Please use `SiteSetting.anonymous_posting_allowed_groups` instead. (removal in Discourse 3.3) At /var/www/disc
Deprecation notice: `SiteSetting.anonymous_posting_min_trust_level` has been deprecated. Please use `SiteSetting.anonymous_posting_allowed_groups` instead. (removal in Discourse 3.3) At /var/www/disc
Deprecation notice: `SiteSetting.anonymous_posting_min_trust_level` has been deprecated. Please use `SiteSetting.anonymous_posting_allowed_groups` instead. (removal in Discourse 3.3) At /var/www/disc
Deprecation notice: `SiteSetting.anonymous_posting_min_trust_level` has been deprecated. Please use `SiteSetting.anonymous_posting_allowed_groups` instead. (removal in Discourse 3.3) At /var/www/disc
MaxMindDB (/var/www/discourse/vendor/data/GeoLite2-City.mmdb) could not be found: No such file or directory @ rb_sysopen - /var/www/discourse/vendor/data/GeoLite2-City.mmdb
MaxMindDB (/var/www/discourse/vendor/data/GeoLite2-ASN.mmdb) could not be found: No such file or directory @ rb_sysopen - /var/www/discourse/vendor/data/GeoLite2-ASN.mmdb
Failed to send push notification : WebPush::ResponseError : host: web.push.apple.com, #<Net::HTTPBadRequest 400 Bad Request readbody=true> body: {"reason":"VapidPkHashMismatch"}
discourse-gifs theme/component is throwing errors: TypeError: Cannot read properties of null (reading 'en')
DiscoTOC theme/component is throwing errors: TypeError: Cannot read properties of null (reading 'en')
MaxMindDB (/var/www/discourse/vendor/data/GeoLite2-City.mmdb) could not be found: No such file or directory @ rb_sysopen - /var/www/discourse/vendor/data/GeoLite2-City.mmdb
MaxMindDB (/var/www/discourse/vendor/data/GeoLite2-ASN.mmdb) could not be found: No such file or directory @ rb_sysopen - /var/www/discourse/vendor/data/GeoLite2-ASN.mmdb
MaxMindDB (/var/www/discourse/vendor/data/GeoLite2-City.mmdb) could not be found: No such file or directory @ rb_sysopen - /var/www/discourse/vendor/data/GeoLite2-City.mmdb
MaxMindDB (/var/www/discourse/vendor/data/GeoLite2-ASN.mmdb) could not be found: No such file or directory @ rb_sysopen - /var/www/discourse/vendor/data/GeoLite2-ASN.mmdb
Failed to send push notification : WebPush::Unauthorized : host: updates.push.services.mozilla.com, #<Net::HTTPUnauthorized 401 Unauthorized readbody=true> body: {"code":401,"errno":109,"error":"Unaut
Sidekiq is consuming too much memory (using: 558.27M) for 'btt.community', restarting
MaxMindDB (/var/www/discourse/vendor/data/GeoLite2-City.mmdb) could not be found: No such file or directory @ rb_sysopen - /var/www/discourse/vendor/data/GeoLite2-City.mmdb
MaxMindDB (/var/www/discourse/vendor/data/GeoLite2-ASN.mmdb) could not be found: No such file or directory @ rb_sysopen - /var/www/discourse/vendor/data/GeoLite2-ASN.mmdb
MaxMindDB (/var/www/discourse/vendor/data/GeoLite2-City.mmdb) could not be found: No such file or directory @ rb_sysopen - /var/www/discourse/vendor/data/GeoLite2-City.mmdb
MaxMindDB (/var/www/discourse/vendor/data/GeoLite2-ASN.mmdb) could not be found: No such file or directory @ rb_sysopen - /var/www/discourse/vendor/data/GeoLite2-ASN.mmdb
Failed to send push notification : WebPush::PushServiceError : host: updates.push.services.mozilla.com, #<Net::HTTPBadGateway 502 Bad Gateway readbody=true> body: {"code":502,"errno":903,"error":"Bad
Deprecation notice: `SiteSetting.min_trust_level_for_here_mention` has been deprecated. Please use `SiteSetting.here_mention_allowed_groups` instead. (removal in Discourse 3.3) At /var/www/discourse/
Deprecation notice: Jobs::Chat::NotifyMentioned was enqueued with argument values which do not cleanly serialize to/from JSON. This means that the job will be run with slightly different values than t
Deprecation notice: Jobs::Chat::NotifyWatching was enqueued with argument values which do not cleanly serialize to/from JSON. This means that the job will be run with slightly different values than th
MaxMindDB (/var/www/discourse/vendor/data/GeoLite2-City.mmdb) could not be found: No such file or directory @ rb_sysopen - /var/www/discourse/vendor/data/GeoLite2-City.mmdb
MaxMindDB (/var/www/discourse/vendor/data/GeoLite2-ASN.mmdb) could not be found: No such file or directory @ rb_sysopen - /var/www/discourse/vendor/data/GeoLite2-ASN.mmdb
MaxMindDB (/var/www/discourse/vendor/data/GeoLite2-City.mmdb) could not be found: No such file or directory @ rb_sysopen - /var/www/discourse/vendor/data/GeoLite2-City.mmdb
MaxMindDB (/var/www/discourse/vendor/data/GeoLite2-ASN.mmdb) could not be found: No such file or directory @ rb_sysopen - /var/www/discourse/vendor/data/GeoLite2-ASN.mmdb
Deprecation notice: Jobs::Chat::NotifyMentioned was enqueued with argument values which do not cleanly serialize to/from JSON. This means that the job will be run with slightly different values than t
Deprecation notice: Jobs::Chat::NotifyWatching was enqueued with argument values which do not cleanly serialize to/from JSON. This means that the job will be run with slightly different values than th

오류(Errors):

Job exception: Net::ReadTimeout
Job exception: Net::ReadTimeout
Job exception: Net::SMTPAuthenticationError
Job exception: Net::SMTPAuthenticationError
Job exception: Net::SMTPAuthenticationError
(google_oauth2) Authentication failure! csrf_detected: OmniAuth::Strategies::OAuth2::CallbackError, csrf_detected | CSRF detected
Job exception: Net::ReadTimeout
(github) Authentication failure! csrf_detected: OmniAuth::Strategies::OAuth2::CallbackError, csrf_detected | CSRF detected
(discord) Authentication failure! csrf_detected: OmniAuth::Strategies::OAuth2::CallbackError, csrf_detected | CSRF detected
default: Failed to pull hotlinked image (https://btt.community/uploads/default/optimized/2X/9/9394498c413ffd7cefbee2461a83d1a66b3b499c_2_690x388.jpeg) post: 10185 PG::UniqueViolation: ERROR: duplicat
Job exception: ERROR: duplicate key value violates unique constraint "pg_type_typname_nsp_index" DETAIL: Key (typname, typnamespace)=(gamification_leaderboard_cache_1_all_time_1, 2200) already exist
(google_oauth2) Authentication failure! invalid_credentials: OAuth2::Error, invalid_grant: Bad Request { "error": "invalid_grant", "error_description": "Bad Request" }
Job exception: Net::ReadTimeout
Job exception: end of file reached
(github) Authentication failure! csrf_detected: OmniAuth::Strategies::OAuth2::CallbackError, csrf_detected | CSRF detected
(twitter) Authentication failure! invalid_credentials: OAuth::Unauthorized, 401 Unauthorized
Job exception: Net::SMTPAuthenticationError
Job exception: end of file reached
(google_oauth2) Authentication failure! csrf_detected: OmniAuth::Strategies::OAuth2::CallbackError, csrf_detected | CSRF detected
(google_oauth2) Authentication failure! csrf_detected: OmniAuth::Strategies::OAuth2::CallbackError, csrf_detected | CSRF detected
Job exception: Net::ReadTimeout
Job exception: wrong number of arguments (given 0, expected 1)
Job exception: end of file reached
Job exception: wrong number of arguments (given 0, expected 1)
(discord) Authentication failure! csrf_detected: OmniAuth::Strategies::OAuth2::CallbackError, csrf_detected | CSRF detected
Job exception: Net::ReadTimeout
Job exception: wrong number of arguments (given 0, expected 1)

치명적 오류(Fatal):

ActiveRecord::StatementInvalid (PG::UndefinedTable: ERROR: relation "categories" does not exist LINE 1: SELECT "categories"."id" FROM "categories" LEFT JOIN categor...
ActiveRecord::StatementInvalid (PG::UndefinedTable: ERROR: relation "user_auth_tokens" does not exist LINE 1: SELECT "user_auth_tokens".* FROM "user_auth_tokens" WHERE ((...
ActiveRecord::StatementInvalid (PG::UndefinedTable: ERROR: relation "user_auth_tokens" does not exist LINE 1: SELECT "user_auth_tokens".* FROM "user_auth_tokens" WHERE ((...
ActiveRecord::StatementInvalid (PG::UndefinedTable: ERROR: relation "user_auth_tokens" does not exist LINE 1: SELECT "user_auth_tokens".* FROM "user_auth_tokens" WHERE ((...
ActiveRecord::StatementInvalid (PG::UndefinedTable: ERROR: relation "user_auth_tokens" does not exist LINE 1: SELECT "user_auth_tokens".* FROM "user_auth_tokens" WHERE ((...
Regexp::TimeoutError (regexp match timeout) lib/crawler_detection.rb:38:in `match?' lib/crawler_detection.rb:38:in `crawler?' lib/middleware/anonymous_cache.rb:129:in `is_crawler?' (eval):2:in `__comp
ActiveRecord::StatementInvalid (PG::InFailedSqlTransaction: ERROR: current transaction is aborted, commands ignored until end of transaction block ) lib/post_action_creator.rb:295:in `rescue in creat
NoMethodError (undefined method `title' for nil:NilClass) app/models/reviewable_queued_post.rb:166:in `perform_revise_and_reject_post' app/models/reviewable.rb:331:in `public_send' app/models/reviewab
ArgumentError (Empty list of attributes passed) lib/plugin/instance.rb:522:in `block in on' lib/discourse_event.rb:12:in `block in trigger' lib/discourse_event.rb:12:in `trigger' app/models/post_mover
ArgumentError (Empty list of attributes passed) lib/plugin/instance.rb:522:in `block in on' lib/discourse_event.rb:12:in `block in trigger' lib/discourse_event.rb:12:in `trigger' app/models/post_mover
ArgumentError (Empty list of attributes passed) lib/plugin/instance.rb:522:in `block in on' lib/discourse_event.rb:12:in `block in trigger' lib/discourse_event.rb:12:in `trigger' app/models/post_mover
NoMethodError (undefined method `title' for nil:NilClass) app/models/reviewable_queued_post.rb:166:in `perform_revise_and_reject_post' app/models/reviewable.rb:331:in `public_send' app/models/reviewab
ArgumentError (Empty list of attributes passed) lib/plugin/instance.rb:522:in `block in on' lib/discourse_event.rb:12:in `block in trigger' lib/discourse_event.rb:12:in `trigger' app/models/post_mover
ArgumentError (Empty list of attributes passed) lib/plugin/instance.rb:522:in `block in on' lib/discourse_event.rb:12:in `block in trigger' lib/discourse_event.rb:12:in `trigger' app/models/post_mover
ArgumentError (Empty list of attributes passed) lib/plugin/instance.rb:522:in `block in on' lib/discourse_event.rb:12:in `block in trigger' lib/discourse_event.rb:12:in `trigger' app/models/post_mover
ArgumentError (Empty list of attributes passed) lib/plugin/instance.rb:522:in `block in on' lib/discourse_event.rb:12:in `block in trigger' lib/discourse_event.rb:12:in `trigger' app/models/post_mover
NoMethodError (undefined method `title' for nil:NilClass) app/models/reviewable_queued_post.rb:166:in `perform_revise_and_reject_post' app/models/reviewable.rb:331:in `public_send' app/models/reviewab
NoMethodError (undefined method `title' for nil:NilClass) app/models/reviewable_queued_post.rb:166:in `perform_revise_and_reject_post' app/models/reviewable.rb:331:in `public_send' app/models/reviewab
ArgumentError (Empty list of attributes passed) lib/plugin/instance.rb:521:in `block in on' lib/discourse_event.rb:12:in `block in trigger' lib/discourse_event.rb:12:in `trigger' app/models/post_mover
ActiveRecord::RecordNotUnique (PG::UniqueViolation: ERROR: duplicate key value violates unique constraint "index_topic_tags_on_topic_id_and_tag_id" DETAIL: Key (topic_id, tag_id)=(2907, 1) already e

Sidekiq의 경우 정확히 어디서 확인해야 하는지 모르겠습니다. Sidekiq가 이메일을 처리하나요? 알림과 관련이 있나요?

네, 그 사이에 모두를 제거하고 다시 구축해 보겠습니다.

이 문제가 시작되기 전에 설치했던 확장 프로그램 목록입니다 (문제가 시작된 정확한 날짜와 일치합니다):

  • Who’s Online
  • Cakeday
  • Signature
  • Adsense
  • ActivityPub (이것은 비활성화할 수 없어서 완전히 삭제하고 다시 구축했습니다)

테마 컴포넌트로:

  • GIF

수정: 몇 가지를 추가하는 것을 잊었습니다.

  • Discourse Private Topics
  • Discourse Force Moderation

틀린 말일 수 있지만, 그건 테마 컴포넌트 맞지?

네, 맞아요. 지금은 테마 컴포넌트인 것 같고, 뭐가 뭔지 모르겠어서 일단 포함시켰습니다. :grinning_face_with_smiling_eyes:

Sidekiq는 알림을 포함한 모든 백그라운드 작업을 처리합니다. 거기에는 다소 이질적인 오류들이 섞여 있네요 :slight_smile: 이미 수정된 몇 가지 오류를 알아볼 수 있으니, 재빌드/업데이트를 수행한 후에는 다시 발생하지 않을 것입니다. 다만 다음 오류를 확인했습니다:

Sidekiq is consuming too much memory (using: 558.27M)

이것이 작업을 재시도하도록(알림을 다시 보내는 것 포함) 강제하고 있을 수 있습니다. 해당 항목을 클릭해서 더 자세한 정보가 있는지 확인해 주시겠어요?

아, 그렇군요. 그렇다면 실제로 그게 문제일 수 있겠네요.

image

왼쪽에 있는 게 횟수 맞죠? 즉, 10번 발생했다는 뜻이네요.

발생한 모든 시점은 다음과 같습니다:

9월 8일 오후 6:55
9월 25일 오후 9:44
10월 4일 오후 9:53
11월 10일 오전 2:26 (문제는 11월 9일에 시작됨)
11월 11일 오전 11:37
11월 11일 오후 1:37
11월 23일 오후 6:43
11월 25일 오후 6:59
일요일 오전 7:32
월요일 오후 1:12

문제는 RAM이 4기가이고 SWAP이 2기가인데, 사용량이 이보다 더 높은 걸 본 적이 없다는 점입니다:

그리고 이 사진은 방금 찍은 겁니다. 그래서 아마 사용자가 피크 시간에 몰릴 때 발생하는 건지, 아니면 그렇지 않다면 Sidekiq의 임계값을 높여야 하는 건지 궁금하네요.

INFO:

Sidekiq is consuming too much memory (using: 558.27M) for 'btt.community', restarting

BACKTRACE:

config/unicorn.conf.rb:164:in `check_sidekiq_heartbeat'
config/unicorn.conf.rb:244:in `master_sleep'
unicorn-6.1.0/lib/unicorn/http_server.rb:295:in `join'
unicorn-6.1.0/bin/unicorn:128:in `<top (required)>'
/var/www/discourse/vendor/bundle/ruby/3.2.0/bin/unicorn:25:in `load'

/var/www/discourse/vendor/bundle/ruby/3.2.0/bin/unicorn:25:in `<main>'

env:

hostname	dc-app, [dc-discourse]
process_id	1215943
application_version	a55f924e279b45b81e69e720faeb38284aed90d4
time	월요일 오후 1:12

알고 있습니다. 이건 아무것도 증명하지 못하지만, 저는 매일 몇 번씩 같은 오류가 발생하고 있습니다.[1] OP가 겪고 있는 것과 비슷한 현상은 제 환경에서는 일어나지 않습니다.


  1. 수리를 하는 것이 너무 부담스럽고 비용이 들 것 같아서 ↩︎

다시 살펴보니 이 문제와 관련이 있을 수 있는 오류들이 몇 가지 더 보입니다:

1번째:

Message (109 copies reported)

Deprecation notice: Jobs::Chat::NotifyMentioned was enqueued with argument values which do not cleanly serialize to/from JSON. This means that the job will be run with slightly different values than the ones supplied to `enqueue`. Argument values should be strings, booleans, numbers, or nil (or arrays/hashes of those value types). (deprecated since Discourse 2.9) (removal in Discourse 3.0) 
At /var/www/discourse/plugins/chat/lib/chat/notifier.rb:355:in `notify_mentioned_users`

Backtrace

/var/www/discourse/lib/discourse.rb:1030:in `deprecate'
/var/www/discourse/app/jobs/base.rb:371:in `enqueue'
/var/www/discourse/plugins/chat/lib/chat/notifier.rb:355:in `notify_mentioned_users'
/var/www/discourse/plugins/chat/lib/chat/notifier.rb:78:in `notify_new'
/var/www/discourse/plugins/chat/app/jobs/regular/chat/process_message.rb:42:in `block in execute'
/var/www/discourse/lib/distributed_mutex.rb:53:in `block in synchronize'
/var/www/discourse/lib/distributed_mutex.rb:49:in `synchronize'
/var/www/discourse/lib/distributed_mutex.rb:49:in `synchronize'
/var/www/discourse/lib/distributed_mutex.rb:34:in `synchronize'
/var/www/discourse/plugins/chat/app/jobs/regular/chat/process_message.rb:7:in `execute'

2번째:

Message (109 copies reported)

Deprecation notice: Jobs::Chat::NotifyWatching was enqueued with argument values which do not cleanly serialize to/from JSON. This means that the job will be run with slightly different values than the ones supplied to `enqueue`. Argument values should be strings, booleans, numbers, or nil (or arrays/hashes of those value types). (deprecated since Discourse 2.9) (removal in Discourse 3.0) 
At /var/www/discourse/plugins/chat/lib/chat/notifier.rb:367:in `notify_watching_users`

Backtrace

/var/www/discourse/lib/discourse.rb:1030:in `deprecate'
/var/www/discourse/app/jobs/base.rb:371:in `enqueue'
/var/www/discourse/plugins/chat/lib/chat/notifier.rb:367:in `notify_watching_users'
/var/www/discourse/plugins/chat/lib/chat/notifier.rb:79:in `notify_new'
/var/www/discourse/plugins/chat/app/jobs/regular/chat/process_message.rb:42:in `block in execute'
/var/www/discourse/lib/distributed_mutex.rb:53:in `block in synchronize'
/var/www/discourse/lib/distributed_mutex.rb:49:in `synchronize'
/var/www/discourse/lib/distributed_mutex.rb:49:in `synchronize'
/var/www/discourse/lib/distributed_mutex.rb:34:in `synchronize'
/var/www/discourse/plugins/chat/app/jobs/regular/chat/process_message.rb:7:in `execute'

3번째:

Message (29888 copies reported)

Job exception: wrong number of arguments (given 0, expected 1)


Backtrace

/var/www/discourse/plugins/discourse-private-topics/plugin.rb:20:in `get_filtered_category_ids'
/var/www/discourse/plugins/discourse-private-topics/plugin.rb:149:in `handle'
/var/www/discourse/plugins/discourse-follow/plugin.rb:131:in `block (2 levels) in activate!'
/var/www/discourse/lib/plugin/instance.rb:521:in `block in on'
/var/www/discourse/lib/discourse_event.rb:12:in `block in trigger'
/usr/local/lib/ruby/3.2.0/set.rb:511:in `each_key'
/usr/local/lib/ruby/3.2.0/set.rb:511:in `each'
/var/www/discourse/lib/discourse_event.rb:12:in `trigger'
/var/www/discourse/app/services/post_alerter.rb:205:in `after_save_post'
/var/www/discourse/app/jobs/regular/post_alert.rb:10:in `execute'

hostname	dc-app
process_id	190
application_version	95b7cbd8a13ec82003936ef9408ec83bc9f3c2ea
current_db	default
current_hostname	btt.community
job	Jobs::PostAlert
problem_db	default
time	We 1:55 pm

3번째 오류의 백트레이스를 보면 discourse-private-topics와 discourse-follow 플러그인과 관련이 있는 것 같습니다. 앞서 말했듯이 이 분야에 전문가가 아니지만, 일단 이들을 제거하고 처음부터 다시 구축해 보겠습니다…

플러그인을 삭제하고 재빌드한 후 3번째 오류는 사라졌지만, 1번째와 2번째 비추천(deprecation) 알림은 여전히 남아 있습니다.

문제는 해결되지 않았습니다.

Sidekiq를 확인해보니 재시도(retries) 섹션에 수십 개의 Jobs::PostAlert가 쌓여 있습니다. 아마도 이것이 모든 알림이 다시 도착하는 이유일 것 같습니다. 그런데 실제로 알림을 보내고 있다면 왜 재시도 대기열로 넘어가는 걸까요?

보시는 것처럼 이 목록이 63페이지나 됩니다. 이걸 전부 제거해야 할까요?

수정:

에러를 살펴보니 discourse-private-topics와 discourse-follow 플러그인에서 트리거되는 것 같습니다.

재시도 섹션에 있었기 때문에 삭제했는데도 Sidekiq는 여전히 해당 알림을 보내고 있었습니다. 이제 모든 재시도 항목을 제거했고, 문제가 해결되었기를 바랍니다. 업데이트를 올리겠습니다.

오케이, 이제 문제가 해결되었습니다. 결국 Job exception: wrong number of arguments (given 0, expected 1) 오류는 Private Topics Plugin 와 Discourse Follow 플러그인 중 하나, 혹은 두 플러그인이 모두 원인인 것 같습니다. 아마 두 플러그인을 함께 사용했을 때 이런 문제가 발생하는 것 같기도 하고, 정확히는 모르겠습니다. 그리고 굳이 알아내고 싶지도 않아요. 이 문제로 21일째 씨름하고 있어서 좀 트라우마가 생겼습니다. :grinning_face_with_smiling_eyes: 이 플러그인 제작자들이 이 문제를 알게 되면 좋겠으니 여기 태그를 달아두겠습니다: @sam @RGJ

@JammyDodger @Firepup650 님께 감사드립니다.

이번 기회에 디스코urs 문제를 디버깅하는 법을 배웠고, 한 번에 플러그인을 1개 이상 설치하지 말아야 한다는 것도 깨달았습니다…

이 문제를 끝까지 파헤쳐 주셔서 감사합니다! 실제로는 팔로우 플러그인이 함께 활성화된 경우에만 발생하는, 제 개인 토픽 플러그인의 문제였습니다.

수정 사항을 반영했습니다. 불편함을 드려 죄송합니다. :wink:

훌륭한 디버깅입니다. :clap: :slight_smile: 그리고 빠른 수정에 감사드립니다 @RGJ :rocket:

이 문제는 비공식 플러그인에서 발생한 것이므로 Contribute > Bug 카테고리에서 제외하겠습니다(다만, 규모가 좀 크므로 Private Topics Plugin 으로 병합하지는 않을 예정입니다).

이제 두 플러그인을 동시에 설치해도 알림이 뜨지 않을 것입니다. :crossed_fingers: