이것은 테스트 머신에서 발생한 문제입니다. 이전에 이 머신에서 Discourse를 실행하고 있었는데, 설치를 엉망으로 만들었고 최신 버전으로 업데이트하지 못했는데, 이는 제 실수라고 생각했습니다. Discourse 디렉터리 전체를 삭제하고 Docker를 정리한 후, 라이브 DB에서 백업을 가져오기 전에 완전히 새로운 설치를 시도했습니다.
이상하게도 해결할 수 없는 동일한 문제가 계속 발생하고 있습니다.
아래는 실패 출력 결과입니다. discourse-doctor를 이미 시도해 보았지만 도움이 되는 내용은 나오지 않았습니다.
...
I, [2022-06-04T18:42:29.087446 #1] INFO -- : Terminating async processes
I, [2022-06-04T18:42:29.087672 #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-06-04T18:42:29.087881 #1] INFO -- : Sending TERM to exec chpst -u redis -U redis /usr/bin/redis-server /etc/redis/redis.conf pid: 103
2022-06-04 18:42:29.088 UTC [42] LOG: received fast shutdown request
103:signal-handler (1654368149) Received SIGTERM scheduling shutdown...
2022-06-04 18:42:29.118 UTC [42] LOG: aborting any active transactions
2022-06-04 18:42:29.123 UTC [42] LOG: background worker "logical replication launcher" (PID 51) exited with exit code 1
2022-06-04 18:42:29.123 UTC [46] LOG: shutting down
103:M 04 Jun 2022 18:42:29.154 # User requested shutdown...
103:M 04 Jun 2022 18:42:29.154 * Saving the final RDB snapshot before exiting.
103:M 04 Jun 2022 18:42:29.159 * DB saved on disk
103:M 04 Jun 2022 18:42:29.159 # Redis is now ready to exit, bye bye...
2022-06-04 18:42:29.201 UTC [42] LOG: database system is shut down
FAILED
--------------------
Pups::ExecError: cd /var/www/discourse && su discourse -c 'bundle exec rake db:migrate' failed with return #<Process::Status: pid 1102 exit 1>
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"=>"db_migrate", "cmd"=>["su discourse -c 'bundle exec rake db:migrate'"]}
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.
69cb25658efb6f16e4479bb98a2d0278d72e56028865730841ac1efacc5b8d9d
==================== END REBUILD LOG ====================
서버 자체는 문제없는 것 같습니다 - 디스크 공간이 충분하고 다른 리소스도 부족하지 않습니다. 혹시 아이디어가 있으신가요?
103:M 04 Jun 2022 18:40:07.369 # 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.
음… 16GB RAM은 꽤 넉넉해서 스왑이 필요 없다고 생각할 수 있습니다. 하지만 저는 일부러 추가해도 해롭지 않다고 봅니다. 로그를 확인하지 못한 상태에서는 문제가 메모리 부족 때문이라고 단정할 수 없습니다. 하지만 만약 메모리 부족이 원인이라면, 스왑이 있든 없든 오버커밋(overcommit) 모드를 설정하는 것이 도움이 될 수 있습니다.
좋은 발견이었네요, Ed. 감사합니다. s3_bucket이 어느 시점에 s3_upload_bucket으로 변경된 것 같고, containers/app.yml 파일에 해당 항목이 존재하여 문제가 발생한 것으로 보입니다. 해당 파일의 DISCOURSE_S3_BUCKET을 DISCOURSE_S3_UPLOAD_BUCKET으로 변경한 후 빌드가 정상적으로 진행되었습니다.
이러한 변경 사항이 빌드 프로세스에 체크를 도입하여 이런 문제를 방지할 수 있기를 바랍니다 - 그리고 항상 테스트 머신에서 업데이트를 테스트하는 것이 좋겠습니다.