Ruby 버전 불일치로 빌드가 실패합니다

수일 동안
./launcher bootstrap web_only && ./launcher destroy web_only && ./launcher start web_only를 문제 없이 사용해 왔는데,
SiteSetting.can_permanently_delete = true를 설정하기 위해 rails 콘솔을 사용하려다 문제가 발생했습니다.
./launcher enter web_only를 실행한 뒤 rails c를 입력했더니 말이죠.

질문: 개별 컨테이너 모드에서 rails 콘솔에 접근하는 방식이 다른 건가요?

성공적인 재빌드와 부트스트랩에 실패한 후, AI 관련 기능을 구현하기 전으로 서버를 롤백했습니다. 그래도 여전히 문제가 해결되지 않았습니다!
부트스트랩 방식이 다음과 같은 오류와 함께 실패합니다:

FAILED
--------------------
Pups::ExecError: cd /var/www/discourse && su discourse -c 'bundle install --jobs $(($(nproc) - 1)) --retry 3' failed with return #<Process::Status: pid 465 exit 18>
Location of failure: /usr/local/lib/ruby/gems/3.3.0/gems/pups-1.4.0/lib/pups/exec_command.rb:138:in `spawn'
exec failed with the params {"cd"=>"$home", "hook"=>"bundle_exec", "cmd"=>["su discourse -c 'bundle install --jobs $(($(nproc) - 1)) --retry 3'", "su discourse -c 'bundle clean'", "su discourse -c 'find /var/www/discourse/vendor/bundle -name cache -not -path \"*/gems/*\" -type d -exec rm -rf {} +'", "su discourse -c 'find /var/www/discourse/vendor/bundle -name tmp -type d -exec rm -rf {} +'"]}
bootstrap failed with exit code 18
** 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.
aee0f5c110bf8ce78f05c138a78712b4a0116fe6662c998b2f29800715036091

./launcher rebuild web_only도 오류가 납니다.

docker: Error response from daemon: failed to set up container networking: driver failed programming external connectivity on endpoint web_only (06b7b1f7f6b476adac20a11a55de776d7350e837407a6c7a6ba582c917f6dd73): Bind for 0.0.0.0:80

관리자(Admin)에서 Docker Manager를 업데이트한 후에는 다음과 같은 메시지가 표시됩니다.

You are running an old version of the Discourse image
Updates via the web UI are disabled until you run the latest image. To do so log in to your server using SSH and run:

  cd /var/discourse
  ./launcher rebuild app

질문: 여러분은 이 문제가 무엇인지에 대해 어떤 아이디어가 있으신가요?

빌드가 실패하게 만드는 오류는 다음과 같습니다:

[2026-02-17T16:51:13.376629 #1]  INFO -- : > cd /var/www/discourse && su discourse -c 'bundle install --jobs $(($(nproc) - 1)) --retry 3'
Your Ruby version is 3.3.8, but your Gemfile specified ~> 3.4

오류를 찾으려면 위로 스크롤해야 합니다.

네, 그렇게 해 보았지만 도움이 되는 내용은 전혀 보이지 않습니다.
아래는 최신 내용입니다.
exitcode18.txt (43.5 KB)

다음과 같은 오류가 발생했습니다:

[2026-02-17T16:51:13.376629 #1]  INFO -- : > cd /var/www/discourse && su discourse -c 'bundle install --jobs $(($(nproc) - 1)) --retry 3'
Your Ruby version is 3.3.8, but your Gemfile specified ~> 3.4

Discourse Docker를 오래된 버전으로 고정되어 있나요? 아니면 버그일 수도 있지만, 그런 버그가 빌드 테스트를 통과할 가능성은 극히 낮아 보입니다.

Jay, 감사합니다. 그 부분은 봤지만, 빌드가 성공적으로 완료된 경우에도 이상한 메시지가 자주 나타납니다.

아니요, 언급했듯이 OP(원포스터)의 안내를 따랐습니다.

@pfaffman 이동해 주셔서 감사합니다!

/var/discourse를 가져올 수 있을까요? 재빌드는 2.0.20260209-1300 베이스 이미지를 사용해야 합니다.

@supermathie 님, 도움 주셔서 감사합니다.

./launcher rebuild web_only 명령을 새로 실행한 결과 2.0.20260209-1300 버전이 사용되었습니다.

Status: Downloaded newer image for discourse/base:2.0.20260209-1300
docker.io/discourse/base:2.0.20260209-1300
Ensuring launcher is up to date
Launcher is up-to-date
Stopping old container
+ /usr/bin/docker stop -t 600 web_only
web_only
2.0.20260209-1300: Pulling from discourse/base
Digest: sha256:50d2dae489a9c9916c3d50d880f7f1282fcbe179339b60a8947ab135c1f1f9bf
Status: Image is up to date for discourse/base:2.0.20260209-1300
docker.io/discourse/base:2.0.20260209-1300

빌드 종료

docker: Error response from daemon: failed to set up container networking: driver failed programming external connectivity on endpoint web_only (9e391a36bdc1a80a6b993a466ffdba25337ce70f1fe74f2b5d8aaca75585322b): Bind for 0.0.0.0:80 failed: port is already allocated

failed to set up container networking.txt (74.3 KB)

수정
처음부터 문제가 된 것은 컨테이너 두 개로 전환한 부분이라고 생각합니다.

서버에서 이미 포트 80을 사용하고 있는 프로세스가 있어 이를 중지해야 합니다

하지만 당신은 그것이 작동하고 있었고 여러 번 재구축을 했다고 말씀하셨잖아요.

서버에는 Discourse만 설치되어 있습니다.

그렇습니다, 실제로도 그렇습니다 :grinning_face:

원본 게시물에는 세 가지 리빌드 옵션이 있습니다. 제가 언급한 옵션은 항상 실패(즉, 오류 발생)했습니다.

tcp        0      0 0.0.0.0:80              0.0.0.0:*               LISTEN      1310/docker-proxy
tcp6       0      0 :::80                   :::*                    LISTEN      1316/docker-proxy

서로 다른 컨테이너를 실행 중인 다른 두 인스턴스를 확인 중… @pfaffman이 지적한 메시지

./launcher bootstrap web_only && ./launcher destroy web_only && ./launcher start web_only 명령을 실행해도 동일한 결과가 나옵니다.

Already up to date
╭ Warning ─────────────────────────────────────────────────────────────────────╮
│                                                                              │
│   Ignored build scripts: @swc/core@1.15.7, core-js@2.6.12, core-js@3.47.0,   │
│   esbuild@0.25.12, esbuild@0.27.1, lefthook@2.1.0.                           │
│   Run "pnpm approve-builds" to pick which dependencies should be allowed     │
│   to run scripts.                                                            │
│                                                                              │
╰──────────────────────────────────────────────────────────────────────────────╯
I, [2026-02-17T21:07:23.811289 #1]  INFO -- : > cd /var/www/discourse && su discourse -c 'bundle install --jobs $(($(nproc) - 1)) --retry 3'
Your Ruby version is 3.3.8, but your Gemfile specified ~> 3.4

예. 그건 작동하지 않습니다. 애초에 작동한 적이 없습니다. 누군가가 그렇게 제안할 수 있다는 게 이해가 가지 않습니다. 그리고 누군가가 그렇게 제안했다는 걸 제가 왜 알아채지 못했는지도 모르겠습니다. 그리고 2컨테이너 구성의 핵심은 데이터는 거의 업그레이드하지 않는다는 점입니다.

데이터 업그레이드가 필요하다면, 웹만 종료한 후 데이터를 다시 빌드하고, 그 다음에 web_only를 빌드해야 합니다. OP(원문)를 업데이트했습니다.

포트 충돌 오류가 발생한다면, 도커가 재시작될 때 먼저 구버전의 앱 컨테이너를 재시작하여 포트가 점유되었기 때문일 가능성이 높습니다.

docker ps

명령어를 실행하여 app이 실행 중인지 확인해 보세요. 포트 문제의 원인을 설명할 수 있으므로, 실행 중이기를 바랍니다.

아마도 아래 명령어를 실행해야 할 것입니다.

 docker stop app; docker rm app

Tallyho! @pfaffman 감사합니다

root@discuss:~# docker ps
CONTAINER ID   IMAGE                  COMMAND        CREATED       STATUS       PORTS                                                                          NAMES
f6dbb52ff74c   local_discourse/data   "/sbin/boot"   10 days ago   Up 3 hours                                                                                  data
674e5e3fe5d8   local_discourse/app    "/sbin/boot"   10 days ago   Up 3 hours   0.0.0.0:80->80/tcp, [::]:80->80/tcp, 0.0.0.0:443->443/tcp, [::]:443->443/tcp   app

docker stop app; docker rm app 실행 후
./launcher bootstrap web_only && ./launcher destroy web_only && ./launcher start web_only를 실행하니
이제 정상적으로 작동합니다

app에 대한 “hold” 상태가 왜 생겼는지, 그리고 이전 재빌드들은 왜 정상적으로 작동했는지 매우 궁금합니다. 매우 이상합니다.

그냥 운이 좋았거나, 더 가능성이 높은 것은 도커가 재시작되지 않았기 때문일 것입니다. 그리고 그 이유는 (업그레이드나 머신 재부팅 등) 무엇인지 모르겠습니다.

루비 버전 오류는 저에게도 미스터리입니다.

수수께끼는 재미있거나 …

적어도 이제 AI 구현과 제 정치적 프로젝트 구축으로 돌아갈 수 있습니다