問題多数:ログインしたスタッフがトピックにアクセスできない、手動アップグレードが失敗する、ユーザーカードが開かない、デフォルトログインが機能しない

こんにちは。以前、同様の問題を投稿しましたが、完全に解決しませんでした。現在、当フォーラムでいくつかの重大な問題が発生しています。

  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. ユーザーカードが表示されません。ユーザー名をクリックすると、カードが一瞬表示されようとして失敗します。
    1. ユーザーのプロフィールページを開く(新しいタブで開くなど)と、「Oops, this page does not exist(おっと、このページは存在しません)」というエラーが表示されます。
    2. ユーザーが設定、メッセージなどを表示しようとすると、同様に「Oops」エラーページが表示されます。
    3. 管理インターフェースからはユーザーの他の設定を確認できますが、インターフェースやユーザーアバターなどの設定変更はできません。
  4. 管理者はトピックやメインページを表示できません。
    1. ログアウトした状態では、サイトは正常に表示されます。
    2. 他のユーザーはログインしてフォーラムと対話できます(トピック作成、返信など)。
    3. 管理者としてログインすると、以下のエラーメッセージが表示されます:

      Oops

      このディスカッションフォーラムを動作させているソフトウェアで予期せぬ問題が発生しました。ご迷惑をおかけして申し訳ございません。

      エラーの詳細情報はログに記録され、自動通知が生成されました。確認いたします。

      追加の対応は不要です。ただし、エラーが継続する場合は、サイト内のフィードバックカテゴリにトピックを投稿し、エラーを再現する手順などを含めて詳細を提供してください。

ご助力いただければ幸いです。これらの問題を解決する方法、または正常に動作するバックアップから新しいインスタンスを作成する方法をご存知でしたら、お知らせください。

類似(ただし異なる)問題については、こちらをご覧ください: Duplicate data explorer key blocking rebuild

現在のデータベースで関連するデータ整合性の問題がないか確認し、問題があれば修正してからバックアップを作成してください。

@merefield さん、私は包括的な知識を持っていないため、Data Explorer で確認したところ、incoming_referers テーブルに incoming_domains への外部キーである integer 型の incoming_domain_id 列が存在することがわかりました。この部分に取り組むべきでしょうか?もしそうであれば、どのように確認すればよいでしょうか?

これほど散漫な状態では、自信が持てず、かつデータが重要な場合は、回復作業をすべて経験豊富なSAに依頼することをお勧めします Marketplace

問題は解決しましたか?