업그레이드 실패, "FAILED TO BOOTSTRAP", 오류 137

정기적으로 업그레이드를 수행하고 있습니다(대략 한 달에 한 번 정도)가, 빌드를 막는 이런 문제는 겪어본 적이 없습니다. 현재 제 서버에는 접근할 수 없습니다.

제 설치 환경은 꽤 표준적인 구성이라고 생각합니다. 디스크 공간도 넉넉히 비어 있습니다. discourse-doctor를 실행해도 오류나 의심스러운 항목이 나오지 않았습니다. 시스템에 변경된 사항은 전혀 없습니다. launcher rebuild app을 시도하기 전에 git pull을 수행했습니다. 정확한 진단을 위해 더 많은 정보가 필요하다고 생각되면 알려주세요. 로그를 보고도 문제가 무엇인지 정확히 파악이 되지 않습니다. 이 소프트웨어에 더 익숙하신 분이 확인해 주신다면 감사하겠습니다.

사용 중인 플러그인은 다음과 같습니다:

          - git clone https://github.com/discourse/docker_manager.git
          - git clone https://github.com/discourse/discourse-akismet.git
          - git clone https://github.com/discourse/discourse-spoiler-alert.git
          - git clone https://github.com/discourse/discourse-yearly-review.git
          - git clone https://github.com/discourse/discourse-patreon
          - git clone https://github.com/discourse/discourse-solved
          - git clone https://github.com/discourse/discourse-github
          - git clone https://github.com/discourse/discourse-checklist
          - git clone https://github.com/discourse/discourse-tooltips.git
          - git clone https://github.com/discourse/discourse-docs
          - git clone https://github.com/discourse/discourse-user-notes
          - git clone https://github.com/discourse/discourse-math
          - git clone https://github.com/discourse/discourse-chat-integration
          - git clone https://github.com/discourse/discourse-encrypt.git
          - git clone https://github.com/discourse/discourse-footnote
          - git clone https://github.com/discourse/discourse-follow
          - git clone https://github.com/discourse/discourse-push-notifications

빌드 로그의 마지막 부분은 다음과 같습니다:

I, [2022-10-12T15:47:04.673293 #1]  INFO -- : > cd /var/www/discourse && su discourse -c 'LOAD_PLUGINS=0 bundle exec rake plugin:pull_compatible_all'
I, [2022-10-12T15:47:09.943126 #1]  INFO -- : discourse-math is already at latest compatible version
discourse-chat-integration is already at latest compatible version
discourse-spoiler-alert is already at latest compatible version
discourse-encrypt is already at latest compatible version
discourse-tooltips is already at latest compatible version
discourse-follow is already at latest compatible version
docker_manager is already at latest compatible version
discourse-github is already at latest compatible version
discourse-push-notifications is already at latest compatible version
discourse-solved is already at latest compatible version
discourse-akismet is already at latest compatible version
discourse-footnote is already at latest compatible version
discourse-yearly-review is already at latest compatible version
discourse-checklist is already at latest compatible version
discourse-patreon is already at latest compatible version
discourse-docs is already at latest compatible version
discourse-user-notes is already at latest compatible version

I, [2022-10-12T15:47:09.944907 #1]  INFO -- : > cd /var/www/discourse && su discourse -c 'bundle exec rake db:migrate'
I, [2022-10-12T15:47:23.023114 #1]  INFO -- : gem install sawyer -v 0.9.2 -i /var/www/discourse/plugins/discourse-github/gems/2.7.6 --no-document --ignore-dependencies --no-user-install
Successfully installed sawyer-0.9.2
1 gem installed
gem install octokit -v 5.6.1 -i /var/www/discourse/plugins/discourse-github/gems/2.7.6 --no-document --ignore-dependencies --no-user-install
Successfully installed octokit-5.6.1
1 gem installed

I, [2022-10-12T15:47:23.024237 #1]  INFO -- : > cd /var/www/discourse && su discourse -c 'bundle exec rake themes:update assets:precompile'
103:M 12 Oct 2022 15:47:34.098 * 100 changes in 300 seconds. Saving...
103:M 12 Oct 2022 15:47:34.102 * Background saving started by pid 1695
1695:C 12 Oct 2022 15:47:34.384 * DB saved on disk
1695:C 12 Oct 2022 15:47:34.386 * RDB: 0 MB of memory used by copy-on-write
103:M 12 Oct 2022 15:47:34.407 * Background saving terminated with success
- Building
- Building
- building...
Though the "loose" option was set to "false" in your @babel/preset-env config, it will not be used for @babel/plugin-proposal-private-property-in-object since the "loose" mode option was set to "true" for @babel/plugin-proposal-class-properties.
The "loose" option must be the same for @babel/plugin-proposal-class-properties, @babel/plugin-proposal-private-methods and @babel/plugin-proposal-private-property-in-object (when they are enabled): you can silence this warning by explicitly adding
        ["@babel/plugin-proposal-private-property-in-object", { "loose": true }]
to the "plugins" section of your Babel config.
Though the "loose" option was set to "false" in your @babel/preset-env config, it will not be used for @babel/plugin-proposal-private-methods since the "loose" mode option was set to "true" for @babel/plugin-proposal-private-property-in-object.
The "loose" option must be the same for @babel/plugin-proposal-class-properties, @babel/plugin-proposal-private-methods and @babel/plugin-proposal-private-property-in-object (when they are enabled): you can silence this warning by explicitly adding
        ["@babel/plugin-proposal-private-methods", { "loose": true }]
to the "plugins" section of your Babel config.
[WARN] (broccoli-terser-sourcemap) Minifying "assets/discourse.js" took: 26102ms (more than 20,000ms)
Killed
error Command failed with exit code 137.
I, [2022-10-12T15:51:18.234000 #1]  INFO -- : Checking 'discourse-homepage-feature-component' for 'default'... up to date
Checking 'Versatile Banner' for 'default'... up to date
Checking 'Custom Header Links' for 'default'... yarn run v1.22.19
$ /var/www/discourse/app/assets/javascripts/node_modules/.bin/ember build -prod
Environment: production
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

I, [2022-10-12T15:51:18.245871 #1]  INFO -- : Terminating async processes
I, [2022-10-12T15:51:18.246532 #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: 42
I, [2022-10-12T15:51:18.247499 #1]  INFO -- : Sending TERM to exec chpst -u redis -U redis /usr/bin/redis-server /etc/redis/redis.conf pid: 103
103:signal-handler (1665589878) Received SIGTERM scheduling shutdown...
2022-10-12 15:51:18.249 UTC [42] LOG:  received fast shutdown request
103:M 12 Oct 2022 15:51:18.327 # User requested shutdown...
103:M 12 Oct 2022 15:51:18.327 * Saving the final RDB snapshot before exiting.
2022-10-12 15:51:19.052 UTC [42] LOG:  aborting any active transactions
2022-10-12 15:51:19.100 UTC [42] LOG:  background worker "logical replication launcher" (PID 51) exited with exit code 1
2022-10-12 15:51:19.102 UTC [46] LOG:  shutting down
2022-10-12 15:51:19.188 UTC [42] LOG:  database system is shut down
103:M 12 Oct 2022 15:51:20.072 * DB saved on disk
103:M 12 Oct 2022 15:51:20.073 # Redis is now ready to exit, bye bye...


FAILED
--------------------
Pups::ExecError: cd /var/www/discourse && su discourse -c 'bundle exec rake themes:update assets:precompile' failed with return #<Process::Status: pid 1601 exit 137>
Location of failure: /usr/local/lib/ruby/gems/2.7.0/gems/pups-1.1.1/lib/pups/exec_command.rb:117:in `spawn'
exec failed with the params {"cd"=>"$home", "hook"=>"assets_precompile", "cmd"=>["su discourse -c 'bundle exec rake themes:update assets:precompile'"]}
bootstrap failed with exit code 137
** 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.
5354ffedbf56742079333cb69face684193aaa0afa7f1ff492666e17a2e1f51d

오류 137은 메모리가 부족한 경우일 것 같습니다. 표준 설치를 진행했고, 옵션이 주어졌을 때 스왑을 추가하도록 했나요?

비슷한 오류에 대해 꽤 유용한 논의가 있는 이 토픽이 해당 상황일 수 있는지 참고해 보세요:

기억이 나지 않지만, 2GB 메모리와 2GB 스왑이 있는 VPS입니다.

$ free -h
              total        used        free      shared  buff/cache   available
Mem:          1.9Gi       688Mi        64Mi        33Mi       1.2Gi       1.1Gi
Swap:         2.0Gi       1.0Gi       1.0Gi

안녕하세요! :wave:

free -h 명령어를 실행해서 출력을 공유해 주시겠어요? :slight_smile:

마지막 게시글을 수정했습니다.

이것이 가장 유력한 원인인 것 같습니다. 디스크 공간을 정리하고 apt를 통해 업그레이드를 진행했으며, 재부팅 후 다시 빌드했는데 실제로 완료되었습니다. 패키지 변경 사항은 있었지만, 재부팅으로 인해 빌드가 완료될 만큼 충분한 RAM/스왑이 복구된 것으로 보입니다. 흥미롭게도, 저메모리 문제로 인해 UI를 통한 업그레이드를 중단해야 했지만(저는 전적으로 명령줄을 통해 업그레이드를 수행합니다), 명령줄에서 빌드가 실패한 적은 한 번도 없었습니다. 앞으로 이런 일이 발생하지 않도록 스왑을 1GB 더 늘려보고, UI를 통한 업그레이드 기능을 복원할 수 있는지 확인해 보겠습니다.

추가 업데이트 하나만 더 말씀드리겠습니다. 업그레이드를 진행한 이후, 테스트할 새 업그레이드 버전을 기다리고 있었습니다. 이전에는 RAM이 부족하여 업그레이드 중간에 크래시가 발생했기 때문에 UI를 통한 업그레이드가 불가능했습니다. 커맨드라인 빌드 문제를 스왑 파일 크기를 늘려서 수정한 후, 마침내 UI를 통해 업그레이드에 성공했습니다. 도움을 주셔서 감사합니다.