アップデート後、サイトが開かず、バックアップされたデータベースも読み込まれませんでした。

サイトを更新したところ、nginxエラーが発生し、サイトにアクセスできなくなりました。何をしても機能しなかったので、新規インストールを行い、昨日のデータを復元しようとしましたが、それも成功しませんでした。バックアップをインストールすると、次のエラーが発生します。

エラー完了:

CREATE INDEX
CREATE INDEX
CREATE INDEX
CREATE INDEX
CREATE INDEX
CREATE INDEX
CREATE INDEX
CREATE INDEX
CREATE INDEX
ERROR:  unrecognized parameter "dims"
EXCEPTION: psql failed: ERROR:  unrecognized parameter "dims"
/var/www/discourse/lib/backup_restore/database_restorer.rb:92: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:149:in `restore'
/var/www/discourse/vendor/bundle/ruby/3.2.0/gems/thor-1.3.0/lib/thor/command.rb:28:in `run'
/var/www/discourse/vendor/bundle/ruby/3.2.0/gems/thor-1.3.0/lib/thor/invocation.rb:127:in `invoke_command'
/var/www/discourse/vendor/bundle/ruby/3.2.0/gems/thor-1.3.0/lib/thor.rb:527:in `dispatch'
/var/www/discourse/vendor/bundle/ruby/3.2.0/gems/thor-1.3.0/lib/thor/base.rb:584:in `start'
script/discourse:290:in `<top (required)>'
/usr/local/lib/ruby/gems/3.2.0/gems/bundler-2.5.3/lib/bundler/cli/exec.rb:58:in `load'
/usr/local/lib/ruby/gems/3.2.0/gems/bundler-2.5.3/lib/bundler/cli/exec.rb:58:in `kernel_load'
/usr/local/lib/ruby/gems/3.2.0/gems/bundler-2.5.3/lib/bundler/cli/exec.rb:23:in `run'
/usr/local/lib/ruby/gems/3.2.0/gems/bundler-2.5.3/lib/bundler/cli.rb:451:in `exec'
/usr/local/lib/ruby/gems/3.2.0/gems/bundler-2.5.3/lib/bundler/vendor/thor/lib/thor/command.rb:28:in `run'
/usr/local/lib/ruby/gems/3.2.0/gems/bundler-2.5.3/lib/bundler/vendor/thor/lib/thor/invocation.rb:127:in `invoke_command'
/usr/local/lib/ruby/gems/3.2.0/gems/bundler-2.5.3/lib/bundler/vendor/thor/lib/thor.rb:527:in `dispatch'
/usr/local/lib/ruby/gems/3.2.0/gems/bundler-2.5.3/lib/bundler/cli.rb:34:in `dispatch'
/usr/local/lib/ruby/gems/3.2.0/gems/bundler-2.5.3/lib/bundler/vendor/thor/lib/thor/base.rb:584:in `start'
/usr/local/lib/ruby/gems/3.2.0/gems/bundler-2.5.3/lib/bundler/cli.rb:28:in `start'
/usr/local/lib/ruby/gems/3.2.0/gems/bundler-2.5.3/exe/bundle:28:in `block in <top (required)>'
/usr/local/lib/ruby/gems/3.2.0/gems/bundler-2.5.3/lib/bundler/friendly_errors.rb:117:in `with_friendly_errors'
/usr/local/lib/ruby/gems/3.2.0/gems/bundler-2.5.3/exe/bundle:20:in `<top (required)>'
/usr/local/bin/bundle:25:in `load'
/usr/local/bin/bundle:25: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/2024-02-18-120937' directory...
Unpausing sidekiq...
Marking restore as finished...
Notifying 'system' of the end of the restore...
Finished!
[FAILED]
Restore done.

pgembeddingsコードをビルドするために使用されるapp.ymlを更新すると、次のエラーが発生します。

hooks:
  after_code:
    - exec:
        cd: $home
        cmd:
          - sudo apt-get install wget ca-certificates
    - exec:
        cd: $home
        cmd:
          - wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | sudo apt-key add -
    - exec:
        cd: $home
        cmd:
          - sudo sh -c 'echo "deb http://apt.postgresql.org/pub/repos/apt/ `lsb_release -cs`-pgdg main" >> /etc/apt/sources.list.d/pgdg.list'
    - exec:
        cd: $home
        cmd:
          - apt-get update
    - exec:
        cd: $home
        cmd:
          - apt-get -y install -y postgresql-server-dev-${PG_MAJOR}
    - exec:
        cd: $home/tmp
        cmd:
          - git clone https://github.com/neondatabase/pg_embedding.git
    - exec:
        cd: $home/tmp/pg_embedding
        cmd:
          - make PG_CONFIG=/usr/lib/postgresql/13/bin/pg_config
    - exec:
        cd: $home/tmp/pg_embedding
        cmd:
          - make PG_CONFIG=/usr/lib/postgresql/13/bin/pg_config install
    - exec:
        cd: $home
        cmd:
          - su postgres -c 'psql discourse -c "create extension if not exists embedding;"'
    - exec:
        cd: $home/plugins
        cmd:
          - git clone https://github.com/discourse/docker_manager.git
          - git clone https://github.com/discourse/discourse-question-answer.git
          - git clone https://github.com/discourse/discourse-solved.git
          - git clone https://github.com/discourse/discourse-gamification.git
          - git clone https://github.com/discourse/discourse-restricted-replies.git
          - git clone https://github.com/discourse/discourse-saved-searches.git
          - git clone https://github.com/discourse/discourse-follow.git
          - git clone https://github.com/discourse/discourse-yearly-review.git
          - git clone https://github.com/discourse/discourse-voting.git
          - git clone https://github.com/discourse/discourse-no-bump.git
          - git clone https://github.com/discourse/discourse-math.git
          - git clone https://github.com/discourse/discourse-akismet.git
          - git clone https://github.com/discourse/discourse-adplugin.git
          - git clone https://github.com/spirobel/discourse-matheditor.git
          - git clone https://github.com/discourse/discourse-google-one-tap.git
          - git clone https://github.com/merefield/discourse-chatbot.git
          - git clone https://github.com/discourse/discourse-ai.git
#          - git clone https://github.com/paviliondev/discourse-custom-wizard.git
          - git clone https://github.com/discourse/discourse-reactions.git
#          - git clone https://github.com/discourse/discourse-subscriptions.git

プラグインの履歴を持つ@kuazaと一緒に確認しました。

上記のエラーの原因となっていたインデックスを dump.sql から削除し、復元しました。

このインデックスを削除する更新スクリプトがありましたが、プラグインの一部のユーザーは更新に気づいていない可能性があります。

現在、ビルドアップしていますが、ブラウザからの接続がありません。

問題のインデックスなしでコンテナを再度起動し、app.ymlpgembedding をビルドするための古いスクリプトはすべて削除されたため、プラグインはありますがクリーンな状態です。

コンテナは起動しており、問題なく接続できます。

psql も起動しているようで、コンテナ内でデータベースプロンプトを問題なく表示できます。

コンテナ内で rails c を問題なく開くことができます。

/var/discourse/shared/standalone/log/rails# tail -n 200 production.log

には、明白なエラーメッセージは表示されません。

現在、途方に暮れています。

他に確認すべきことはありますか?

「いいね!」 1

チェックが1つ漏れていました…

コンテナに入ってこれを実行します:

curl 0.0.0.0:3000

次にこれを試してみます…

「いいね!」 2

これを実行すると、セットアップHTMLページのコードが表示されます。問題はDNSが原因だと思います。そして、このナンセンスが私を苦しめています。

これを実行したところ、動作しているように見えましたが、実際にはウェブサーバーが動作しておらず、この方法では理解できませんでした。コンテナに入ってこのコードを実行すると、nginxが動作しているかどうかを確認できます。

nginx -t

しかし、このトピックの問題には、あなたのメッセージから解決策をコピーして回答したいと思います。nginxの問題は全く異なり、新しいインストールで別のドメインでテストしています。再びエラーが発生した場合は、別の問題として報告します。

件名のバックアップが機能しない問題は、もはや使用されていないテーブルまたはレコードが原因です。チャットボットプラグインが使用しなくなったレコードだと思いますが、アップデート中に削除されませんでした。プラグイン作者の友人がこれを解決したと思いますので、ご安心ください :slight_smile: エラー行を削除し、再パッケージ化して管理画面からインストールしたところ、問題なく動作しました。または、サーバーからダウンロードすることもできます。

破損したプラグインファイルを修正する説明:

  • バックアップを解凍します: tar -xvzf foo.tar.gz
  • dump.sqlファイルを解凍します
  • 不要なインデックスを作成する問題のある行を削除します:
--
-- TOC entry 8020 (class 1259 OID 84313)
-- Name: hnsw_index_on_chatbot_post_embeddings; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX hnsw_index_on_chatbot_post_embeddings ON public.chatbot_post_embeddings_old USING hnsw (embedding) WITH (dims='1536', m='64', efconstruction='64', efsearch='64');
  • dump.sqlファイルを再度圧縮します
  • アップロードフォルダと一緒にディレクトリにまとめます
  • 全体を再度tar.gz圧縮します
  • このファイルを直接復元します

もし別のテーブルのエラーが発生した場合は、上記の方法でそのレコードが含まれるテーブルを削除すれば修正されると思います。

一生懸命取り組んで成長し始めていた私のサイトは、2日間ダウンしていました。一睡もできない夜と一日を忘れないでください。このようなイベントが私たちに起こる可能性は常にあります。バックアップを作成し、バックアップが機能していることを確認することを忘れないでください。このプロセス中に助けてくれた私の兄弟 @merefield に感謝したいと思います。私たちは一緒に新しいことを学びました。

「いいね!」 3

この方法で同じエラーが解決しました。投稿していただきありがとうございます。

「いいね!」 1

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.