Сбой обновления (postgresql)

Обновление до последней версии (включая PostgreSQL) привело к ошибке:

root@community:/var/discourse# ./launcher rebuild app

Ensuring launcher is up to date

Fetching origin

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, [2020-06-03T15:38:58.391364 #1] INFO -- : Loading --stdin

I, [2020-06-03T15:38:58.398128 #1] INFO -- : 

I, [2020-06-03T15:38:58.731357 #1] INFO -- : 

I, [2020-06-03T15:38:58.731849 #1] INFO -- : 

I, [2020-06-03T15:38:58.751775 #1] INFO -- : 

I, [2020-06-03T15:38:58.756078 #1] INFO -- : 

I, [2020-06-03T15:38:58.765806 #1] INFO -- : 

I, [2020-06-03T15:38:58.766148 #1] INFO -- : 

I, [2020-06-03T15:38:58.767966 #1] INFO -- : 

I, [2020-06-03T15:38:58.768305 #1] INFO -- : 

I, [2020-06-03T15:38:58.770246 #1] INFO -- : 

I, [2020-06-03T15:38:58.770626 #1] INFO -- : 

I, [2020-06-03T15:38:58.785523 #1] INFO -- : 

I, [2020-06-03T15:38:58.785863 #1] INFO -- : 

2020/06/03 15:38:58 socat[26] E connect(6, AF=1 "/shared/postgres_run/.s.PGSQL.5432", 36): No such file or directory

I, [2020-06-03T15:38:58.911895 #1] INFO -- : 

I, [2020-06-03T15:38:58.912203 #1] INFO -- : 

I, [2020-06-03T15:38:58.914376 #1] INFO -- : 

I, [2020-06-03T15:38:58.914625 #1] INFO -- : 

I, [2020-06-03T15:38:58.916280 #1] INFO -- : 

I, [2020-06-03T15:38:58.916527 #1] INFO -- : 

I, [2020-06-03T15:38:58.917967 #1] INFO -- : 

I, [2020-06-03T15:38:58.918303 #1] INFO -- : 

I, [2020-06-03T15:38:58.919709 #1] INFO -- : 

I, [2020-06-03T15:38:58.925728 #1] INFO -- : File 

I, [2020-06-03T15:38:58.928444 #1] INFO -- : File 

I, [2020-06-03T15:38:58.931357 #1] INFO -- : File 

I, [2020-06-03T15:38:58.934190 #1] INFO -- : File 

I, [2020-06-03T15:38:58.934528 #1] INFO -- : 

I, [2020-06-03T15:40:44.749613 #1] INFO -- : 

I, [2020-06-03T15:40:44.750250 #1] INFO -- : 

I, [2020-06-03T15:40:44.751653 #1] INFO -- : 

I, [2020-06-03T15:40:44.751914 #1] INFO -- : 

I, [2020-06-03T15:40:47.940064 #1] INFO -- : 

I, [2020-06-03T15:40:47.940713 #1] INFO -- : 

I, [2020-06-03T15:40:47.942521 #1] INFO -- : 

I, [2020-06-03T15:40:47.942924 #1] INFO -- : 

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, [2020-06-03T15:42:45.495966 #1] INFO -- : Upgrading PostgreSQL from version 10 to 12

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/12/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]

Hit:2 http://deb.debian.org/debian buster InRelease

Get:3 http://deb.debian.org/debian buster-updates InRelease [49.3 kB]

Get:4 https://deb.nodesource.com/node_10.x buster InRelease [4,584 B]

Get:5 http://apt.postgresql.org/pub/repos/apt buster-pgdg InRelease [84.6 kB]

Get:6 http://security.debian.org/debian-security buster/updates/main amd64 Packages [201 kB]

Get:7 https://deb.nodesource.com/node_10.x buster/main amd64 Packages [768 B]

Get:8 http://apt.postgresql.org/pub/repos/apt buster-pgdg/main amd64 Packages [171 kB]

Fetched 577 kB in 1s (698 kB/s)

Reading package lists...

Reading package lists...

Building dependency tree...

Reading state information...

The following additional packages will be installed:

postgresql-client-10

Suggested packages:

postgresql-doc-10

The following NEW packages will be installed:

postgresql-10 postgresql-client-10

0 upgraded, 2 newly installed, 0 to remove and 10 not upgraded.

Need to get 6,390 kB of archives.

After this operation, 30.6 MB of additional disk space will be used.

Get:1 http://apt.postgresql.org/pub/repos/apt buster-pgdg/main amd64 postgresql-client-10 amd64 10.13-1.pgdg100+1 [1,428 kB]

Get:2 http://apt.postgresql.org/pub/repos/apt buster-pgdg/main amd64 postgresql-10 amd64 10.13-1.pgdg100+1 [4,961 kB]

Fetched 6,390 kB in 0s (38.2 MB/s)

Selecting previously unselected package postgresql-client-10.

(Reading database ... 43929 files and directories currently installed.)

Preparing to unpack .../postgresql-client-10_10.13-1.pgdg100+1_amd64.deb ...

Unpacking postgresql-client-10 (10.13-1.pgdg100+1) ...

Selecting previously unselected package postgresql-10.

Preparing to unpack .../postgresql-10_10.13-1.pgdg100+1_amd64.deb ...

Unpacking postgresql-10 (10.13-1.pgdg100+1) ...

Setting up postgresql-client-10 (10.13-1.pgdg100+1) ...

update-alternatives: warning: forcing reinstallation of alternative /usr/share/postgresql/12/man/man1/psql.1.gz because link group psql.1.gz is broken

Setting up postgresql-10 (10.13-1.pgdg100+1) ...

Creating new PostgreSQL cluster 10/main ...

/usr/lib/postgresql/10/bin/initdb -D /var/lib/postgresql/10/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/10/main ... ok

creating subdirectories ... ok

selecting default max_connections ... 100

selecting default shared_buffers ... 128MB

selecting default timezone ... Etc/UTC

selecting dynamic shared memory implementation ... posix

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 10 main start

Warning: The selected stats_temp_directory /var/run/postgresql/10-main.pg_stat_tmp

is not writable for the cluster owner. Not adding this setting in

postgresql.conf.

Ver Cluster Port Status Owner Data directory Log file

10 main 5433 down postgres /var/lib/postgresql/10/main /var/log/postgresql/postgresql-10-main.log

update-alternatives: warning: forcing reinstallation of alternative /usr/share/postgresql/12/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 (213.pgdg100+1) ...

Building PostgreSQL dictionaries from installed myspell/hunspell packages...

Removing obsolete dictionary files:

Stopping PostgreSQL 10 database server: main.

Stopping PostgreSQL 12 database server: main.

Performing Consistency Checks

-----------------------------

Checking cluster versions ok

The source cluster was not shut down cleanly.

Failure, exiting

-------------------------------------------------------------------------------------

UPGRADE OF POSTGRES FAILED

Please visit https://meta.discourse.org/t/postgresql-12-update/151236 for support

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

FAILED

--------------------

Pups::ExecError: /root/upgrade_postgres failed with return #

Location of failure: /pups/lib/pups/exec_command.rb:112:in `spawn'

exec failed with the params "/root/upgrade_postgres"

674042fc06e2af0c08a0a09c46406a0b18b1f08b9140e037fffe1053188bd1c0

** 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.

root@community:/var/discourse#

Есть ли какая-то идея, почему это произошло?

Вы просмотрели этот пост?

Да, я делал это раньше. Нам не удалось запустить обновление.

Прочитайте весь раздел часто задаваемых вопросов здесь:

Уже пробовали обходное решение, но оно не сработало.

В логе много записей:

2020-06-03 16:01:21.074 UTC [693] FATAL: каталог данных “/shared/postgres_data” имеет неверного владельца
2020-06-03 16:01:21.074 UTC [693] HINT: Сервер должен запускаться пользователем, который владеет каталогом данных.

После входа в контейнер я попытался самостоятельно остановить его:

root@community-app:/etc/postgresql/10/main# service postgresql stop

[FAIL] Остановка сервера базы данных PostgreSQL 10: main[…] Ошибка: Владелец конфигурации (postgres:106) и владелец данных (Debian-exim:105) не совпадают, а владелец конфигурации не является root … не удалось!

не удалось!

Выполнение команды chown -R postgres postgres_data в директории /shared после входа в контейнер Docker решило проблему.