2.7.0.beta1에서 2.7.0.beta3로 업그레이드 실패

원클릭 브라우저 업그레이드를 사용하여 2.7.0.beta1에서 2.7.0.beta3로 업그레이드를 시도했습니다.

처음에는 docker가 업데이트되었는데, 겉보기에는 성공적으로 이루어진 것 같습니다. 그런 다음 안내에 따라 서버에서 다음 명령을 실행했습니다:

    cd /var/discourse
    git pull
    ./launcher rebuild app

완료된 후 다시 재구축(rebuild)이 필요하다고 표시되었습니다. 그래서 다시 실행했는데, 꽤 멀리 진행되었을 때 다음 내용이 표시되었습니다:

I, [2021-02-01T04:03:23.848858 #1]  INFO -- : > 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
I, [2021-02-01T04:03:23.850125 #1]  INFO -- : > sleep 5
I, [2021-02-01T04:03:28.854186 #1]  INFO -- :
I, [2021-02-01T04:03:28.854378 #1]  INFO -- : > su postgres -c 'createdb discourse' || true
createdb: error: could not connect to database template1: could not connect to server: No such file or directory
        Is the server running locally and accepting
        connections on Unix domain socket "/var/run/postgresql/.s.PGSQL.5432"?
I, [2021-02-01T04:03:28.940422 #1]  INFO -- :
I, [2021-02-01T04:03:28.940926 #1]  INFO -- : > su postgres -c 'psql discourse -c "create user discourse;"' || true
psql: error: could not connect to server: No such file or directory
        Is the server running locally and accepting
        connections on Unix domain socket "/var/run/postgresql/.s.PGSQL.5432"?
I, [2021-02-01T04:03:29.005802 #1]  INFO -- :
I, [2021-02-01T04:03:29.006192 #1]  INFO -- : > su postgres -c 'psql discourse -c "grant all privileges on database discourse to discourse;"' || true
psql: error: could not connect to server: No such file or directory
        Is the server running locally and accepting
        connections on Unix domain socket "/var/run/postgresql/.s.PGSQL.5432"?
I, [2021-02-01T04:03:29.055155 #1]  INFO -- :
I, [2021-02-01T04:03:29.055530 #1]  INFO -- : > su postgres -c 'psql discourse -c "alter schema public owner to discourse;"'
psql: error: could not connect to server: No such file or directory
        Is the server running locally and accepting
        connections on Unix domain socket "/var/run/postgresql/.s.PGSQL.5432"?
I, [2021-02-01T04:03:29.102737 #1]  INFO -- :
I, [2021-02-01T04:03:29.103136 #1]  INFO -- : Terminating async processes
I, [2021-02-01T04:03:29.103280 #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: 52


FAILED
--------------------
Pups::ExecError: su postgres -c 'psql discourse -c "alter schema public owner to discourse;"' failed with return #<Process::Status: pid 78 exit 2>
Location of failure: /pups/lib/pups/exec_command.rb:112:in `spawn'
exec failed with the params "su postgres -c 'psql $db_name -c \"alter schema public owner to $db_user;\"'"
74718f22e5eb9e1ceb21ac2a2fe613d13aee282a353cf60b91258ba2b2323397
** 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.

릴리스 노트에서 postgres와 디스크 공간에 대해 경고했는데, 아마도 그 이유로 실패한 것일까요? discourse-doctor를 실행하면 출력에 다음 내용이 포함되어 있습니다:

---------- OS Disk Space ----------
Filesystem                 Size  Used Avail Use% Mounted on
/dev/disk/by-label/DOROOT   30G   20G  8.5G  70% /

이제 무엇을 해야 할까요?

재구축 출력을 더 붙여넣을 수 있나요? 문제를 해결하려면 해당 줄보다 앞선 몇 줄이 필요합니다.

문제의 원인은 다음과 같을 수 있습니다:

    I, [2021-02-01T22:13:56.638190 #1]  INFO -- : > cd /var/www/discourse && su discourse -c 'bundle exec rake db:migrate'
2021-02-01 22:14:05.011 UTC [4123] discourse@discourse ERROR:  duplicate key value violates unique constraint "index_users_on_username"
2021-02-01 22:14:05.011 UTC [4123] discourse@discourse DETAIL:  Key (username)=(Pxxx_Gxxxxxxxx) already exists.
2021-02-01 22:14:05.011 UTC [4123] discourse@discourse STATEMENT:  UPDATE users
        SET locale = 'en'
        WHERE locale = 'en_US'

rake aborted!
StandardError: An error has occurred, this and all later migrations canceled:

PG::UniqueViolation: ERROR:  duplicate key value violates unique constraint "index_users_on_username"
DETAIL:  Key (username)=(Pxxx_Gxxxxxxxx) already exists.

만약 그렇다면 이 문제를 어떻게 수정하는 것이 좋을까요? 전체 출력은 첨부되어 있습니다.

failed_discourse_upgrade_2021_01_31.txt (90.4 KB)

최근 중복 문제를 해결하는 방법에 대한 몇 가지 주제가 있었습니다. 예시:

감사합니다. psql을 실행하는 데 문제가 있습니다.

컨테이너를 재시작했습니다:

./launcher start app

그 다음 다음을 실행했습니다:

./launcher enter app

그리고:

su postgres -c 'psql discourse'

하지만 출력은 다음과 같았습니다:

psql: error: could not connect to server: could not connect to server: No such file or directory
Is the server running locally and accepting
connections on Unix domain socket “/var/run/postgresql/.s.PGSQL.5432”?

sudo -u postgres psql discourse를 시도해 보세요

sudo -u postgres psql discourse를 시도해 보세요

불행히도 동일한 오류 메시지가 나타납니다.

런처 재구축의 첫 번째 반복이 정상적으로 실행되었나요?

그렇다면 데이터베이스는 이미 Psql 13으로 업그레이드되었을 것입니다. 하지만 구형 앱 이미지 내의 Psql 바이너리는 업그레이드 원본에 따라 데이터베이스 버전 10 또는 12를 여전히 기대하고 있을 수 있습니다.

cd /var/discourse/shared/standalone
ls -alh 

postgres_data와 postgres_data_old 두 디렉터리가 모두 있나요?

앱이 중지되어 있는지 확인한 후, postgres_data 디렉터리를 이동하거나 이름 변경하세요(아직 삭제하지 마세요. 안전을 위해). 그런 다음

mv postgres_data_old postgres_data

를 실행하고 launcher start app을 다시 시도해 보세요.

도움이 되길 바랍니다!

Gunnar

해당 단계를 따라 중복된 사용자를 성공적으로 이름 변경했습니다. 하지만 다시 인덱싱을 시도할 때 이 문제에 직면했습니다.

@sam은 해당 스레드에서 "네, 중복된 행을 삭제해 주세요(nuke the dupe rows)"라고 제안했지만, 다시 인덱싱할 때 발생하는 경고와 오류 메시지 맥락에서 이것이 무엇을 의미하는지 모르겠습니다. 현재 오류는 다음과 같이 계속 증가하고 있습니다:

REINDEX SCHEMA CONCURRENTLY public;
WARNING:  cannot reindex invalid index "public.index_incoming_referers_on_path_and_incoming_domain_id_ccnew" concurrently, skipping
WARNING:  cannot reindex invalid index "public.incoming_referers_pkey_ccnew1" concurrently, skipping
WARNING:  cannot reindex invalid index "public.index_incoming_referers_on_path_and_incoming_domain_id_ccnew1" concurrently, skipping
WARNING:  cannot reindex invalid index "public.index_incoming_referers_on_path_and_incoming_domain_id_cc_ccnew" concurrently, skipping
WARNING:  cannot reindex invalid index "public.index_incoming_referers_on_path_and_incoming_domain_id_c_ccnew1" concurrently, skipping
WARNING:  cannot reindex invalid index "public.incoming_referers_pkey_ccnew2" concurrently, skipping
WARNING:  cannot reindex invalid index "public.index_incoming_referers_on_path_and_incoming_domain_id_ccnew2" concurrently, skipping
WARNING:  cannot reindex invalid index "public.incoming_referers_pkey_ccnew_ccnew" concurrently, skipping
WARNING:  cannot reindex invalid index "pg_toast.pg_toast_19250_index_ccnew1" concurrently, skipping
WARNING:  cannot reindex invalid index "pg_toast.pg_toast_19250_index_ccnew2" concurrently, skipping
WARNING:  cannot reindex invalid index "pg_toast.pg_toast_19250_index_ccnew_ccnew" concurrently, skipping
ERROR:  could not create unique index "index_incoming_referers_on_path_and_incoming_domain_id_ccnew3"
DETAIL:  Key (path, incoming_domain_id)=(/votes/, 1165) is duplicated.

이것들은 재인덱싱이 실행되는 동안 생성된 임시 인덱스입니다. 중복 항목으로 인해 크래시가 발생할 때마다 최소 하나의 임시 인덱스가 남게 됩니다. 이름이 ccnew, ccnew1, ccnew2 등으로 끝나므로 이를 구별할 수 있습니다.

Psql을 입력하고 DROP INDEX 명령을 실행하여 이를 제거할 수 있습니다.

sudo ./launcher enter app
su postgres -c 'psql discourse'

DROP index ‘<index name>_ccnew’;
DROP index ‘<index name>_ccnew1’;

이와 같은 방식으로 진행합니다. 반드시 먼저 데이터베이스 백업을 확보하고, 재인덱싱이 현재 실행 중이 아닌지 확인하며, _ccnew 인덱스만 삭제하는지 확인하십시오.

추가 정보는 이 게시물에서 확인할 수 있습니다:

다시 한번 감사드립니다, Gunnar. 일부 ccnew 인덱스는 삭제할 수 있었지만 모두는 아니었습니다:

discourse=# DROP INDEX public.index_incoming_referers_on_path_and_incoming_domain_id_ccnew;
DROP INDEX
discourse=# DROP INDEX public.incoming_referers_pkey_ccnew1;
DROP INDEX
discourse=# DROP INDEX public.index_incoming_referers_on_path_and_incoming_domain_id_ccnew1;
DROP INDEX
discourse=# DROP INDEX public.index_incoming_referers_on_path_and_incoming_domain_id_cc_ccnew;
ERROR:  index "index_incoming_referers_on_path_and_incoming_domain_id_cc_ccnew" does not exist
discourse=# DROP INDEX public.index_incoming_referers_on_path_and_incoming_domain_id_c_ccnew1;
ERROR:  index "index_incoming_referers_on_path_and_incoming_domain_id_c_ccnew1" does not exist
discourse=# DROP INDEX public.incoming_referers_pkey_ccnew2;
DROP INDEX
discourse=# DROP INDEX public.incoming_referers_pkey_ccnew_ccnew;
ERROR:  index "incoming_referers_pkey_ccnew_ccnew" does not exist
discourse=# DROP INDEX pg_toast.pg_toast_19250_index_ccnew1;
ERROR:  permission denied: "pg_toast_19250_index_ccnew1" is a system catalog
discourse=# DROP INDEX pg_toast.pg_toast_19250_index_ccnew2;
ERROR:  permission denied: "pg_toast_19250_index_ccnew2" is a system catalog
discourse=# DROP INDEX pg_toast.pg_toast_19250_index_ccnew_ccnew;
ERROR:  permission denied: "pg_toast_19250_index_ccnew_ccnew" is a system catalog

어쨌든, 이후에 성공적으로 재인덱싱(reindex)한 것 같습니다:

discourse=# REINDEX SCHEMA CONCURRENTLY public;
REINDEX

그 후 업그레이드를 완료하려고 했지만 실패했습니다:

root@forum:/var/discourse# ./launcher rebuild app
Ensuring launcher is up to date
Fetching origin
remote: Enumerating objects: 3, done.
remote: Counting objects: 100% (3/3), done.
remote: Total 3 (delta 2), reused 3 (delta 2), pack-reused 0
Unpacking objects: 100% (3/3), done.
From https://github.com/discourse/discourse_docker
 * [new branch]      fix-prune-time -> origin/fix-prune-time
Launcher is up-to-date
Stopping old container
+ /usr/bin/docker stop -t 60 app
app
cd /pups && git pull && /pups/bin/pups --stdin
Already up to date.
I, [2021-02-15T00:34:30.967636 #1]  INFO -- : Loading --stdin
I, [2021-02-15T00:34:30.973572 #1]  INFO -- : > locale-gen $LANG && update-locale
I, [2021-02-15T00:34:31.024271 #1]  INFO -- : Generating locales (this might take a while)...
Generation complete.

I, [2021-02-15T00:34:31.024803 #1]  INFO -- : > mkdir -p /shared/postgres_run
I, [2021-02-15T00:34:31.029795 #1]  INFO -- :
I, [2021-02-15T00:34:31.030826 #1]  INFO -- : > chown postgres:postgres /shared/postgres_run
I, [2021-02-15T00:34:31.033498 #1]  INFO -- :
I, [2021-02-15T00:34:31.033875 #1]  INFO -- : > chmod 775 /shared/postgres_run
I, [2021-02-15T00:34:31.036104 #1]  INFO -- :
I, [2021-02-15T00:34:31.036435 #1]  INFO -- : > rm -fr /var/run/postgresql
I, [2021-02-15T00:34:31.038583 #1]  INFO -- :
I, [2021-02-15T00:34:31.038915 #1]  INFO -- : > ln -s /shared/postgres_run /var/run/postgresql
I, [2021-02-15T00:34:31.041198 #1]  INFO -- :
I, [2021-02-15T00:34:31.041511 #1]  INFO -- : > socat /dev/null UNIX-CONNECT:/shared/postgres_run/.s.PGSQL.5432 || exit 0 && echo postgres already running stop container ; exit 1
2021/02/15 00:34:31 socat[27] E connect(6, AF=1 "/shared/postgres_run/.s.PGSQL.5432", 36): No such file or directory
I, [2021-02-15T00:34:31.055279 #1]  INFO -- :
I, [2021-02-15T00:34:31.055620 #1]  INFO -- : > rm -fr /shared/postgres_run/.s*
I, [2021-02-15T00:34:31.058156 #1]  INFO -- :
I, [2021-02-15T00:34:31.058442 #1]  INFO -- : > rm -fr /shared/postgres_run/*.pid
I, [2021-02-15T00:34:31.060461 #1]  INFO -- :
I, [2021-02-15T00:34:31.060758 #1]  INFO -- : > mkdir -p /shared/postgres_run/13-main.pg_stat_tmp
I, [2021-02-15T00:34:31.062949 #1]  INFO -- :
I, [2021-02-15T00:34:31.063384 #1]  INFO -- : > chown postgres:postgres /shared/postgres_run/13-main.pg_stat_tmp
I, [2021-02-15T00:34:31.065117 #1]  INFO -- :
I, [2021-02-15T00:34:31.069700 #1]  INFO -- : File > /etc/service/postgres/run  chmod: +x  chown:
I, [2021-02-15T00:34:31.073080 #1]  INFO -- : File > /etc/service/postgres/log/run  chmod: +x  chown:
I, [2021-02-15T00:34:31.076629 #1]  INFO -- : File > /etc/runit/3.d/99-postgres  chmod: +x  chown:
I, [2021-02-15T00:34:31.079978 #1]  INFO -- : File > /root/upgrade_postgres  chmod: +x  chown:
I, [2021-02-15T00:34:31.080365 #1]  INFO -- : > chown -R root /var/lib/postgresql/13/main
I, [2021-02-15T00:34:31.456272 #1]  INFO -- :
I, [2021-02-15T00:34:31.456523 #1]  INFO -- : > [ ! -e /shared/postgres_data ] && install -d -m 0755 -o postgres -g postgres /shared/postgres_data && sudo -E -u postgres /usr/lib/postgresql/13/bin/initdb -D /shared/postgres_data || exit 0
I, [2021-02-15T00:34:31.458416 #1]  INFO -- :
I, [2021-02-15T00:34:31.458635 #1]  INFO -- : > chown -R postgres:postgres /shared/postgres_data
I, [2021-02-15T00:34:31.489118 #1]  INFO -- :
I, [2021-02-15T00:34:31.489681 #1]  INFO -- : > chown -R postgres:postgres /var/run/postgresql
I, [2021-02-15T00:34:31.491900 #1]  INFO -- :
I, [2021-02-15T00:34:31.492294 #1]  INFO -- : > /root/upgrade_postgres
initdb: warning: enabling "trust" authentication for local connections
You can change this by editing pg_hba.conf or using the option -A, or
--auth-local and --auth-host, the next time you run initdb.
debconf: delaying package configuration, since apt-utils is not installed
I, [2021-02-15T00:34:44.948743 #1]  INFO -- : Upgrading PostgreSQL from version 12 to 13
The files belonging to this database system will be owned by user "postgres".
This user must also own the server process.

The database cluster will be initialized with locale "en_US.UTF-8".
The default database encoding has accordingly been set to "UTF8".
The default text search configuration will be set to "english".

Data page checksums are disabled.

fixing permissions on existing directory /shared/postgres_data_new ... ok
creating subdirectories ... ok
selecting dynamic shared memory implementation ... posix
selecting default max_connections ... 100
selecting default shared_buffers ... 128MB
selecting default time zone ... Etc/UTC
creating configuration files ... ok
running bootstrap script ... ok
performing post-bootstrap initialization ... ok
syncing data to disk ... ok


Success. You can now start the database server using:

    /usr/lib/postgresql/13/bin/pg_ctl -D /shared/postgres_data_new -l logfile start

Get:1 http://security.debian.org/debian-security buster/updates InRelease [65.4 kB]
Get:2 http://deb.debian.org/debian buster InRelease [122 kB]
Get:3 http://deb.debian.org/debian buster-updates InRelease [51.9 kB]
Get:4 http://apt.postgresql.org/pub/repos/apt buster-pgdg InRelease [104 kB]
Get:5 http://security.debian.org/debian-security buster/updates/main amd64 Packages [267 kB]
Get:6 http://deb.debian.org/debian buster/main amd64 Packages [7,907 kB]
Get:7 http://deb.debian.org/debian buster-updates/main amd64 Packages.diff/Index [5,656 B]
Get:8 http://deb.debian.org/debian buster-updates/main amd64 Packages 2020-12-24-1401.30.pdiff [286 B]
Get:9 http://deb.debian.org/debian buster-updates/main amd64 Packages 2021-01-29-2000.47.pdiff [408 B]
Get:10 http://deb.debian.org/debian buster-updates/main amd64 Packages 2021-02-07-1359.56.pdiff [2,302 B]
Get:10 http://deb.debian.org/debian buster-updates/main amd64 Packages 2021-02-07-1359.56.pdiff [2,302 B]
Get:11 https://deb.nodesource.com/node_10.x buster InRelease [4,584 B]
Get:12 http://apt.postgresql.org/pub/repos/apt buster-pgdg/main amd64 Packages [216 kB]
Get:13 https://deb.nodesource.com/node_10.x buster/main amd64 Packages [768 B]
Fetched 8,746 kB in 2s (4,421 kB/s)
Reading package lists...
Reading package lists...
Building dependency tree...
Reading state information...
The following additional packages will be installed:
  postgresql-client-12
Suggested packages:
  postgresql-doc-12
The following NEW packages will be installed:
  postgresql-12 postgresql-client-12
0 upgraded, 2 newly installed, 0 to remove and 28 not upgraded.
Need to get 16.1 MB of archives.
After this operation, 54.1 MB of additional disk space will be used.
Get:1 http://apt.postgresql.org/pub/repos/apt buster-pgdg/main amd64 postgresql-client-12 amd64 12.6-1.pgdg100+1 [1,424 kB]
Get:2 http://apt.postgresql.org/pub/repos/apt buster-pgdg/main amd64 postgresql-12 amd64 12.6-1.pgdg100+1 [14.7 MB]
Fetched 16.1 MB in 1s (12.8 MB/s)
Selecting previously unselected package postgresql-client-12.
(Reading database ... 43899 files and directories currently installed.)
Preparing to unpack .../postgresql-client-12_12.6-1.pgdg100+1_amd64.deb ...
Unpacking postgresql-client-12 (12.6-1.pgdg100+1) ...
Selecting previously unselected package postgresql-12.
Preparing to unpack .../postgresql-12_12.6-1.pgdg100+1_amd64.deb ...
Unpacking postgresql-12 (12.6-1.pgdg100+1) ...
Setting up postgresql-client-12 (12.6-1.pgdg100+1) ...
update-alternatives: warning: forcing reinstallation of alternative /usr/share/postgresql/13/man/man1/psql.1.gz because link group psql.1.gz is broken
Setting up postgresql-12 (12.6-1.pgdg100+1) ...
Creating new PostgreSQL cluster 12/main ...
/usr/lib/postgresql/12/bin/initdb -D /var/lib/postgresql/12/main --auth-local peer --auth-host md5
The files belonging to this database system will be owned by user "postgres".
This user must also own the server process.

The database cluster will be initialized with locale "C.UTF-8".
The default database encoding has accordingly been set to "UTF8".
The default text search configuration will be set to "english".

Data page checksums are disabled.

fixing permissions on existing directory /var/lib/postgresql/12/main ... ok
creating subdirectories ... ok
selecting dynamic shared memory implementation ... posix
selecting default max_connections ... 100
selecting default shared_buffers ... 128MB
selecting default time zone ... Etc/UTC
creating configuration files ... ok
running bootstrap script ... ok
performing post-bootstrap initialization ... ok
syncing data to disk ... ok

Success. You can now start the database server using:

    pg_ctlcluster 12 main start

Ver Cluster Port Status Owner    Data directory              Log file
12  main    5433 down   postgres /var/lib/postgresql/12/main /var/log/postgresql/postgresql-12-main.log
update-alternatives: warning: forcing reinstallation of alternative /usr/share/postgresql/13/man/man1/postmaster.1.gz because link group postmaster.1.gz is broken
invoke-rc.d: could not determine current runlevel
invoke-rc.d: policy-rc.d denied execution of start.
Processing triggers for postgresql-common (223.pgdg100+1) ...
Building PostgreSQL dictionaries from installed myspell/hunspell packages...
Removing obsolete dictionary files:
Stopping PostgreSQL 12 database server: main.
Stopping PostgreSQL 13 database server: main.
Performing Consistency Checks
-----------------------------
Checking cluster versions                                   ok
Checking database user is the install user                  ok
Checking database connection settings                       ok
Checking for prepared transactions                          ok
Checking for reg* data types in user tables                 ok
Checking for contrib/isn with bigint-passing mismatch       ok
Creating dump of global objects                             ok
Creating dump of database schemas
  discourse

*failure*

Consult the last few lines of "pg_upgrade_dump_16566.log" for
the probable cause of the failure.
Failure, exiting
-------------------------------------------------------------------------------------
UPGRADE OF POSTGRES FAILED

Please visit https://meta.discourse.org/t/postgresql-13-update/172563 for support.

You can run ./launcher start app to restart your app in the meanwhile




FAILED
--------------------
Pups::ExecError: /root/upgrade_postgres failed with return #<Process::Status: pid 46 exit 1>
Location of failure: /pups/lib/pups/exec_command.rb:112:in `spawn'
exec failed with the params "/root/upgrade_postgres"
1b91e47c88940d6c697c346fa8db3d4ab39bbc83f1340dc6f734ca0f9abe6eeb
** 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.

Postgres와 관련이 있는 것 같다는 점을 제외하고는 리빌드가 실패한 이유를 모르겠습니다. 로그 파일 "pg_upgrade_dump_16566.log"이 어디에 있어야 하는지도 모르겠습니다.

아이디어가 있을까요?

업그레이드가 제대로 작동하지 않은 것 같습니다. 어제 비슷한 작업을 한 적이 있어요.

제가 한 작업은 대략적으로 백업 데이터를 postgres_data로 되돌리고, pg10(혹은 12?) 템플릿으로 전환한 뒤, 다시 빌드하고, 템플릿을 원래대로 바꾼 후 업그레이드를 위해 두 번 더 빌드하는 것이었습니다.

대략적인 설명이지만, 제 폰에서 할 수 있는 최대한의 답변입니다. PostgreSQL 13 업데이트에 필요한 모든 정보가 포함되어 있을 것입니다.

제가 한 일은 백업 데이터를 postgres_data로 되돌린 다음, pg10(혹은 12?) 템플릿으로 전환하고, 다시 빌드한 뒤, 업그레이드를 위해 템플릿을 원래대로 되돌리고 두 번 더 빌드하는 것이었습니다.

그럼 제가 이해한 대로 말씀드리겠습니다. 제가 해야 할 일은 다음과 같습니다.

  1. postgres_data를 다른 이름으로 변경한 뒤, 만든 백업 파일을 postgres_data로 이름 변경합니다.
  2. postgres.template.yml을 다른 이름으로 변경한 뒤, postgres.12.template.yml을 postgres.template.yml로 이름 변경합니다.
  3. ./launcher rebuild app 명령을 실행합니다.
  4. postgres_data와 postgres.template.yml을 모두 원래대로 복원합니다.
  5. ./launcher rebuild app 명령을 실행합니다.
  6. ./launcher rebuild app 명령을 실행합니다.

이렇게 이해한 것이 맞습니까?

로저 씨, 안녕하세요. 말씀하신 것과 매우 유사한 것이 되어야 하지만, 정확한 상황을 모르기 때문에 확답을 드릴 수 없습니다.

아, 잠깐.

아니요. app.yml 파일에서는 일반 postgres 템플릿 대신 postgres 12 템플릿을 참조해야 합니다. 파일을 이름 변경하는 것이 아니라 app.yml 파일을 편집하는 것입니다. 업그레이드 가이드(How-to)에서 꽤 잘 설명되어 있다고 생각합니다.

방금 수정한 사이트의 경우 postgres_data 디렉터리가 비어 있었고, 이후(아마도) 제 스크립트가 docker prune을 실행하여 컨테이너를 삭제했습니다. 단순히 재시작만 했더라면 작동했을 것 같은데 말입니다.

단순히 문제를 해결하고 예산이 있으시다면 Redirecting… 를 참고해 주세요.