업그레이드 실패 - 앱 재빌드 시 부트스트랩 오류 발생

업그레이드가 필요하다는 알림을 받아 관리자로 접속해 보니 다음과 같은 메시지가 표시되었습니다:

업그레이드 링크를 클릭하니 확인 작업이 실행되었지만, 두 항목 모두 "최신 상태"라고 반환되었습니다. 그래서 ./launcher rebuild app을 실행해 보았는데 다음과 같은 오류가 발생했습니다:

FAILED
--------------------
Pups::ExecError: cd /var/www/discourse && sudo -H -E -u discourse bash -c '
  set -o errexit
  if [ $(git rev-parse --is-shallow-repository) == "true" ]; then
      git remote set-branches --add origin main
      git remote set-branches origin tests-passed
      git fetch --depth 1 origin tests-passed
  else
      git fetch --tags --prune-tags --prune --force origin
  fi
' failed with return #<Process::Status: pid 130 exit 128>
Location of failure: /usr/local/lib/ruby/gems/3.2.0/gems/pups-1.2.1/lib/pups/exec_command.rb:132:in `spawn'
exec failed with the params {"cd"=>"$home", "hook"=>"code", "cmd"=>["sudo -H -E -u discourse git reset --hard", "sudo -H -E -u discourse git clean -f", "sudo -H -E -u discourse bash -c '\n  set -o errexit\n  if [ $(git rev-parse --is-shallow-repository) == \"true\" ]; then\n      git remote set-branches --add origin main\n      git remote set-branches origin $version\n      git fetch --depth 1 origin $version\n  else\n      git fetch --tags --prune-tags --prune --force origin\n  fi\n'", "sudo -H -E -u discourse bash -c '\n  set -o errexit\n  if [[ $(git symbolic-ref --short HEAD) == $version ]] ; then\n      git pull\n  else\n      git -c advice.detachedHead=false checkout $version\n  fi\n'", "sudo -H -E -u discourse git config user.discourse-version $version", "mkdir -p tmp", "chown discourse:www-data tmp", "mkdir -p tmp/pids", "mkdir -p tmp/sockets", "touch tmp/.gitkeep", "mkdir -p                    /shared/log/rails", "bash -c \"touch -a           /shared/log/rails/{production,production_errors,unicorn.stdout,unicorn.stderr,sidekiq}.log\"", "bash -c \"ln    -s           /shared/log/rails/{production,production_errors,unicorn.stdout,unicorn.stderr,sidekiq}.log $home/log\"", "bash -c \"mkdir -p           /shared/{uploads,backups}\"", "bash -c \"ln    -s           /shared/{uploads,backups} $home/public\"", "bash -c \"mkdir -p           /shared/tmp/{backups,restores}\"", "bash -c \"ln    -s           /shared/tmp/{backups,restores} $home/tmp\"", "chown -R discourse:www-data /shared/log/rails /shared/uploads /shared/backups /shared/tmp", "[ ! -d public/plugins ] || find public/plugins/ -maxdepth 1 -xtype l -delete"]}
bootstrap failed with exit code 128
** 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.
fd6a747d640a06c375439c5c134aa46ff11ceb8f677d6d16247cb57c9772f731

이후 ./discourse-doctor을 실행했는데 사이트가 다시 정상적으로 올라왔습니다(다만 이상하게도 테스트 이메일이 타임아웃되었는데, 이는 별개의 문제일 수도 있습니다). 그래서 다시 ./launcher rebuild app을 시도해 보았지만 동일한 문제로 부트스트랩이 실패했습니다.

이 문제에 대해 아이디어가 있는 분이 있을까요? 저는 Ubuntu 22.04에서 Docker를 사용 중입니다.

그렇게 해서 해당 정보를 여기에 추가해 주시겠어요?

app rebuild의 전체 로그입니다:

discourse-log.log.txt (17.7 KB)

app stop과 app start를 시도하면 다시 정상적으로 올라오는 것을 확인했습니다. 하지만 이는 여전히 구버전인 것 같습니다.

맞습니다. 전체 로그가 필요한 것은 아니며, 경고가 아닌 명백한 오류만 필요합니다.

(왜 그 링크에서 업로드가 안 되는지 모르겠지만) 그 로그를 보면 눈에 띄는 명백한 오류는 다음과 같습니다:

fatal: unable to access 'https://github.com/discourse/discourse.git/': Could not resolve host: github.com

이건 별로 좋은 신호가 아닌 것 같은데?

서버에서 ~$ host github.com을 실행하면 정상적으로 이름이 해석됩니다.

오류가 명백했다면 그는 게시물을 올리지 않았을 것입니다. :slight_smile: (하지만 진지하게 말씀드리자면, 해당 로그에 익숙하지 않은 사람이 어떤 부분이 중요하고 어떤 부분이 아닌지 파악하기는 꽤 어렵습니다. 그리고 오류의 원인을 잘못 추측한 사례가 수백 개의 주제에서 발견될 수 있습니다.

Docker 네트워크가 어떻게든 깨진 것 같습니다. Docker가 최신 버전인가요? 운영체제도 최신인가요?

하지만 @gilgongo가 딱이었어요 :wink:

아 - 네트워킹이군요? 자, “기본적인” 작업을 하려고 systemctl restart docker.service를 실행한 뒤 ./launcher rebuild app를 실행했고 (수만 년처럼 길게 느껴졌지만) 결국 다시 올라와서 작동했습니다! 이제 "3.3.0.beta3-dev"를 실행 중이라고 표시되는데, 이건 좋은 신호인 것 같네요? 적어도 지금은 작동하는 것 같습니다.

휴 - 도움 주셔서 감사합니다! Discourse 정말 좋아합니다!