エラー:古いバージョンのDiscourseイメージを実行しています

こんにちは、これが私の最初の投稿です!私は Nelly Eggsy で、Ghost と Discourse を使ってウェブサイトを構築しています。

通常はフォーラムを潜り、影でトピックを読み漁っています。行き詰まったらフォーラムで答えを検索し、それでたいてい解決します。しかし、今回は行き詰まっていて助けが必要です。

Discourse を管理 UI 経由でアップグレードした後、以下のメッセージが表示されました。

Discourse イメージの古いバージョンを実行しています。
最新イメージを実行するまで、Web UI 経由のアップグレードは無効化されています。

そのためには、SSH を使ってサーバーにログインし、以下のコマンドを実行してください。

    cd /var/discourse
    git pull
    ./launcher rebuild app

コンソールコマンドを使って Discourse と Docker イメージを最新版にアップグレードする方法について、このガイド に従いました。しかし、エラーが発生し、正常にアップグレードできませんでした。

./launcher rebuild app コマンドを実行した際に返されたエラーメッセージは以下の通りです。

> FAILED
> --------------------
> Pups::ExecError: cd /var/www/discourse && su discourse -c 'bundle exec rake themes:update assets:precompile' failed with return #<Process::Status: pid 671 exit 1>
> Location of failure: /pups/lib/pups/exec_command.rb:112:in `spawn'
> exec failed with the params {"cd"=>"$home", "hook"=>"assets_precompile", "cmd"=>["su discourse -c 'bundle exec rake themes:update assets:precompile'"]}
> 9c3a1b4a72818216aaafa5de742f7d1a325aa61497ea49f5b4f1660c6e503fd0
> ** FAILED TO BOOTSTRAP ** please scroll up and look for earlier error messages, there may be more than one.
> ./discourse-doctor may help diagnose the problem.

私の Digital Ocean ドロップレットの仕様は、メモリ 2 GB / ディスク 50 GB + 50 GB / SFO2 - Ubuntu 20.04 上の Discourse です。

私の投稿を読んでいただき、ありがとうございます!皆様からのメッセージを楽しみにしています。

「いいね!」 1

ようこそ、@nelly さん!お困りとのこと、申し訳ありません。これは予想外の大きな問題です。 編集:少し予想外でした。

カスタムプラグインやテーマは使用されていますか?

実際のエラーメッセージをここに貼り付けていただけますか?

「いいね!」 2

@pfaffman さん、ありがとうございます。ご返信をいただき感謝しています。はい、いくつかのカスタムテーマとプラグインを使用しています。

現在使用しているプラグインは以下の通りです:

      - git clone https://github.com/discourse/docker_manager.git
      - git clone https://github.com/paviliondev/discourse-custom-wizard.git
      - git clone https://github.com/discourse/discourse-spoiler-alert.git
      - git clone https://github.com/paviliondev/discourse-landing-pages.git
      - git clone https://github.com/discourse/discourse-patreon.git
      - git clone https://github.com/discourse/discourse-reactions.git

カスタムテーマへのアクセス方法や削除方法がわかりません。

Rafael、

「failed」エラーの直上に表示されている内容は以下の通りです:

rake aborted!
NameError: undefined local variable or method `name' for main:Object
/var/www/discourse/lib/tasks/assets.rake:251:in `rescue in block (2 levels) in <main>'
/var/www/discourse/lib/tasks/assets.rake:240:in `block (2 levels) in <main>'

Caused by:
OpenURI::HTTPError: 401 Error: Invalid license key
/var/www/discourse/lib/file_helper.rb:63:in `block in download'
/var/www/discourse/lib/final_destination.rb:422:in `block (3 levels) in safe_get'
/var/www/discourse/lib/final_destination.rb:421:in `catch'
/var/www/discourse/lib/final_destination.rb:421:in `block (2 levels) in safe_get'
/var/www/discourse/vendor/bundle/ruby/2.7.0/gems/rack-mini-profiler-2.3.2/lib/patches/net_patches.rb:19:in `block in request_with_mini_profiler'
/var/www/discourse/vendor/bundle/ruby/2.7.0/gems/rack-mini-profiler-2.3.2/lib/mini_profiler/profiling_methods.rb:46:in `step'
/var/www/discourse/vendor/bundle/ruby/2.7.0/gems/rack-mini-profiler-2.3.2/lib/patches/net_patches.rb:18:in `request_with_mini_profiler'
/var/www/discourse/lib/final_destination.rb:393:in `block in safe_get'
/var/www/discourse/lib/final_destination.rb:437:in `block in safe_session'
/var/www/discourse/lib/final_destination.rb:434:in `safe_session'
/var/www/discourse/lib/final_destination.rb:385:in `safe_get'
/var/www/discourse/lib/final_destination.rb:134:in `get'
/var/www/discourse/lib/file_helper.rb:55:in `download'
/var/www/discourse/lib/discourse_ip_info.rb:39:in `mmdb_download'
/var/www/discourse/lib/tasks/assets.rake:242:in `block (3 levels) in <main>'
/var/www/discourse/lib/tasks/assets.rake:241:in `each'
/var/www/discourse/lib/tasks/assets.rake:241:in `block (2 levels) in <main>'
Tasks: TOP => assets:precompile
(See full trace by running task with --trace)
I, [2021-05-02T20:17:42.823237 #1]  INFO -- : Downloading MaxMindDB...
Compressing Javascript and Generating Source Maps

お役に立てれば幸いです。事前にお礼申し上げます!

「いいね!」 1

もう少し上にスクロールする必要があると思います。そのライセンスキーのメッセージはMaxmindに関するもので、それが問題の原因だとは思えません。

「いいね!」 1

Jay、

出力結果です。掲示板に投稿できるように大幅に省略しました。

2021-05-03 00:32:20.635 UTC [63] postgres@postgres ERROR:  database "discourse" already exists
2021-05-03 00:32:20.635 UTC [63] postgres@postgres STATEMENT:  CREATE DATABASE discourse;
createdb: error: database creation failed: ERROR:  database "discourse" already exists
I, [2021-05-03T00:32:20.639714 #1]  INFO -- : 
I, [2021-05-03T00:32:20.640335 #1]  INFO -- : > su postgres -c 'psql discourse -c "create user discourse;"' || true
2021-05-03 00:32:20.760 UTC [74] postgres@discourse ERROR:  role "discourse" already exists
2021-05-03 00:32:20.760 UTC [74] postgres@discourse STATEMENT:  create user discourse;
ERROR:  role "discourse" already exists

I, [2021-05-03T00:32:21.634456 #1]  INFO -- : File > /etc/service/redis/run  chmod: +x  chown: 
I, [2021-05-03T00:32:21.640838 #1]  INFO -- : File > /etc/service/redis/log/run  chmod: +x  chown: 
I, [2021-05-03T00:32:21.646998 #1]  INFO -- : File > /etc/runit/3.d/10-redis  chmod: +x  chown: 
I, [2021-05-03T00:32:21.648588 #1]  INFO -- : Replacing daemonize yes with  in /etc/redis/redis.conf
I, [2021-05-03T00:32:21.650175 #1]  INFO -- : Replacing (?-mix:^pidfile.*$) with  in /etc/redis/redis.conf
I, [2021-05-03T00:32:21.651303 #1]  INFO -- : > install -d -m 0755 -o redis -g redis /shared/redis_data
I, [2021-05-03T00:32:21.656597 #1]  INFO -- : 
I, [2021-05-03T00:32:21.657900 #1]  INFO -- : Replacing (?-mix:^logfile.*$) with logfile "" in /etc/redis/redis.conf
I, [2021-05-03T00:32:21.659157 #1]  INFO -- : Replacing (?-mix:^bind .*$) with  in /etc/redis/redis.conf
I, [2021-05-03T00:32:21.660353 #1]  INFO -- : Replacing (?-mix:^dir .*$) with dir /shared/redis_data in /etc/redis/redis.conf
I, [2021-05-03T00:32:21.661652 #1]  INFO -- : Replacing (?-mix:^protected-mode yes) with protected-mode no in /etc/redis/redis.conf
I, [2021-05-03T00:32:21.662825 #1]  INFO -- : Replacing # io-threads 4 with io-threads $redis_io_threads in /etc/redis/redis.conf
I, [2021-05-03T00:32:21.663908 #1]  INFO -- : > echo redis installed
I, [2021-05-03T00:32:21.668192 #1]  INFO -- : redis installed
I, [2021-05-03T00:32:21.669144 #1]  INFO -- : > cat /etc/redis/redis.conf | grep logfile
I, [2021-05-03T00:32:21.679111 #1]  INFO -- : logfile ""
I, [2021-05-03T00:32:21.680077 #1]  INFO -- : > exec chpst -u redis -U redis /usr/bin/redis-server /etc/redis/redis.conf
I, [2021-05-03T00:32:21.683045 #1]  INFO -- : > sleep 10
167:C 03 May 2021 00:32:21.698 # oO0OoO0OoO0Oo Redis is starting oO0OoO0OoO0Oo
167:C 03 May 2021 00:32:21.698 # Redis version=6.2.1, bits=64, commit=00000000, modified=0, pid=167, just started
167:C 03 May 2021 00:32:21.699 # Configuration loaded
167:M 03 May 2021 00:32:21.700 * monotonic clock: POSIX clock_gettime
167:M 03 May 2021 00:32:21.702 * Running mode=standalone, port=6379.
167:M 03 May 2021 00:32:21.702 # Server initialized
167:M 03 May 2021 00:32:21.703 # WARNING overcommit_memory is set to 0! Background save may fail under low memory condition. To fix this issue add 'vm.overcommit_memory = 1' to /etc/sysctl.conf and then reboot or run the command 'sysctl vm.overcommit_memory=1' for this to take effect.
I, [2021-05-03T00:32:41.096190 #1]  INFO -- : > cd /var/www/discourse && bash -c "touch -a           /shared/log/rails/{production,production_errors,unicorn.stdout,unicorn.stderr,sidekiq}.log"
terser '/var/www/discourse/public/assets/_vendor-892d5a1f7dfb58e3f80950989c67133fd6062344153d17e67db8ba3d126c7a1a.js' -m -c -o '/var/www/discourse/public/assets/vendor-892d5a1f7dfb58e3f80950989c67133fd6062344153d17e67db8ba3d126c7a1a.js' --source-map "base='/var/www/discourse/public/assets',root='/assets',url='/assets/vendor-892d5a1f7dfb58e3f80950989c67133fd6062344153d17e67db8ba3d126c7a1a.js.map'"
****************************************************************************************************
#<Thread:0x000055a7feb17780 /var/www/discourse/lib/tasks/assets.rake:239 run> terminated with exception (report_on_exception is true):
/var/www/discourse/lib/tasks/assets.rake:251:in `rescue in block (2 levels) in <main>': undefined local variable or method `name' for main:Object (NameError)
	from /var/www/discourse/lib/tasks/assets.rake:240:in `block (2 levels) in <main>'
/var/www/discourse/lib/file_helper.rb:63:in `block in download': 401 Error: Invalid license key (OpenURI::HTTPError)

お役に立てれば幸いです!

「いいね!」 1

app.yml に MaxMind のライセンスキーの行はありますか?その行を削除して、再ビルドしてみてください。

「いいね!」 4

ありがとうございます!これで何とかなったようですが、少し不十分です。フォーラムのホームページにアクセスすると、「おめでとうございます、Discourse をインストールしました!」というページにリダイレクトされます。以下の質問があります:

フォーラムを再インストールする必要がありますか?既存のコンテンツは残りますか、それともすべて削除されてしまいましたか?

「いいね!」 2

すべてが削除されたように聞こえますが、おそらくまだ残っています。これは久しぶりのアップデートでしたか?Postgres も更新されましたか?私の推測では、Postgres の更新中に何らかの問題が発生し、postgres_old をリネームして最初からやり直す必要があるようです。詳細は PostgreSQL 13 アップデート をご覧ください。

「いいね!」 2

Jay、ちょうど思い出したのですが、アップロードとバックアップを DigitalOcean ブロックストレージに移動させようとしていました。さっきもう一度試みたところ、ホームページにアクセスした際に「Oops」というエラーメッセージが表示されました:

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

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

それ以上の操作は不要です。ただし、エラーが継続する場合は、エラーの再現手順などを含めた追加情報を、サイトのフィードバックカテゴリにディスカッショントピックを投稿して提供してください。

私が実行したコマンドは以下の通りです:

mv /var/discourse/shared/standalone/postgres_data /var/postgres_data_discourse
mv /var/discourse/shared /mnt/discourse-sfo2-01

app.yml には以下を追加しました:

## Docker コンテナはステートレスです。すべてのデータは /shared に保存されます
volumes:
  - volume:
      host: /mnt/discourse-sfo2-01/shared/standalone
      guest: /shared
  - volume:
      host: /mnt/discourse-sfo2-01/shared/standalone/log/var-log
      guest: /var/log
  - volume:
      host: /var/postgres_data_discourse
      guest: /shared/postgres_data

すべてのコマンドは ./launcher rebuild app を問題なく実行しました。

皆さん、申し訳ありません。以前にこれを行ったことを忘れていました。これがおそらく問題の原因になっていると確信しています。

「いいね!」 2

私も再ビルドに失敗した後、これで解決しました。ここで何が問題だったのでしょうか?ありがとうございます!

「いいね!」 3

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