Database error on update from 15.11.2 to 15.11.3 (ee)
Summary
I tried upgrading GitLab to 15.11.3 via apt-get
and encountered an database error.
Steps to reproduce
In the attachments is a log. I executed the following commands:
gitlab-ctl reconfigure
(first to check if it works)
apt-get update
apt-get upgrade -y
What is the current bug behavior?
The database error - GitLab does not start anymore
What is the expected correct behavior?
GitLab updated an running :)
Relevant logs
Relevant logs
``` StandardError: An error has occurred, this and all later migrations canceled:PG::DuplicateSchema: ERROR: schema "gitlab_partitions_dynamic" already exists /opt/gitlab/embedded/service/gitlab-rails/db/migrate/20211202041233_init_schema.rb:7:in
up' /opt/gitlab/embedded/service/gitlab-rails/lib/gitlab/database/load_balancing/connection_proxy.rb:121:in
public_send' /opt/gitlab/embedded/service/gitlab-rails/lib/gitlab/database/load_balancing/connection_proxy.rb:121:inblock in write_using_load_balancer' /opt/gitlab/embedded/service/gitlab-rails/lib/gitlab/database/load_balancing/load_balancer.rb:127:in
block in read_write' /opt/gitlab/embedded/service/gitlab-rails/lib/gitlab/database/load_balancing/load_balancer.rb:198:inretry_with_backoff' /opt/gitlab/embedded/service/gitlab-rails/lib/gitlab/database/load_balancing/load_balancer.rb:116:in
read_write' /opt/gitlab/embedded/service/gitlab-rails/lib/gitlab/database/load_balancing/connection_proxy.rb:120:inwrite_using_load_balancer' /opt/gitlab/embedded/service/gitlab-rails/lib/gitlab/database/load_balancing/connection_proxy.rb:72:in
transaction' /opt/gitlab/embedded/service/gitlab-rails/lib/gitlab/database.rb:369:inblock in transaction' /opt/gitlab/embedded/service/gitlab-rails/lib/gitlab/database.rb:368:in
transaction' /opt/gitlab/embedded/service/gitlab-rails/lib/gitlab/database/migrations/lock_retry_mixin.rb:36:inddl_transaction' /opt/gitlab/embedded/service/gitlab-rails/lib/gitlab/database/migrations/pg_backend_pid.rb:15:in
block in with_advisory_lock_connection' /opt/gitlab/embedded/service/gitlab-rails/lib/gitlab/database/migrations/pg_backend_pid.rb:12:inwith_advisory_lock_connection' /opt/gitlab/embedded/service/gitlab-rails/lib/tasks/gitlab/db.rake:117:in
configure_database' /opt/gitlab/embedded/service/gitlab-rails/lib/tasks/gitlab/db.rake:95:inblock (3 levels) in <top (required)>' /opt/gitlab/embedded/bin/bundle:23:in
load' /opt/gitlab/embedded/bin/bundle:23:in `'Caused by: ActiveRecord::StatementInvalid: PG::DuplicateSchema: ERROR: schema "gitlab_partitions_dynamic" already exists /opt/gitlab/embedded/service/gitlab-rails/db/migrate/20211202041233_init_schema.rb:7:in
up' /opt/gitlab/embedded/service/gitlab-rails/lib/gitlab/database/load_balancing/connection_proxy.rb:121:in
public_send' /opt/gitlab/embedded/service/gitlab-rails/lib/gitlab/database/load_balancing/connection_proxy.rb:121:inblock in write_using_load_balancer' /opt/gitlab/embedded/service/gitlab-rails/lib/gitlab/database/load_balancing/load_balancer.rb:127:in
block in read_write' /opt/gitlab/embedded/service/gitlab-rails/lib/gitlab/database/load_balancing/load_balancer.rb:198:inretry_with_backoff' /opt/gitlab/embedded/service/gitlab-rails/lib/gitlab/database/load_balancing/load_balancer.rb:116:in
read_write' /opt/gitlab/embedded/service/gitlab-rails/lib/gitlab/database/load_balancing/connection_proxy.rb:120:inwrite_using_load_balancer' /opt/gitlab/embedded/service/gitlab-rails/lib/gitlab/database/load_balancing/connection_proxy.rb:72:in
transaction' /opt/gitlab/embedded/service/gitlab-rails/lib/gitlab/database.rb:369:inblock in transaction' /opt/gitlab/embedded/service/gitlab-rails/lib/gitlab/database.rb:368:in
transaction' /opt/gitlab/embedded/service/gitlab-rails/lib/gitlab/database/migrations/lock_retry_mixin.rb:36:inddl_transaction' /opt/gitlab/embedded/service/gitlab-rails/lib/gitlab/database/migrations/pg_backend_pid.rb:15:in
block in with_advisory_lock_connection' /opt/gitlab/embedded/service/gitlab-rails/lib/gitlab/database/migrations/pg_backend_pid.rb:12:inwith_advisory_lock_connection' /opt/gitlab/embedded/service/gitlab-rails/lib/tasks/gitlab/db.rake:117:in
configure_database' /opt/gitlab/embedded/service/gitlab-rails/lib/tasks/gitlab/db.rake:95:inblock (3 levels) in <top (required)>' /opt/gitlab/embedded/bin/bundle:23:in
load' /opt/gitlab/embedded/bin/bundle:23:in `'Caused by: PG::DuplicateSchema: ERROR: schema "gitlab_partitions_dynamic" already exists /opt/gitlab/embedded/service/gitlab-rails/db/migrate/20211202041233_init_schema.rb:7:in
up' /opt/gitlab/embedded/service/gitlab-rails/lib/gitlab/database/load_balancing/connection_proxy.rb:121:in
public_send' /opt/gitlab/embedded/service/gitlab-rails/lib/gitlab/database/load_balancing/connection_proxy.rb:121:inblock in write_using_load_balancer' /opt/gitlab/embedded/service/gitlab-rails/lib/gitlab/database/load_balancing/load_balancer.rb:127:in
block in read_write' /opt/gitlab/embedded/service/gitlab-rails/lib/gitlab/database/load_balancing/load_balancer.rb:198:inretry_with_backoff' /opt/gitlab/embedded/service/gitlab-rails/lib/gitlab/database/load_balancing/load_balancer.rb:116:in
read_write' /opt/gitlab/embedded/service/gitlab-rails/lib/gitlab/database/load_balancing/connection_proxy.rb:120:inwrite_using_load_balancer' /opt/gitlab/embedded/service/gitlab-rails/lib/gitlab/database/load_balancing/connection_proxy.rb:72:in
transaction' /opt/gitlab/embedded/service/gitlab-rails/lib/gitlab/database.rb:369:inblock in transaction' /opt/gitlab/embedded/service/gitlab-rails/lib/gitlab/database.rb:368:in
transaction' /opt/gitlab/embedded/service/gitlab-rails/lib/gitlab/database/migrations/lock_retry_mixin.rb:36:inddl_transaction' /opt/gitlab/embedded/service/gitlab-rails/lib/gitlab/database/migrations/pg_backend_pid.rb:15:in
block in with_advisory_lock_connection' /opt/gitlab/embedded/service/gitlab-rails/lib/gitlab/database/migrations/pg_backend_pid.rb:12:inwith_advisory_lock_connection' /opt/gitlab/embedded/service/gitlab-rails/lib/tasks/gitlab/db.rake:117:in
configure_database' /opt/gitlab/embedded/service/gitlab-rails/lib/tasks/gitlab/db.rake:95:inblock (3 levels) in <top (required)>' /opt/gitlab/embedded/bin/bundle:23:in
load' /opt/gitlab/embedded/bin/bundle:23:in `' Tasks: TOP => db:migrate (See full trace by running task with --trace) STDERR: ---- End output of "bash" ---- Ran "bash" returned 1There was an error running gitlab-ctl reconfigure. Please check the output above for more details.
dpkg: error processing package gitlab-ee (--configure): installed gitlab-ee package post-installation script subprocess returned error exit status 1```
The rest: See attached file gitlab-error.txt