다음 릴리스 전에 이 문제가 수정될 수 있을까요, 제발! 새로운 VPS 배포를 테스트 중인데(매번 IP가 다름) 여전히 3번 중 2번은 실패합니다.
Maxmind 데이터베이스 다운로드 실패 시 재빌드가 실패하지 않도록 방지하는 빠른 수정 사항을 방금 배포했습니다.
Discourse 3.3이 출시되면 Maxmind 데이터베이스 다운로드의 오류 발생 가능성을 줄이는 방법에 대해 다시 검토할 예정입니다.
음, 제 경우에는 여전히 실패하네요 (재빌드가 아닌 클린 설치)?
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.
확인 차 말씀드리면, https://github.com/discourse/discourse/blob/main/docs/INSTALL-cloud.md를 따랐고 maxmind에 대한 유효한 자격 증명을 보유하고 계신 것이 맞습니까?
네, 표준 설치이며 app.yml에 유효한 maxmind 계정 ID와 license_key가 설정되어 있습니다.
확인 차원에서, tests-passed 분기에 있고 stable이 아닌가요? 방금 잘못된 maxmind 키로 테스트해 보았지만 어떤 오류도 확인되지 않습니다.
문제가 잘못된 자격 증명 때문인지에 대해서는 확신할 수 없지만, 올바른 자격 증명을 사용해도 재구축이 실패하는 경향이 있습니다.
네.
맞습니다, 저는 유효한 키를 사용 중입니다! (방금 두 번째 시도, 새로운 VPS, 다른 IP, 그래도 같은 오류로 실패합니다.)
관리자 권한으로 Docker를 업데이트하던 중 오류가 발생했습니다. 생성된 파일들이 문제의 원인이 아닐까 추측해 봅니다. 이 오류는 항상 동일한 방식으로 발생하며, maxmind를 종료하면 오류가 나타나지 않습니다. 이 두 구조 사이에 문제가 있으며, 서로 영향을 주고받는 것으로 보입니다:
Maxmind이 여기서는 관련이 없는 것 같다는 생각이 들고 있습니다. 백트레이스는 Maxmind를 전혀 가리키지 않고, sprockets에서 오류가 발생하고 있음을 나타내고 있습니다. 드롭렛에서 이를 재현할 수 있는지 확인하려면 더 깊이 파고들어야 할 것 같습니다.
저도 같은 생각입니다. Maxmind 자체가 문제가 되지는 않을 수 있지만, 그 활동으로 인해 일부 영역에서 문제들이 부각되고 있습니다.
digitalocean에서 이걸 실행 중이신가요? 그렇다면 선택하신 vCPU와 RAM 수량을 알려주실 수 있나요?
아니요, 제 서버는 따로 있고 PostgreSQL은 다른 서버에 있습니다. 여기에 메모를 남겼으니 확인해 주세요:
서버에 RAM과 CPU가 각각 얼마나 있나요? 이 문제를 재현하려고 드롭렛에서 여러 번 빌드를 다시 수행해 보고 있지만, 에러를 재현하지 못하겠습니다.
25GB RAM 메인 서버
20GB RAM PostgreSQL 서버
8 CPU
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를 추가해 봤는데도 문제가 해결되지 않습니다.
아마도 그 전에 실행되는 precompile 관련 부분에서 무언가 일어나고 있는 건 아닌지 모르겠습니다.
이 부분에 대해 의문이 듭니다: assets:precompile
이 일련의 과정과 그 사이에 발생한 사건들을 살펴보면 몇 가지 통찰을 얻을 수 있을지도 모릅니다:
Bundling assets
…
Downloading MaxMindDB..
… (아마도 실수는 이 사이에 있을지도 모릅니다)
assets:precompile
assets:precompile을 실행하는 동안 백그라운드 스레드에서 Maxmind 데이터베이스를 다운로드하고 있다는 사실을 방금 깨달았습니다. 제가 확인한 백트레이스를 근거로, Maxmind 데이터베이스를 다운로드하는 데 사용하는 백그라운드 스레드가 assets:precompile에 어떤 방식으로든 영향을 주고 있다는 가설을 세웠습니다.
우리는 Maxmind 데이터베이스 다운로드를 빌드 프로세스에서 분리할 예정이므로, 먼저 위의 수정 사항을 배포하고 근본 원인에 대해 너무 깊이 파고들지 않겠습니다.
좋은 아이디어네요. 내일 몇몇 사이트에서 maxmind를 다시 켜서 테스트해 볼게요.
지금 테스트해도 될까요? 관리자 업데이트 시 오류가 발생해서 SSH로 시도해보려 했는데, 거기서도 오류가 났거든요. 방법을 알려주시면 제가 먼저 시도해볼게요.


