다양한 문제 발생: 로그인한 스태프가 주제에 접근 불가, 수동 업그레이드 실패, 사용자 카드 열리지 않음, 기본 로그인 작동 안 함

안녕하세요. 이전에 비슷한 문제를 게시한 적이 있었는데, 완전히 해결되지 않았습니다. 현재 우리 포럼에서 몇 가지 치명적인 문제가 발생하고 있습니다.

  1. 커맨드 라인을 통한 업그레이드가 실패합니다.
    1. 모든 플러그인을 제거해 보았지만 여전히 작동하지 않았습니다.

    2. 새로운 인스턴스를 생성하고, 이전 인스턴스의 백업 파일을 복사하여 커맨드 라인을 통해 복원했습니다. 그러나 몇 가지 오류로 종료되었습니다:

      ERROR:  could not create unique index "index_incoming_referers_on_path_and_incoming_domain_id"
      DETAIL:  Key (path, incoming_domain_id)=(/m/search, 18) is duplicated.
      EXCEPTION: psql failed: DETAIL:  Key (path, incoming_domain_id)=(/m/search, 18) is duplicated.
      /var/www/discourse/lib/backup_restore/database_restorer.rb:87:in `restore_dump'
      /var/www/discourse/lib/backup_restore/database_restorer.rb:26:in `restore'
      /var/www/discourse/lib/backup_restore/restorer.rb:51:in `run'
      script/discourse:145:in `restore'
      /var/www/discourse/vendor/bundle/ruby/2.7.0/gems/thor-1.1.0/lib/thor/command.rb:27:in `run'
      /var/www/discourse/vendor/bundle/ruby/2.7.0/gems/thor-1.1.0/lib/thor/invocation.rb:127:in `invoke_command'
      /var/www/discourse/vendor/bundle/ruby/2.7.0/gems/thor-1.1.0/lib/thor.rb:392:in `dispatch'
      /var/www/discourse/vendor/bundle/ruby/2.7.0/gems/thor-1.1.0/lib/thor/base.rb:485:in `start'
      script/discourse:286:in `<top (required)>'
      /usr/local/lib/ruby/gems/2.7.0/gems/bundler-2.2.7/lib/bundler/cli/exec.rb:63:in `load'
      /usr/local/lib/ruby/gems/2.7.0/gems/bundler-2.2.7/lib/bundler/cli/exec.rb:63:in `kernel_load'
      /usr/local/lib/ruby/gems/2.7.0/gems/bundler-2.2.7/lib/bundler/cli/exec.rb:28:in `run'
      /usr/local/lib/ruby/gems/2.7.0/gems/bundler-2.2.7/lib/bundler/cli.rb:494:in `exec'
      /usr/local/lib/ruby/gems/2.7.0/gems/bundler-2.2.7/lib/bundler/vendor/thor/lib/thor/command.rb:27:in `run'
      /usr/local/lib/ruby/gems/2.7.0/gems/bundler-2.2.7/lib/bundler/vendor/thor/lib/thor/invocation.rb:127:in `invoke_command'
      /usr/local/lib/ruby/gems/2.7.0/gems/bundler-2.2.7/lib/bundler/vendor/thor/lib/thor.rb:392:in `dispatch'
      /usr/local/lib/ruby/gems/2.7.0/gems/bundler-2.2.7/lib/bundler/cli.rb:30:in `dispatch'
      /usr/local/lib/ruby/gems/2.7.0/gems/bundler-2.2.7/lib/bundler/vendor/thor/lib/thor/base.rb:485:in `start'
      /usr/local/lib/ruby/gems/2.7.0/gems/bundler-2.2.7/lib/bundler/cli.rb:24:in `start'
      /usr/local/lib/ruby/gems/2.7.0/gems/bundler-2.2.7/exe/bundle:49:in `block in <top (required)>'
      /usr/local/lib/ruby/gems/2.7.0/gems/bundler-2.2.7/lib/bundler/friendly_errors.rb:130:in `with_friendly_errors'
      /usr/local/lib/ruby/gems/2.7.0/gems/bundler-2.2.7/exe/bundle:37:in `<top (required)>'
      /usr/local/bin/bundle:23:in `load'
      /usr/local/bin/bundle:23:in `<main>'
      Trying to rollback...
      Rolling back...
      Cleaning stuff up...
      Dropping functions from the discourse_functions schema...
      Removing tmp '/var/www/discourse/tmp/restores/default/2021-08-30-124350' directory...
      Unpausing sidekiq...
      Marking restore as finished...
      Notifying 'system' of the end of the restore...
      Finished!
      [FAILED]
      Restore done.
      
    3. 작동하는지 확인하기 위해 ./launcher rebuild app을 실행해 보았지만, 비슷한 오류 메시지가 나타났습니다:

      rake aborted!
      StandardError: An error has occurred, this and all later migrations canceled:
      
      ERROR:  unsupported Unicode escape sequence
      DETAIL:  \u0000 cannot be converted to text.
      

      그리고

      FAILED
      --------------------
      Pups::ExecError: cd /var/www/discourse && su discourse -c 'bundle exec rake db:migrate' failed with 
      return #<Process::Status: pid 4162 exit 1>
      Location of failure: /pups/lib/pups/exec_command.rb:112:in `spawn'
      exec failed with the params {"cd"=>"$home", "hook"=>"db_migrate", "cmd"=>["su discourse -c 'bundle exec rake db:migrate'"]}
      c618c071d6a0240d55ce704cedd63d2ee4cf1df589810d2130049a78b69f327e
      
    4. discourse-doctor도 실행해 보았지만 효과가 없었습니다.

  2. 사용자 이름과 비밀번호를 사용하여 정상적으로 로그인할 수 없으며, 오류가 발생합니다.
    1. GitHub, Google 등 다른 로그인 방법만 작동합니다.
  3. 사용자의 사용자 카드(User card)가 표시되지 않습니다. 사용자 이름을 클릭하면 카드가 잠시 팝업되려 하지만 실패합니다.
    1. 사용자 프로필 페이지를 방문할 때(예: 새 탭에서 여는 경우) “Oops, this page does not exist” 오류가 발생합니다.
    2. 사용자가 자신의 설정, 메시지 등을 보려 할 때에도 “Oops” 오류 페이지가 표시됩니다.
    3. 관리자 인터페이스에서는 사용자의 기타 설정을 볼 수 있지만, 인터페이스나 사용자 아바타 등의 설정을 변경할 수 없습니다.
  4. 관리자가 주제(Topic)나 메인 페이지를 볼 수 없습니다.
    1. 로그아웃 상태에서는 사이트를 정상적으로 볼 수 있습니다.
    2. 다른 사용자는 로그인하여 포럼과 상호작용(주제 생성, 답변 작성 등)할 수 있습니다.
    3. 관리자로 로그인하면 다음과 같은 오류 메시지가 표시됩니다:

      Oops

      The software powering this discussion forum encountered an unexpected problem. We apologize for the inconvenience.

      Detailed information about the error was logged, and an automatic notification generated. We’ll take a look at it.

      No further action is necessary. However, if the error condition persists, you can provide additional detail, including steps to reproduce the error, by posting a discussion topic in the site’s feedback category.

도움을 주시면 감사하겠습니다. 이 문제들을 해결하는 방법이나, 작동하는 백업으로 새 인스턴스를 만드는 방법에 대해 아이디어가 있으시다면 알려주세요.

비슷하지만 다른 문제에 대한 참고 자료: Duplicate data explorer key blocking rebuild

현재 데이터베이스에서 관련 데이터 무결성 문제를 확인하고, 문제를 수정한 후 백업을 생성하세요.

@merefield, 제가 전문 지식이 부족해서 Data Explorer를 이용해 확인해 봤더니, incoming_referers 테이블에 incoming_domain_id라는 컬럼이 integer 타입으로 존재하고, 이는 incoming_domains 테이블의 외래 키로 연결되어 있습니다. 이 작업을 제가 진행해야 하나요? 그렇다면 어떻게 확인해야 하나요?

너무 지저분해 보여서, 자신감이 없거나 데이터가 중요한 경우, 경험이 있는 SA를 고용해 모든 것을 복구하도록 하는 것이 좋습니다 Marketplace

문제를 파악하셨나요?