Error when update to GitLab greater than 12.6.8

Summary

Since a couple of weeks, I trying to update my Docker (self-hosted) gitlab to the latest version but I can't.

Steps to reproduce

Perform an update from the version 12.6.8 to 12.7.0 or more.

  1. Edit compose file and use greater version or latest tag
  2. Docker pull
  3. Docker up. During the database migration, the following errors appears:
gitlab-gitlab-ce | Recipe: gitlab::gitlab-rails
gitlab-gitlab-ce |   * execute[clear the gitlab-rails cache] action run
gitlab-gitlab-ce |     - execute /opt/gitlab/bin/gitlab-rake cache:clear
gitlab-gitlab-ce | Recipe: <Dynamically Defined Resource>
gitlab-gitlab-ce |   * service[gitaly] action restart
gitlab-gitlab-ce |     - restart service service[gitaly]
gitlab-gitlab-ce | Recipe: gitaly::enable
gitlab-gitlab-ce |   * runit_service[gitaly] action hup
gitlab-gitlab-ce |     - send hup to runit_service[gitaly]
gitlab-gitlab-ce |
gitlab-gitlab-ce | Running handlers:
gitlab-gitlab-ce | There was an error running gitlab-ctl reconfigure:
gitlab-gitlab-ce |
gitlab-gitlab-ce | Multiple failures occurred:
gitlab-gitlab-ce | * Mixlib::ShellOut::ShellCommandFailed occurred in chef run: bash[migrate gitlab-rails database] (gitlab::database_migrations line 54) had an error: Mixlib::ShellOut::ShellCommandFailed: Expected process to exit with [0], but received '1'
gitlab-gitlab-ce | ---- Begin output of "bash"  "/tmp/chef-script20200426-26-4im3w5" ----
gitlab-gitlab-ce | STDOUT: rake aborted!
gitlab-gitlab-ce | StandardError: An error has occurred, all later migrations canceled:
gitlab-gitlab-ce |
gitlab-gitlab-ce | Multiple indexes found on ci_pipelines columns [:project_id]. Specify an index name from ci_pipelines_project_id_idx, index_ci_pipelines_on_project_id
gitlab-gitlab-ce | /opt/gitlab/embedded/service/gitlab-rails/lib/gitlab/database/migration_helpers.rb:119:in `block in remove_concurrent_index'
gitlab-gitlab-ce | /opt/gitlab/embedded/service/gitlab-rails/lib/gitlab/database/migration_helpers.rb:263:in `disable_statement_timeout'
gitlab-gitlab-ce | /opt/gitlab/embedded/service/gitlab-rails/lib/gitlab/database/migration_helpers.rb:118:in `remove_concurrent_index'
gitlab-gitlab-ce | /opt/gitlab/embedded/service/gitlab-rails/db/migrate/20191229140154_drop_index_ci_pipelines_on_project_id.rb:11:in `up'
gitlab-gitlab-ce | /opt/gitlab/embedded/service/gitlab-rails/lib/tasks/gitlab/db.rake:49:in `block (3 levels) in <top (required)>'
gitlab-gitlab-ce | /opt/gitlab/embedded/bin/bundle:23:in `load'
gitlab-gitlab-ce | /opt/gitlab/embedded/bin/bundle:23:in `<main>'
gitlab-gitlab-ce |
gitlab-gitlab-ce | Caused by:
gitlab-gitlab-ce | ArgumentError: Multiple indexes found on ci_pipelines columns [:project_id]. Specify an index name from ci_pipelines_project_id_idx, index_ci_pipelines_on_project_id
gitlab-gitlab-ce | /opt/gitlab/embedded/service/gitlab-rails/lib/gitlab/database/migration_helpers.rb:119:in `block in remove_concurrent_index'
gitlab-gitlab-ce | /opt/gitlab/embedded/service/gitlab-rails/lib/gitlab/database/migration_helpers.rb:263:in `disable_statement_timeout'
gitlab-gitlab-ce | /opt/gitlab/embedded/service/gitlab-rails/lib/gitlab/database/migration_helpers.rb:118:in `remove_concurrent_index'
gitlab-gitlab-ce | /opt/gitlab/embedded/service/gitlab-rails/db/migrate/20191229140154_drop_index_ci_pipelines_on_project_id.rb:11:in `up'
gitlab-gitlab-ce | /opt/gitlab/embedded/service/gitlab-rails/lib/tasks/gitlab/db.rake:49:in `block (3 levels) in <top (required)>'
gitlab-gitlab-ce | /opt/gitlab/embedded/bin/bundle:23:in `load'
gitlab-gitlab-ce | /opt/gitlab/embedded/bin/bundle:23:in `<main>'
gitlab-gitlab-ce | Tasks: TOP => db:migrate
gitlab-gitlab-ce | (See full trace by running task with --trace)
gitlab-gitlab-ce | == 20191229140154 DropIndexCiPipelinesOnProjectId: migrating ==================
gitlab-gitlab-ce | -- transaction_open?()
gitlab-gitlab-ce |    -> 0.0000s
gitlab-gitlab-ce | -- index_exists?(:ci_pipelines, :project_id, {:algorithm=>:concurrently})
gitlab-gitlab-ce |    -> 0.0162s
gitlab-gitlab-ce | -- execute("SET statement_timeout TO 0")
gitlab-gitlab-ce |    -> 0.0003s
gitlab-gitlab-ce | -- remove_index(:ci_pipelines, {:algorithm=>:concurrently, :column=>:project_id})
gitlab-gitlab-ce | -- execute("RESET ALL")
gitlab-gitlab-ce |    -> 0.0003s
gitlab-gitlab-ce | STDERR:
gitlab-gitlab-ce | ---- End output of "bash"  "/tmp/chef-script20200426-26-4im3w5" ----
gitlab-gitlab-ce | Ran "bash"  "/tmp/chef-script20200426-26-4im3w5" returned 1
gitlab-gitlab-ce | * Mixlib::ShellOut::ShellCommandFailed occurred in delayed notification: service[mailroom] (dynamically defined) had an error: Mixlib::ShellOut::ShellCommandFailed: Expected process to exit with [0], but received '1'
gitlab-gitlab-ce | ---- Begin output of /opt/gitlab/embedded/bin/chpst -u root:root /opt/gitlab/embedded/bin/sv restart /opt/gitlab/service/mailroom ----
gitlab-gitlab-ce | STDOUT: fail: /opt/gitlab/service/mailroom: unable to change to service directory: file does not exist
gitlab-gitlab-ce | STDERR:
gitlab-gitlab-ce | ---- End output of /opt/gitlab/embedded/bin/chpst -u root:root /opt/gitlab/embedded/bin/sv restart /opt/gitlab/service/mailroom ----
gitlab-gitlab-ce | Ran /opt/gitlab/embedded/bin/chpst -u root:root /opt/gitlab/embedded/bin/sv restart /opt/gitlab/service/mailroom returned 1
gitlab-gitlab-ce |
gitlab-gitlab-ce | Running handlers complete
gitlab-gitlab-ce | Chef Client failed. 121 resources updated in 01 minutes 21 seconds

The main error seems to be:

ArgumentError: Multiple indexes found on ci_pipelines columns [:project_id]. Specify an index name from ci_pipelines_project_id_idx, index_ci_pipelines_on_project_id

What is the expected correct behavior?

Can update to the latest version of GitLab

Results of GitLab environment info

Expand for output related to GitLab environment info
gitlab:/# gitlab-rake gitlab:env:info

System information
System:
Current User:	git
Using RVM:	no
Ruby Version:	2.6.3p62
Gem Version:	2.7.9
Bundler Version:1.17.3
Rake Version:	12.3.3
Redis Version:	3.2.12
Git Version:	2.24.1
Sidekiq Version:5.2.7
Go Version:	unknown

GitLab information
Version:	12.6.8
Revision:	c1c07df4ad3
Directory:	/opt/gitlab/embedded/service/gitlab-rails
DB Adapter:	PostgreSQL
DB Version:	10.12
URL:		http://mydomain.dom
HTTP Clone URL:	https://mydomain.dom/some-group/some-project.git
SSH Clone URL:	[git@https://mydomain.dom]:some-group/some-project.git
Using LDAP:	no
Using Omniauth:	no

GitLab Shell
Version:	10.3.0
Repository storage paths:
- default: 	/var/opt/gitlab/git-data/repositories
GitLab Shell path:		/opt/gitlab/embedded/service/gitlab-shell
Git:		/opt/gitlab/embedded/bin/git

Results of GitLab application Check

Expand for output related to the GitLab application check
gitlab:/# gitlab-rake gitlab:check SANITIZE=true
Checking GitLab subtasks ...

Checking GitLab Shell ...

GitLab Shell: ... GitLab Shell version >= 10.3.0 ? ... OK (10.3.0) Running /opt/gitlab/embedded/service/gitlab-shell/bin/check Internal API available: OK Redis available via internal API: OK gitlab-shell self-check successful

Checking GitLab Shell ... Finished

Checking Gitaly ...

Gitaly: ... default ... OK

Checking Gitaly ... Finished

Checking Sidekiq ...

Sidekiq: ... Running? ... yes Number of Sidekiq processes ... 1

Checking Sidekiq ... Finished

Checking Incoming Email ...

Incoming Email: ... Checking Reply by email ...

IMAP server credentials are correct? ... yes Init.d configured correctly? ... skipped MailRoom running? ... skipped

Checking Reply by email ... Finished

Checking Incoming Email ... Finished

Checking LDAP ...

LDAP: ... LDAP is disabled in config/gitlab.yml

Checking LDAP ... Finished

Checking GitLab App ...

Git configured correctly? ... yes Database config exists? ... yes All migrations up? ... yes Database contains orphaned GroupMembers? ... no GitLab config exists? ... yes GitLab config up to date? ... yes Log directory writable? ... yes Tmp directory writable? ... yes Uploads directory exists? ... yes Uploads directory has correct permissions? ... yes Uploads directory tmp has correct permissions? ... yes Init script exists? ... skipped (omnibus-gitlab has no init script) Init script up-to-date? ... skipped (omnibus-gitlab has no init script) Projects have namespace: ... 3/3 ... yes 3/7 ... yes 5/8 ... yes 7/12 ... yes 2/16 ... yes 6/18 ... yes 2/21 ... yes 8/23 ... yes 8/24 ... yes 9/25 ... yes 9/26 ... yes 10/27 ... yes 10/28 ... yes 2/29 ... yes 6/30 ... yes 6/31 ... yes 22/32 ... yes 22/33 ... yes 6/34 ... yes 7/35 ... yes 6/36 ... yes 6/37 ... yes 16/38 ... yes 26/39 ... yes 17/40 ... yes 21/41 ... yes 6/42 ... yes 7/43 ... yes 7/44 ... yes 2/50 ... yes 2/51 ... yes 23/52 ... yes 23/53 ... yes 23/54 ... yes 8/55 ... yes 23/56 ... yes 23/57 ... yes 6/59 ... yes 23/61 ... yes 23/62 ... yes 24/63 ... yes 2/64 ... yes 17/65 ... yes 2/66 ... yes 25/89 ... yes 6/90 ... yes 25/91 ... yes 6/92 ... yes 6/93 ... yes 26/94 ... yes 26/95 ... yes 6/96 ... yes 6/97 ... yes 23/98 ... yes 6/99 ... yes 2/100 ... yes 3/101 ... yes 7/102 ... yes 2/105 ... yes 32/106 ... yes 17/107 ... yes 28/109 ... yes 28/110 ... yes 32/112 ... yes 2/113 ... yes 28/114 ... yes 17/115 ... yes 2/116 ... yes 33/117 ... yes 33/118 ... yes 34/119 ... yes 28/120 ... yes 17/121 ... yes 17/122 ... yes 28/123 ... yes 34/124 ... yes 23/126 ... yes 17/129 ... yes 17/130 ... yes 2/131 ... yes 17/132 ... yes 17/133 ... yes 35/134 ... yes 17/135 ... yes 36/136 ... yes 2/137 ... yes 37/138 ... yes 38/139 ... yes 17/140 ... yes 17/141 ... yes 17/142 ... yes 41/144 ... yes 41/145 ... yes 2/146 ... yes 35/147 ... yes 35/148 ... yes 2/150 ... yes 51/151 ... yes 52/152 ... yes 52/153 ... yes 32/154 ... yes 47/155 ... yes Redis version >= 2.8.0? ... yes Ruby version >= 2.5.3 ? ... yes (2.6.3) Git version >= 2.22.0 ? ... yes (2.24.1) Git user has default SSH configuration? ... yes Active users: ... 12 Is authorized keys file accessible? ... yes

Checking GitLab App ... Finished

Checking GitLab subtasks ... Finished