MAXMINDの日次制限を使い切ると、リビルドが常に失敗します。

次のリリースまでに修正できますか、お願いします!新しいVPS(毎回IPアドレスが異なる)のデプロイをテストしていますが、3回に2回は失敗します。

「いいね!」 2

MaxMind データベースのダウンロードに失敗した場合に再構築が失敗するのを防ぐための迅速な修正をリリースしたことに注意してください。

Discourse 3.3 がリリースされたら、MaxMind データベースのダウンロードのエラー発生をさらに軽減する方法を再検討します。

「いいね!」 4

うーん、まだ失敗します(クリーンインストール、再構築ではありません)?

I, [2024-07-30T05:19:47.753779 #1]  INFO -- : cd /var/www/discourse & su discourse -c 'SKIP_EMBER_CLI_COMPILE=1 bundle exec rake themes:update assets:precompile'
Purging temp files
Bundling assets
I, [2024-07-30T05:19:58.764890 #1059]  INFO -- : Writing /var/www/discourse/public/assets/break_string-cc617154cd957804f2f6a1f3bc68258c9cdca3d4b9a322bf777d145fed04790e.js
I, [2024-07-30T05:19:58.787966 #1059]  INFO -- : Writing /var/www/discourse/public/assets/service-worker-77c5660ded6e2c94a6a5ce2594411b46d0e15a1f5b9065e57b85652d7cbe3ead.js
I, [2024-07-30T05:19:58.797458 #1059]  INFO -- : Writing /var/www/discourse/public/assets/locales/i18n-3b40e842fd72b9bcc74ea83e094c823cd9ca535e4ecc5e78722e6f99d3656137.js
I, [2024-07-30T05:19:58.807019 #1059]  INFO -- : Writing /var/www/discourse/public/assets/scripts/discourse-test-listen-boot-9b14a0fc65c689577e6a428dcfd680205516fe211700a71c7adb5cbcf4df2cc5.js
rake aborted!
Zlib::BufError: buffer error (Zlib::BufError)
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/sprockets-3.7.3/lib/sprockets/cache/file_store.rb:100:in `<'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/sprockets-3.7.3/lib/sprockets/cache/file_store.rb:100:in `set'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/sprockets-3.7.3/lib/sprockets/cache.rb:212:in `set'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/sprockets-3.7.3/lib/sprockets/cache.rb:136:in `set'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/sprockets-3.7.3/lib/sprockets/loader.rb:243:in `store_asset'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/sprockets-3.7.3/lib/sprockets/loader.rb:185:in `load_from_unloaded'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/sprockets-3.7.3/lib/sprockets/loader.rb:60:in `block in load'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/sprockets-3.7.3/lib/sprockets/loader.rb:317:in `fetch_asset_from_dependency_cache'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/sprockets-3.7.3/lib/sprockets/loader.rb:44:in `load'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/sprockets-3.7.3/lib/sprockets/cached_environment.rb:20:in `block in initialize'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/sprockets-3.7.3/lib/sprockets/cached_environment.rb:47:in `load'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/sprockets-3.7.3/lib/sprockets/base.rb:66:in `find_asset'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/sprockets-3.7.3/lib/sprockets/base.rb:73:in `find_all_linked_assets'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/sprockets-3.7.3/lib/sprockets/manifest.rb:134:in `block in find'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/sprockets-3.7.3/lib/sprockets/manifest.rb:133:in `each'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/sprockets-3.7.3/lib/sprockets/manifest.rb:133:in `find'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/sprockets-3.7.3/lib/sprockets/manifest.rb:186:in `compile'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/sprockets-rails-3.5.1/lib/sprockets/rails/task.rb:67:in `block (3 levels) in define'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/sprockets-3.7.3/lib/rake/sprocketstask.rb:147:in `with_logger'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/sprockets-rails-3.5.1/lib/sprockets/rails/task.rb:66:in `block (2 levels) in define'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/rake-13.2.1/exe/rake:27:in `<top (required)>'
/usr/local/bin/bundle:25:in `load'
/usr/local/bin/bundle:25:in `<main>'
Tasks: TOP => assets:precompile
(See full trace by running task with --trace)
I, [2024-07-30T05:20:01.382260 #1]  INFO -- : Downloading MaxMindDB...

I, [2024-07-30T05:20:01.438870 #1]  INFO -- : Terminating async processes
I, [2024-07-30T05:20:01.444360 #1]  INFO -- : Sending INT to HOME=/var/lib/postgresql USER=postgres exec chpst -u postgres:postgres:ssl-
cert -U postgres:postgres:ssl-cert /usr/lib/postgresql/13/bin/postmaster -D /etc/postgresql/13/main pid: 57
2024-07-30 05:20:01.448 UTC [57] LOG:  received fast shutdown request
I, [2024-07-30T05:20:01.449248 #1]  INFO -- : Sending TERM to exec chpst -u redis -U redis /usr/bin/redis-server /etc/redis/redis.conf p
id: 120
120:signal-handler (1722316801) Received SIGTERM scheduling shutdown...
2024-07-30 05:20:01.512 UTC [57] LOG:  aborting any active transactions
120:M 30 Jul 2024 05:20:01.523 # User requested shutdown...
120:M 30 Jul 2024 05:20:01.526 * Saving the final RDB snapshot before exiting.
2024-07-30 05:20:01.566 UTC [57] LOG:  background worker "logical replication launcher" (PID 72) exited with exit code 1
120:M 30 Jul 2024 05:20:01.586 * DB saved on disk
120:M 30 Jul 2024 05:20:01.589 # Redis is now ready to exit, bye bye...
2024-07-30 05:20:01.598 UTC [67] LOG:  shutting down
2024-07-30 05:20:02.090 UTC [57] LOG:  database system is shut down


FAILED
--------------------
Pups::ExecError: cd /var/www/discourse & su discourse -c 'SKIP_EMBER_CLI_COMPILE=1 bundle exec rake themes:update assets:precompile' fa
iled with return #<Process::Status: pid 1057 exit 1>
Location of failure: /usr/local/lib/ruby/gems/3.3.0/gems/pups-1.2.1/lib/pups/exec_command.rb:132:in `spawn'
exec failed with the params {"cd"=>"$home", "tag"=>"precompile", "hook"=>"assets_precompile", "cmd"=>["su discourse -c 'SKIP_EMBER_CLI_COMPILE=1 bundle exec rake themes:update assets:precompile'"]}
bootstrap failed with exit code 1
** 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.
c9da27502f7c288ec5465ca82b4830123a3c59003527b8f288457c594576adaa
x86_64 arch detected.

確認ですが、discourse/docs/INSTALL-cloud.md at main · discourse/discourse · GitHub に従い、MaxMind の有効な認証情報を取得しましたか?

はい、標準インストールで、app.yml に有効な maxmind account_id と license_key があります。

確認ですが、stable ではなく tests-passed ブランチを使用していますか?無効な maxmind キーでテストしましたが、エラーは発生していません。

問題自体が認証情報の誤りによるものかどうかわかりませんが、正しい認証情報を使用しても再構築が失敗する傾向があります。

「いいね!」 2

はい

まさに、有効なキーを使用しています!(先ほど2回目の試行で、新しいVPS、異なるIPを使用しましたが、同じエラーで失敗しました)。

「いいね!」 1

管理画面からDockerをアップデート中にエラーが発生しました。作成されたファイルが原因で問題が発生しているのではないかと考えています。このエラーは常に同じように発生し、maxmindを閉じるとエラーは発生しません。この2つの構造の間で問題が発生しており、互いに影響を与えているようです。

Maxmindはここではミスリードだと思います。バックトレースはMaxmindを全く指しておらず、sprocketsでエラーが発生していることを示しています。ドロップレットで再現できるか、さらに調査する必要があります。

「いいね!」 3

私もそう思います。Maxmindは問題ないかもしれませんが、その活動は一部の地域で問題を顕在化させます。

「いいね!」 1

デジタルオーシャンで実行していますか?もしそうなら、選択したvCPUの数とRAMの量を教えていただけますか?

いいえ、自分のサーバーを持っており、PostgreSQLは別のサーバーにあります。ここにメモしておきましたので、確認してください。

サーバーのRAMとCPUはどのくらいですか?再現しようとしていますが、ドロップレットで何度も再構築してもエラーが発生しません。

メインサーバー 25GB RAM
PostgreSQLサーバー 20GB RAM

CPU 8
CPUコア 4

db_shared_buffers: "4096MB"
UNICORN_WORKERS: 8
UNICORN_SIDEKIQ_MAX_RSS: 1500
## プラグインはここに記述
## 詳細については https://meta.discourse.org/t/19157 を参照
hooks:
  after_code:
     - 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/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
          - git clone https://github.com/discourse/discourse-assign.git
#         - git clone https://github.com/discourse/discourse-policy.git
          - git clone https://github.com/discourse/discourse-data-explorer.git
#         - git clone https://github.com/merefield/discourse-chatbot.git

#  after_assets_precompile:
#     - exec:
#        cd: $home
#        cmd:
#          - sudo -E -u discourse bundle exec rake s3:upload_assets
#          - sudo -E -u discourse bundle exec rake s3:expire_missing_assets
#          - sudo -E -u discourse bundle exec rake uploads:migrate_to_s3

本日、RAMが16GB(ただし他のものも実行中)で、スレッドが12以上(詳細は明日確認できます)のマシンで同様の問題が発生しました。MaxMindは関係ないように思えますが、MaxMindを無効にすると常に問題が解決します(本日行ったことです)。

しかし、今あなたと私がMaxMind関数にrescueを追加してみましたが、問題は解決しません。

もしかしたら、その前にプリコンパイルで何か起こっているのでしょうか?

「いいね!」 2

これについては疑問があります: assets:precompile

この一連の出来事をたどり、その間で発生したインシデントを調べれば、何らかの洞察が得られるかもしれません。

アセットのバンドル

MaxMindDBのダウンロード..
(おそらく間違いはこれらの間にある)
assets:precompile

assets:precompile を実行している間に Maxmind データベースをダウンロードしていることに気づきました。表示されているバックトレースに基づいて、Maxmind データベースをダウンロードするために使用しているバックグラウンドスレッドが、何らかの方法で assets:precompile を妨害しているのではないかという仮説を立てています。

上記を修正して最初にリリースし、Maxmind データベースのダウンロードをビルドプロセスから除外する予定なので、根本原因の深掘りはしません。

「いいね!」 5

それは素晴らしいアイデアですね。明日、いくつかのサイトでMaxMindを再度有効にしてみます。

今すぐテストできますか?管理者のアップデートでエラーが発生したため、SSHから実行しようとしましたが、そこでもエラーが発生しました。方法を教えていただければ、最初に試すことができます。

「いいね!」 1