업그레이드 실패: 지원되지 않는 Docker 버전

Ubuntu 16
여러 번 했던 것처럼 웹 업그레이드를 클릭했는데 실패했고, 이제 앱이 재빌드되지 않습니다. 도커 버전이 지원되지 않는다는 오류가 나요.

혹시 아이디어가 있으신가요? OS를 업그레이드하는 등 다른 방법을 시도해볼 수는 있지만, 오늘 그럴 시간이 없거든요.

어떻게 되돌릴 수 있을까요?

버전을 이전 해시로 설정해봤지만, 재빌드를 시도하면 바로 지원되지 않는 도커 버전이라는 오류가 납니다.

업그레이드를 할 수 없습니다.

새 VM으로 이동하고 거기에 데이터베이스를 복원하겠습니다. 이 방법이 더 쉽고, 다운타임도 적으며, 문제가 발생하면 기존에 잘 작동하던 서버를 계속 사용하면 됩니다.

아, 죄송합니다. 충분히 꼼꼼히 읽지 못했습니다.

아니요. 되돌아갈 수 없습니다.

Docker 설치 도구를 사용했다면 Docker를 업그레이드할 수 있을지도 모릅니다.

OS를 업그레이드하고 Postgres 15 업그레이드도 진행했지만, 이제 앱을 재빌드(rebuild)하면 다음과 같은 오류가 발생합니다.

2025-05-18 14:58:28.208 UTC [1455] discourse@discourse ERROR:  column "require_message" does not exist at character 72
2025-05-18 14:58:28.208 UTC [1455] discourse@discourse STATEMENT:  SELECT id, name, name_key, description, notify_type, auto_action_type, require_message, applies_to, position, enabled, score_type FROM "flags" ORDER BY "flags"."position" ASC
** PLUGIN FAILURE **

You are unable to start Discourse due to this error during plugin
initialization:

PG::UndefinedColumn: ERROR:  column "require_message" does not exist
LINE 1: ..._key, description, notify_type, auto_action_type, require_me...
                                                             ^

Postgres 업그레이드 후 rebuild를 실행했을 때의 로그는 다음과 같습니다.

Performing Upgrade
------------------
Analyzing all rows in the new cluster                       ok
Freezing all rows in the new cluster                        ok
Deleting files from new pg_xact                             ok
Copying old pg_xact to new server                           ok
Setting oldest XID for new cluster                          ok
Setting next transaction ID and epoch for new cluster       ok
Deleting files from new pg_multixact/offsets                ok
Copying old pg_multixact/offsets to new server              ok
Deleting files from new pg_multixact/members                ok
Copying old pg_multixact/members to new server              ok
Setting next multixact ID and offset for new cluster        ok
Resetting WAL archives                                      ok
Setting frozenxid and minmxid counters in new cluster       ok
Restoring global objects in the new cluster                 ok
Restoring database schemas in the new cluster               ok
Copying user relation files                                 ok
Setting next OID for new cluster                            ok
Sync data directory to disk                                 ok
Creating script to delete old cluster                       ok
Checking for extension updates                              notice

Your installation contains extensions that should be updated
with the ALTER EXTENSION command.  The file
    update_extensions.sql
when executed by psql by the database superuser will update
these extensions.


Upgrade Complete
----------------
Optimizer statistics are not transferred by pg_upgrade.
Once you start the new server, consider running:
    /usr/lib/postgresql/15/bin/vacuumdb --all --analyze-in-stages

Running this script will delete the old cluster's data files:
    ./delete_old_cluster.sh
-------------------------------------------------------------------------------------
UPGRADE OF POSTGRES COMPLETE

Old 13 database is stored at /shared/postgres_data_old

To complete the upgrade, rebuild again using:

./launcher rebuild app

해결할 수 있는 방법이 있을까요? 어떤 컬럼이 누락된 것인지 확실하지 않습니다.

네. 비슷한 문제에 대한 주제들이 몇 개 있습니다. 되돌려진 마이그레이션 때문에 지금 상태가 애매모호한 상태로 남아있는 것 같습니다.

수동으로 컬럼을 추가해 보세요.

그걸 어떻게 해야 하는지 정확히 모르겠어요. 구체적으로 어떤 테이블 등에 관한 건지요. 관련 정보를 찾을 수 있는 곳이 있을까요? 말씀하신 그 게시물을 찾기는 했는데, 구체적인 내용은 없더라고요.

감사합니다!

컬럼을 추가할 수 있을 정도로 DB를 마운트조차 하지 못하겠습니다. 모든 플러그인을 비활성화하고 컨테이너를 최소한 시작할 수 있는지 시도해 보겠습니다.

자, 이렇게 문제를 해결했습니다 (신경이 약한 분들에게는 적합하지 않습니다)

  1. Docker 20+를 지원하는 버전으로 Ubuntu를 업그레이드합니다.
    우리는 Ubuntu 16을 사용 중이었기 때문에 최소한 Ubuntu 20으로 업그레이드해야 했으며, 이를 위해 두 번의 업그레이드를 수행했습니다.
RELEASE_UPGRADER_ALLOW_THIRD_PARTY=1 do-release-upgrade
  1. Ubuntu 20으로 업그레이드한 후에는 Docker를 업데이트해야 했는데, Ubuntu는 이를 자동으로 수행하기를 거부했습니다.
sudo apt-get update
sudo apt-get install ca-certificates curl
sudo install -m 0755 -d /etc/apt/keyrings
sudo curl -fsSL https://download.docker.com/linux/ubuntu/gpg -o /etc/apt/keyrings/docker.asc
sudo chmod a+r /etc/apt/keyrings/docker.asc

# Add the repository to Apt sources:
echo \
  "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.asc] https://download.docker.com/linux/ubuntu \
  $(. /etc/os-release && echo "${UBUNTU_CODENAME:-$VERSION_CODENAME}") stable" | \
  sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
sudo apt-get update
  1. 이를 통해 docker 28로 업그레이드되었습니다.
  2. 다음을 실행합니다.
./launcher rebuild app
  1. 이 과정에서 postgress가 13에서 15로 업그레이드됩니다. 관련 링크:
    PostgreSQL 15 update
  2. DB 업그레이드가 성공적으로 완료된 후 다음을 실행합니다.
./launcher rebuild app
  1. 이로 인해 컬럼 누락 오류가 발생했습니다.
2025-05-18 14:58:28.208 UTC [1455] discourse@discourse ERROR:  column "require_message" does not exist at character 72
2025-05-18 14:58:28.208 UTC [1455] discourse@discourse STATEMENT:  SELECT id, name, name_key, description, notify_type, auto_action_type, require_message, applies_to, position, enabled, score_type FROM "flags" ORDER BY "flags"."position" ASC
** PLUGIN FAILURE **

You are unable to start Discourse due to this error during plugin
initialization:

PG::UndefinedColumn: ERROR:  column "require_message" does not exist
LINE 1: ..._key, description, notify_type, auto_action_type, require_me...
                                                             ^
  1. 이 시점에서는 컨테이너를 시작할 방법이 없었기 때문에, app.yml로 가서 모든 플러그인을 비활성화한 후 다시 rebuild를 실행했습니다.
  2. 마침내 앱이 재빌드되었고, rails 콘솔에 접속하여 위에서 언급한 컬럼을 수동으로 추가할 수 있었습니다.
./launcher enter app
rails db
ActiveRecord::Base.connection.execute("ALTER TABLE flags ADD COLUMN require_message BOOLEAN DEFAULT FALSE;")
exit
exit 
  1. 컬럼이 존재하는 것을 확인한 후 app.yml로 돌아가 모든 플러그인을 활성화하고 다시 rebuild를 수행했습니다.
  2. Rebuild가 성공했습니다… 그리고 서버가 정상적으로 작동하고 있습니다!

주말에도 신속하게 답변해 주신 @pfaffman님께 감사드립니다. 우리는 새로운 업데이트된 드롭렛을 만들고 데이터를 이전할 예정입니다. 이것은 웹 인터페이스를 통한 빠른 인플레이스 업그레이드로 예정되어 있었습니다. 하지만 스크립트가 docker 호환성을 테스트하지 않는 것 같습니다. discourse docker를 업그레이드했을 때 호환되지 않는 docker 오류가 발생했습니다.

이것은 완전히 우리의 책임입니다. Ubuntu 16이라는 매우 오래된 버전을 유지했기 때문이죠. 안정된 시스템의 장단점 중 하나는 시스템이 오래 유지되는 경향이 있다는 것입니다.

동작하게 되셨다니 다행입니다! 정말 인상 깊네요!

OS가 EOL(지원 종료) 이후 4년이나 지났는데, 어떻게 빠른 업데이트를 할 수 있겠어요. :wink:

네, 좋은 경험이었습니다! 다시 한번 감사합니다!