Forum offline due to failed rebuilds on Tests-Pass

Continuing the discussion from PostgreSQL 13 update:

Run into trouble while updating 2.7.0beta1 Tests-Pass in order to remove some troublesome plugins.

I edited our app.yml to remain on PostgreSQL 12. Rebuild failed and I’m seeing:

FAILED
--------------------
Pups::ExecError: su postgres -c 'psql discourse -c "alter schema public owner to discourse;"' failed with return #<Process::Status: pid 1637 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;\"'"
I, [2020-12-11T18:36:32.257585 #1]  INFO -- : Terminating async processes
df2fcc37c368d13eac3b4a6db4b592028405a0ea91ff39fb8cbb8bcbdc4846fd
** 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.
Full Log

$ sudo ./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-12-11T18:35:42.128663 #1] INFO – : Loading --stdin
    I, [2020-12-11T18:35:42.145184 #1] INFO – : > DEBIAN_FRONTEND=noninteractive apt-get purge -y postgresql-13 postgresql-client-13 postgresql-contrib-13
    I, [2020-12-11T18:35:47.812698 #1] INFO – : Reading package lists…
    Building dependency tree…
    Reading state information…
    The following packages were automatically installed and are no longer required:
    libllvm7 pgdg-keyring postgresql-client-common postgresql-common ssl-cert
    Use ‘apt autoremove’ to remove them.
    The following packages will be REMOVED:
    postgresql-13* postgresql-client-13*
    0 upgraded, 0 newly installed, 2 to remove and 0 not upgraded.
    After this operation, 54.3 MB disk space will be freed.
    (Reading database … 43863 files and directories currently installed.)
    Removing postgresql-13 (13.1-1.pgdg100+1) …
    invoke-rc.d: could not determine current runlevel
    invoke-rc.d: policy-rc.d denied execution of stop.
    Removing postgresql-client-13 (13.1-1.pgdg100+1) …
    Processing triggers for postgresql-common (223.pgdg100+1) …
    Building PostgreSQL dictionaries from installed myspell/hunspell packages…
    Removing obsolete dictionary files:
    (Reading database … 42050 files and directories currently installed.)
    Purging configuration files for postgresql-13 (13.1-1.pgdg100+1) …
    Dropping cluster main…

I, [2020-12-11T18:35:47.813593 #1] INFO – : > apt-get update && apt-get install -y postgresql-12 postgresql-client-12 postgresql-contrib-12
debconf: delaying package configuration, since apt-utils is not installed
I, [2020-12-11T18:36:26.125598 #1] INFO – : Get:1 http://apt.postgresql.org/pub/repos/apt buster-pgdg InRelease [104 kB]
Get:2 http://security.debian.org/debian-security buster/updates InRelease [65.4 kB]
Hit:3 http://deb.debian.org/debian buster InRelease
Get:4 http://deb.debian.org/debian buster-updates InRelease [51.9 kB]
Hit:5 https://deb.nodesource.com/node_10.x buster InRelease
Get:6 http://apt.postgresql.org/pub/repos/apt buster-pgdg/main amd64 Packages [216 kB]
Get:7 http://security.debian.org/debian-security buster/updates/main amd64 Packages [254 kB]
Fetched 690 kB in 2s (342 kB/s)
Reading package lists…
Reading package lists…
Building dependency tree…
Reading state information…
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 5 not upgraded.
Need to get 16.1 MB of archives.
After this operation, 54.0 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.5-1.pgdg100+1 [1,422 kB]
Get:2 http://apt.postgresql.org/pub/repos/apt buster-pgdg/main amd64 postgresql-12 amd64 12.5-1.pgdg100+1 [14.7 MB]
Fetched 16.1 MB in 5s (3,052 kB/s)
Selecting previously unselected package postgresql-client-12.
(Reading database … 42050 files and directories currently installed.)
Preparing to unpack …/postgresql-client-12_12.5-1.pgdg100+1_amd64.deb …
Unpacking postgresql-client-12 (12.5-1.pgdg100+1) …
Selecting previously unselected package postgresql-12.
Preparing to unpack …/postgresql-12_12.5-1.pgdg100+1_amd64.deb …
Unpacking postgresql-12 (12.5-1.pgdg100+1) …
Setting up postgresql-client-12 (12.5-1.pgdg100+1) …
update-alternatives: using /usr/share/postgresql/12/man/man1/psql.1.gz to provide /usr/share/man/man1/psql.1.gz (psql.1.gz) in auto mode
Setting up postgresql-12 (12.5-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 5432 down postgres /var/lib/postgresql/12/main /var/log/postgresql/postgresql-12-main.log
update-alternatives: using /usr/share/postgresql/12/man/man1/postmaster.1.gz to provide /usr/share/man/man1/postmaster.1.gz (postmaster.1.gz) in auto mode
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:

I, [2020-12-11T18:36:26.126230 #1] INFO – : > mkdir -p /shared/postgres_run
I, [2020-12-11T18:36:26.135185 #1] INFO – :
I, [2020-12-11T18:36:26.135798 #1] INFO – : > chown postgres:postgres /shared/postgres_run
I, [2020-12-11T18:36:26.146730 #1] INFO – :
I, [2020-12-11T18:36:26.147724 #1] INFO – : > chmod 775 /shared/postgres_run
I, [2020-12-11T18:36:26.161275 #1] INFO – :
I, [2020-12-11T18:36:26.162652 #1] INFO – : > rm -fr /var/run/postgresql
I, [2020-12-11T18:36:26.175256 #1] INFO – :
I, [2020-12-11T18:36:26.176159 #1] INFO – : > ln -s /shared/postgres_run /var/run/postgresql
I, [2020-12-11T18:36:26.184044 #1] INFO – :
I, [2020-12-11T18:36:26.184889 #1] INFO – : > socat /dev/null UNIX-CONNECT:/shared/postgres_run/.s.PGSQL.5432 || exit 0 && echo postgres already running stop container ; exit 1
2020/12/11 18:36:26 socat[1595] E connect(6, AF=1 “/shared/postgres_run/.s.PGSQL.5432”, 36): No such file or directory
I, [2020-12-11T18:36:26.198536 #1] INFO – :
I, [2020-12-11T18:36:26.198946 #1] INFO – : > rm -fr /shared/postgres_run/.s*
I, [2020-12-11T18:36:26.213075 #1] INFO – :
I, [2020-12-11T18:36:26.217247 #1] INFO – : > rm -fr /shared/postgres_run/.pid
I, [2020-12-11T18:36:26.234701 #1] INFO – :
I, [2020-12-11T18:36:26.235766 #1] INFO – : > mkdir -p /shared/postgres_run/12-main.pg_stat_tmp
I, [2020-12-11T18:36:26.252691 #1] INFO – :
I, [2020-12-11T18:36:26.253254 #1] INFO – : > chown postgres:postgres /shared/postgres_run/12-main.pg_stat_tmp
I, [2020-12-11T18:36:26.265460 #1] INFO – :
I, [2020-12-11T18:36:26.305117 #1] INFO – : File > /etc/service/postgres/run chmod: +x chown:
I, [2020-12-11T18:36:26.340226 #1] INFO – : File > /etc/runit/3.d/99-postgres chmod: +x chown:
I, [2020-12-11T18:36:26.341055 #1] INFO – : > chown -R root /var/lib/postgresql/12/main
I, [2020-12-11T18:36:26.395341 #1] INFO – :
I, [2020-12-11T18:36:26.397567 #1] INFO – : > [ ! -e /shared/postgres_data ] && install -d -m 0755 -o postgres -g postgres /shared/postgres_data && sudo -E -u postgres /usr/lib/postgresql/12/bin/initdb -D /shared/postgres_data || exit 0
I, [2020-12-11T18:36:26.410438 #1] INFO – :
I, [2020-12-11T18:36:26.410620 #1] INFO – : > chown -R postgres:postgres /shared/postgres_data
I, [2020-12-11T18:36:26.483230 #1] INFO – :
I, [2020-12-11T18:36:26.483480 #1] INFO – : > chown -R postgres:postgres /var/run/postgresql
I, [2020-12-11T18:36:26.498060 #1] INFO – :
I, [2020-12-11T18:36:26.498607 #1] INFO – : Replacing data_directory = ‘/var/lib/postgresql/12/main’ with data_directory = ‘/shared/postgres_data’ in /etc/postgresql/12/main/postgresql.conf
I, [2020-12-11T18:36:26.499830 #1] INFO – : Replacing (?-mix:#?listen_addresses =.) with listen_addresses = '
’ in /etc/postgresql/12/main/postgresql.conf
I, [2020-12-11T18:36:26.501216 #1] INFO – : Replacing (?-mix:#?synchronous_commit =.) with synchronous_commit = $db_synchronous_commit in /etc/postgresql/12/main/postgresql.conf
I, [2020-12-11T18:36:26.503288 #1] INFO – : Replacing (?-mix:#?shared_buffers =.) with shared_buffers = $db_shared_buffers in /etc/postgresql/12/main/postgresql.conf
I, [2020-12-11T18:36:26.503960 #1] INFO – : Replacing (?-mix:#?work_mem =.) with work_mem = $db_work_mem in /etc/postgresql/12/main/postgresql.conf
I, [2020-12-11T18:36:26.505121 #1] INFO – : Replacing (?-mix:#?default_text_search_config =.) with default_text_search_config = ‘$db_default_text_search_config’ in /etc/postgresql/12/main/postgresql.conf
I, [2020-12-11T18:36:26.509117 #1] INFO – : > install -d -m 0755 -o postgres -g postgres /shared/postgres_backup
I, [2020-12-11T18:36:26.529609 #1] INFO – :
I, [2020-12-11T18:36:26.530771 #1] INFO – : Replacing (?-mix:#?checkpoint_segments =.) with checkpoint_segments = $db_checkpoint_segments in /etc/postgresql/12/main/postgresql.conf
I, [2020-12-11T18:36:26.533329 #1] INFO – : Replacing (?-mix:#?logging_collector =.) with logging_collector = $db_logging_collector in /etc/postgresql/12/main/postgresql.conf
I, [2020-12-11T18:36:26.534342 #1] INFO – : Replacing (?-mix:#?log_min_duration_statement =.) with log_min_duration_statement = $db_log_min_duration_statement in /etc/postgresql/12/main/postgresql.conf
I, [2020-12-11T18:36:26.535368 #1] INFO – : Replacing (?-mix:^#local +replication +postgres +peer$) with local replication postgres peer in /etc/postgresql/12/main/pg_hba.conf
I, [2020-12-11T18:36:26.536115 #1] INFO – : Replacing (?-mix:^host.*all.*all.127.$) with host all all 0.0.0.0/0 md5 in /etc/postgresql/12/main/pg_hba.conf
I, [2020-12-11T18:36:26.536854 #1] INFO – : > HOME=/var/lib/postgresql USER=postgres exec chpst -u postgres:postgres:ssl-cert -U postgres:postgres:ssl-cert /usr/lib/postgresql/12/bin/postmaster -D /etc/postgresql/12/main
I, [2020-12-11T18:36:26.542081 #1] INFO – : > sleep 5
2020-12-11 18:36:26.649 UTC [1611] FATAL: database files are incompatible with server
2020-12-11 18:36:26.649 UTC [1611] DETAIL: The data directory was initialized by PostgreSQL version 13, which is not compatible with this version 12.5 (Debian 12.5-1.pgdg100+1).
I, [2020-12-11T18:36:31.555237 #1] INFO – :
I, [2020-12-11T18:36:31.556039 #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, [2020-12-11T18:36:31.718921 #1] INFO – :
I, [2020-12-11T18:36:31.719321 #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, [2020-12-11T18:36:31.892475 #1] INFO – :
I, [2020-12-11T18:36:31.893214 #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, [2020-12-11T18:36:32.067027 #1] INFO – :
I, [2020-12-11T18:36:32.067426 #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, [2020-12-11T18:36:32.256513 #1] INFO – :

FAILED

Pups::ExecError: su postgres -c ‘psql discourse -c “alter schema public owner to discourse;”’ failed with return #<Process::Status: pid 1637 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;”’”
I, [2020-12-11T18:36:32.257585 #1] INFO – : Terminating async processes
df2fcc37c368d13eac3b4a6db4b592028405a0ea91ff39fb8cbb8bcbdc4846fd
** 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.

1 Like

I’m a bit confused, but seems we are already on version 13 of PostgreSQL. Restored app.yml for default postgres, re-ran rebuild and the forum is back up and running. Solved.

2 Likes