Upgrade from 12.10.3 to 13.0.0 fails

Hello,

I am running my gitlab with a gitlab-omnibus docker image. when i start the 13.0.0 Omnibus Version on a fresh installation, everything is fine. But when i am trying to upgrade my running 12.10.3 installation to 13.0.0 i run into this error after the container started:

bash[migrate gitlab-rails database] (gitlab::database_migrations line 55) had an error: Mixlib::ShellOut::ShellCommandFailed: Expected process to exit with [0], but received '1'
---- Begin output of "bash"  "/tmp/chef-script20200526-62-1j1gvk1" ----
STDOUT: rake aborted!
PG::ConnectionBad: could not connect to server: Connection refused
	Is the server running locally and accepting
	connections on Unix domain socket "/var/opt/gitlab/postgresql/.s.PGSQL.5432"?
/opt/gitlab/embedded/service/gitlab-rails/lib/tasks/gitlab/db.rake:48:in `block (3 levels) in <top (required)>'
/opt/gitlab/embedded/bin/bundle:23:in `load'
/opt/gitlab/embedded/bin/bundle:23:in `<main>'
Tasks: TOP => gitlab:db:configure
(See full trace by running task with --trace)
STDERR: 
---- End output of "bash"  "/tmp/chef-script20200526-62-1j1gvk1" ----
Ran "bash"  "/tmp/chef-script20200526-62-1j1gvk1" returned 1
root@ 5b20688f67cb:/# ps aux | grep postgres
root       498  0.1  0.0   4392  1280 ?        Ss   12:12   0:00 runsv postgresql
root       537  0.0  0.0   4536   892 ?        S    12:12   0:00 svlogd -tt /var/log/gitlab/postgresql
root       617  0.0  0.0  11460  1048 pts/0    S+   12:13   0:00 grep --color=auto postgres
root@5b20688f67cb:/# gitlab-ctl status
run: gitaly: (pid 339) 47s; run: log: (pid 379) 45s
down: postgresql: 1s, normally up, want up; run: log: (pid 493) 39s
run: redis: (pid 327) 48s; run: log: (pid 364) 47s
root@5b20688f67cb:/# gitlab-ctl start postgresql
timeout: down: postgresql: 1s, normally up, want up

In the logs i see a clear message:

2020-05-26_12:36:39.28723 FATAL:  database files are incompatible with server
2020-05-26_12:36:39.28728 DETAIL:  The data directory was initialized by PostgreSQL version 10, which is not compatible with this version 11.7.

But when i try to run the following, it fails, because the reconfigure fails:

root@776afae8c85a:/# gitlab-ctl pg-upgrade
Traceback (most recent call last):
	8: from /opt/gitlab/embedded/bin/omnibus-ctl:23:in `<main>'
	7: from /opt/gitlab/embedded/bin/omnibus-ctl:23:in `load'
	6: from /opt/gitlab/embedded/lib/ruby/gems/2.6.0/gems/omnibus-ctl-0.6.0/bin/omnibus-ctl:31:in `<top (required)>'
	5: from /opt/gitlab/embedded/lib/ruby/gems/2.6.0/gems/omnibus-ctl-0.6.0/lib/omnibus-ctl.rb:746:in `run'
	4: from /opt/gitlab/embedded/lib/ruby/gems/2.6.0/gems/omnibus-ctl-0.6.0/lib/omnibus-ctl.rb:204:in `block in add_command_under_category'
	3: from /opt/gitlab/embedded/service/omnibus-ctl/pg-upgrade.rb:115:in `block in load_file'
	2: from /opt/gitlab/embedded/service/omnibus-ctl/lib/gitlab_ctl/util.rb:105:in `roles'
	1: from /opt/gitlab/embedded/service/omnibus-ctl/lib/gitlab_ctl/util.rb:64:in `get_node_attributes'
/opt/gitlab/embedded/service/omnibus-ctl/lib/gitlab_ctl/util.rb:52:in `parse_json_file': Attributes not found in /opt/gitlab/embedded/nodes/776afae8c85a.json, has reconfigure been run yet? (GitlabCtl::Errors::NodeError)

Then the container dies. Anybody know hot to fix it? If you need anymore informations, just let me know.

Best regards

Update: I found out, that when i setup a new instance, postgresql is installed with 11.7, what makes sense. But when i have a older one with postgresql 9 or 10, upgrade fails.

Edited by Ian Baum