All-in-one container fails to start after upgrading v0.3.0 to v0.4.0. issues with the database[solved]

Hi,
i’ve installed the Beta software at https://github.com/nextcloud/all-in-one
Worked really nicely! I’ve installed v0.3.0 on the 16th. installation as per github readme. No integration setup with other software.

1)
After i created a backup, it mentioned both the mastercontainer and the other containers had an update(v0.4.0 as per 17th Feb). I think i was to enthousistic and from the admin console at port 8080 i updated both types without starting/testing inbetween to see if nothing broke in each separate update.

2)
But now, i’ve got all containers updated, but no container can get access to the database container. the database container log is included below:


+ rm -rf /var/lib/postgresql/data/PG_VERSION /var/lib/postgresql/data/base /var/lib/postgresql/data/global /var/lib/postgresql/data/pg_commit_ts /var/lib/postgresql/data/pg_dynshmem /var/lib/postgresql/data/pg_hba.conf /var/lib/postgresql/data/pg_ident.conf /var/lib/postgresql/data/pg_logical /var/lib/postgresql/data/pg_multixact /var/lib/postgresql/data/pg_notify /var/lib/postgresql/data/pg_replslot /var/lib/postgresql/data/pg_serial /var/lib/postgresql/data/pg_snapshots /var/lib/postgresql/data/pg_stat /var/lib/postgresql/data/pg_stat_tmp /var/lib/postgresql/data/pg_subtrans /var/lib/postgresql/data/pg_tblspc /var/lib/postgresql/data/pg_twophase /var/lib/postgresql/data/pg_wal /var/lib/postgresql/data/pg_xact /var/lib/postgresql/data/postgresql.auto.conf /var/lib/postgresql/data/postgresql.conf /var/lib/postgresql/data/postmaster.opts
+ touch /mnt/data/initial-cleanup-done

x
Restoring from database dump.
+ rm -rf '/var/lib/postgresql/data/*'
+ export PGPORT=11000
+ PGPORT=11000
+ sleep 10s
+ exec docker-entrypoint.sh postgres
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.utf8".
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/data ... ok
creating subdirectories ... ok
selecting dynamic shared memory implementation ... posix
selecting default max_connections ... 100
selecting default shared_buffers ... 128MB
selecting default time zone ... UTC
creating configuration files ... ok
running bootstrap script ... ok
sh: locale: not found
2022-02-18 00:57:48.196 UTC [31] WARNING:  no usable system locales were found
performing post-bootstrap initialization ... ok
+ grep -q 'Owner: oc_admin' /mnt/data/database-dump.sql
+ grep -q 'Owner: oc_nextcloud' /mnt/data/database-dump.sql
+ OC_ADMIN_EXISTS=1
+ psql -v ON_ERROR_STOP=1 --username nextcloud --dbname nextcloud_database
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.11000"?
syncing data to disk ...       
PostgreSQL Database directory appears to contain a database; Skipping initialization

2022-02-18 00:58:06.450 UTC [11] LOG:  starting PostgreSQL 13.5 on x86_64-pc-linux-musl, compiled by gcc (Alpine 10.3.1_git20211027) 10.3.1 20211027, 64-bit
2022-02-18 00:58:06.450 UTC [11] LOG:  listening on IPv4 address "0.0.0.0", port 5432
2022-02-18 00:58:06.450 UTC [11] LOG:  listening on IPv6 address "::", port 5432
2022-02-18 00:58:06.571 UTC [11] LOG:  listening on Unix socket "/var/run/postgresql/.s.PGSQL.5432"
2022-02-18 00:58:06.702 UTC [18] LOG:  database system was shut down at 2022-02-18 00:57:49 UTC
2022-02-18 00:58:06.794 UTC [11] LOG:  database system is ready to accept connections
2022-02-18 00:58:11.371 UTC [26] FATAL:  no pg_hba.conf entry for host "172.19.0.5", user "oc_nextcloud", database "nextcloud_database", SSL off
2022-02-18 00:58:17.641 UTC [27] FATAL:  no pg_hba.conf entry for host "172.19.0.5", user "oc_admin", database "nextcloud_database", SSL off
///snip
2022-02-18 01:13:33.104 UTC [75] FATAL:  no pg_hba.conf entry for host "172.19.0.5", user "oc_admin", database "nextcloud_database", SSL off
2022-02-18 01:16:44.048 UTC [79] FATAL:  database "nextcloud_database" does not exist
pg_dump: error: connection to database "nextcloud_database" failed: FATAL:  database "nextcloud_database" does not exist
2022-02-18 01:16:44.055 UTC [11] LOG:  received fast shutdown request
2022-02-18 01:16:44.099 UTC [11] LOG:  aborting any active transactions
2022-02-18 01:16:44.100 UTC [11] LOG:  background worker "logical replication launcher" (PID 24) exited with exit code 1
2022-02-18 01:16:44.103 UTC [19] LOG:  shutting down
2022-02-18 01:16:44.267 UTC [11] LOG:  database system is shut down
waiting for server to shut down.... done
server stopped
Database dump unsuccessful!

3)
Because it said: database “nextcloud” does not exist, i stopped NC using admin console, and i recovered the backup. Now the Database log complains about “password authentication failed”

+ rm -rf /var/lib/postgresql/data/PG_VERSION /var/lib/postgresql/data/base /var/lib/postgresql/data/global /var/lib/postgresql/data/pg_commit_ts /var/lib/postgresql/data/pg_dynshmem /var/lib/postgresql/data/pg_hba.conf /var/lib/postgresql/data/pg_ident.conf /var/lib/postgresql/data/pg_logical /var/lib/postgresql/data/pg_multixact /var/lib/postgresql/data/pg_notify /var/lib/postgresql/data/pg_replslot /var/lib/postgresql/data/pg_serial /var/lib/postgresql/data/pg_snapshots /var/lib/postgresql/data/pg_stat /var/lib/postgresql/data/pg_stat_tmp /var/lib/postgresql/data/pg_subtrans /var/lib/postgresql/data/pg_tblspc /var/lib/postgresql/data/pg_twophase /var/lib/postgresql/data/pg_wal /var/lib/postgresql/data/pg_xact /var/lib/postgresql/data/postgresql.auto.conf /var/lib/postgresql/data/postgresql.conf /var/lib/postgresql/data/postmaster.opts
+ touch /mnt/data/initial-cleanup-done

x
Restoring from database dump.
+ rm -rf '/var/lib/postgresql/data/*'
+ export PGPORT=11000
+ PGPORT=11000
+ sleep 10s
+ exec docker-entrypoint.sh postgres
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.utf8".
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/data ... ok
creating subdirectories ... ok
selecting dynamic shared memory implementation ... posix
selecting default max_connections ... 100
selecting default shared_buffers ... 128MB
selecting default time zone ... UTC
creating configuration files ... ok
running bootstrap script ... ok
sh: locale: not found
2022-02-18 01:54:55.305 UTC [30] WARNING:  no usable system locales were found
performing post-bootstrap initialization ... ok
+ grep -q 'Owner: oc_admin' /mnt/data/database-dump.sql
+ grep -q 'Owner: oc_nextcloud' /mnt/data/database-dump.sql
syncing data to disk ... ok

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.

Success. You can now start the database server using:

    pg_ctl -D /var/lib/postgresql/data -l logfile start

+ OC_ADMIN_EXISTS=1
+ psql -v ON_ERROR_STOP=1 --username nextcloud --dbname nextcloud_database
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.11000"?
waiting for server to start....      
PostgreSQL Database directory appears to contain a database; Skipping initialization

2022-02-18 01:55:17.010 UTC [10] LOG:  starting PostgreSQL 13.5 on x86_64-pc-linux-musl, compiled by gcc (Alpine 10.3.1_git20211027) 10.3.1 20211027, 64-bit
2022-02-18 01:55:17.011 UTC [10] LOG:  listening on IPv4 address "0.0.0.0", port 5432
2022-02-18 01:55:17.011 UTC [10] LOG:  listening on IPv6 address "::", port 5432
2022-02-18 01:55:17.179 UTC [10] LOG:  listening on Unix socket "/var/run/postgresql/.s.PGSQL.5432"
2022-02-18 01:55:17.397 UTC [17] LOG:  database system was shut down at 2022-02-18 01:54:56 UTC
2022-02-18 01:55:17.490 UTC [10] LOG:  database system is ready to accept connections
2022-02-18 01:55:23.221 UTC [25] FATAL:  password authentication failed for user "oc_nextcloud"
2022-02-18 01:55:23.221 UTC [25] DETAIL:  Role "oc_nextcloud" does not exist.
	Connection matched pg_hba.conf line 99: "host all all all md5"
2022-02-18 01:55:23.668 UTC [26] FATAL:  password authentication failed for user "oc_admin"
2022-02-18 01:55:23.668 UTC [26] DETAIL:  Role "oc_admin" does not exist.
	Connection matched pg_hba.conf line 99: "host all all all md5"
2022-02-18 01:55:23.856 UTC [27] FATAL:  password authentication failed for user "oc_admin"
2022-02-18 01:55:23.856 UTC [27] DETAIL:  Role "oc_admin" does not exist.
	Connection matched pg_hba.conf line 99: "host all all all md5"
///snip
2022-02-18 01:55:38.488 UTC [53] FATAL:  password authentication failed for user "oc_admin"
2022-02-18 01:55:38.488 UTC [53] DETAIL:  Role "oc_admin" does not exist.
	Connection matched pg_hba.conf line 99: "host all all all md5"

Any help appreciated

Thanks! Lets handle this in https://github.com/nextcloud/all-in-one/issues/235