리빌드 관련 문제 발생

앱 재구축을 시도하고 있는데 ‘bundle exec rake db:migrate’ 실행 시 실패가 발생하고 있습니다. 이는 이미 상당 기간 동안 운영되고 있는 기존 설치 환경입니다. 이 문제에 대해 검색해 본 결과 대부분 플러그인과 관련이 있는 것으로 보이지만, 저는 추가 플러그인을 사용하지 않고 있습니다. 표준 Discourse만 사용 중입니다. 디스크 공간도 충분합니다. 관련 로그는 아래에 첨부합니다. 조언이 있을까요?

감사합니다!

I, [2024-10-18T01:38:00.111880 #1]  INFO -- : > exec chpst -u redis -U redis /usr/bin/redis-server /etc/redis/redis.conf
I, [2024-10-18T01:38:00.114128 #1]  INFO -- : > sleep 10
1793:C 18 Oct 2024 01:38:00.127 # oO0OoO0OoO0Oo Redis is starting oO0OoO0OoO0Oo
1793:C 18 Oct 2024 01:38:00.127 # Redis version=7.0.7, bits=64, commit=00000000, modified=0, pid=1793, just started
1793:C 18 Oct 2024 01:38:00.128 # Configuration loaded
1793:M 18 Oct 2024 01:38:00.129 * monotonic clock: POSIX clock_gettime
1793:M 18 Oct 2024 01:38:00.129 # Warning: Could not create server TCP listening socket *:6379: bind: Address already in use
1793:M 18 Oct 2024 01:38:00.130 # Failed listening on port 6379 (TCP), aborting.
I, [2024-10-18T01:38:10.121847 #1]  INFO -- :
I, [2024-10-18T01:38:10.125839 #1]  INFO -- : > cd /var/www/discourse && su discourse -c 'bundle exec rake db:migrate'
rake aborted!
[checklist] Javascript files under `assets/javascripts` are automatically included in JS bundles.
Manual register_asset calls should be removed. (attempted to add javascripts/checklist_ui.js)
/var/www/discourse/lib/plugin/instance.rb:723:in `register_asset'
/var/www/discourse/plugins/discourse-plugin-checklist/plugin.rb:7:in `activate!'
/var/www/discourse/lib/plugin/instance.rb:780:in `instance_eval'
/var/www/discourse/lib/plugin/instance.rb:780:in `activate!'
/var/www/discourse/lib/discourse.rb:348:in `block in activate_plugins!'
/var/www/discourse/lib/discourse.rb:345:in `each'
/var/www/discourse/lib/discourse.rb:345:in `activate_plugins!'
/var/www/discourse/config/application.rb:232:in `block in <class:Application>'
/var/www/discourse/lib/plugin.rb:6:in `initialization_guard'
/var/www/discourse/config/application.rb:232:in `<class:Application>'
/var/www/discourse/config/application.rb:75:in `<module:Discourse>'
/var/www/discourse/config/application.rb:74:in `<top (required)>'
/var/www/discourse/Rakefile:7:in `<top (required)>'
/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>'
(See full trace by running task with --trace)
I, [2024-10-18T01:38:12.504780 #1]  INFO -- :
I, [2024-10-18T01:38:12.506202 #1]  INFO -- : Terminating async processes
I, [2024-10-18T01:38:12.507158 #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: 38
2024-10-18 01:38:12.507 UTC [38] LOG:  received fast shutdown request
I, [2024-10-18T01:38:12.508420 #1]  INFO -- : Sending TERM to exec chpst -u redis -U redis /usr/bin/redis-server /etc/redis/redis.conf pid: 106
106:signal-handler (1729215492) Received SIGTERM scheduling shutdown...
2024-10-18 01:38:12.514 UTC [38] LOG:  aborting any active transactions
2024-10-18 01:38:12.529 UTC [38] LOG:  background worker "logical replication launcher" (PID 53) exited with exit code 1
2024-10-18 01:38:12.530 UTC [48] LOG:  shutting down
2024-10-18 01:38:12.550 UTC [38] LOG:  database system is shut down
106:M 18 Oct 2024 01:38:12.583 # User requested shutdown...
106:M 18 Oct 2024 01:38:12.584 * Saving the final RDB snapshot before exiting.
106:M 18 Oct 2024 01:38:12.746 * DB saved on disk
106:M 18 Oct 2024 01:38:12.747 # Redis is now ready to exit, bye bye...


FAILED
--------------------
Pups::ExecError: cd /var/www/discourse && su discourse -c 'bundle exec rake db:migrate' failed with return #<Process::Status: pid 1796 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"=>"migrate", "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.
aa541b3e83ae7262e9352dc3a8f5da689f39fba35f9b43aa5643ea6e11109dd8
==================== END REBUILD LOG ====================
Failed to rebuild app.

안녕하세요, Dr에게 물어보셨나요? ./discourse-doctor
또한, 서버 재부팅은 극단적인 방법이지만, 과거에 제게는 효과가 있었습니다.

아주 오래된 버전에서 업그레이드 중이신가요?

discourse doctor를 실행해 보았습니다. 다시 재구성을 시도하는 것 외에는 별로 유용한 결과를 주지 않았습니다. 서버를 재부팅해도 아무런 변화가 없었습니다 :confused:

마이너 버전이 두 개 뒤처져 있으니, 아주 오래된 버전은 아닙니다.

저도 오늘 밤 업데이트를 하다가 비슷한 오류가 발생했어요. ./launcher rebuild app을 두 번째로 실행하니 해결되었어요. 한 번 더 시도해 보시는 건 어떨까요?

이것이 문제입니다

git status를 통해 현재 Discourse의 어느 브랜치에 있는지 확인해서 여기에 공유해 주시겠어요?

소스 코드를 살펴보면 그런 명령어가 존재하지 않으므로, 에러 메시지가 제게는 다소 이해하기 어렵습니다.

“main 브랜치에 있습니다”

여전히 이 문제를 겪고 있으며, 해결을 위한 모든 시도가 실패했습니다. 혹시 해결 방법을 아시는 분 계신가요?

드디어 문제를 해결했습니다. 빌드 출력을 정리하던 중, 인식되지 않는 플러그인에 대한 메시지가 포함된 줄을 발견했습니다. app.yml 파일을 열어 확인해 보니 docker_manager와 discourse-checklist 두 개만 나열되어 있었습니다. discourse-checklist를 살펴보니 코어에 이미 통합되어 있었기 때문에 app.yml에서 해당 항목을 제거했습니다. 그 후로 빌드가 정상적으로 진행되었습니다.