12.2.9 -> 12.5.0 Database migration failed: Multiple indexes found
Summary
I followed the issue #33084 (closed) which handled the issue of multiple indexes found. As it is scheduled for the 12.5.0 release which came out a couple of days ago, I assumed that this issue would be fixed. Or does the fix come with a later release?
However I just performed the upgrade to 12.5.0 and I still get the multiple indexes found error.
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'
---- Begin output of "bash" "/tmp/chef-script20191126-34-1bg0n1r" ----
STDOUT: rake aborted!
StandardError: An error has occurred, all later migrations canceled:
Multiple indexes found on snippets columns [:project_id]. Specify an index name from index_snippets_on_project_id, snippets_project_id_idx
/opt/gitlab/embedded/service/gitlab-rails/lib/gitlab/database/migration_helpers.rb:119:in `block in remove_concurrent_index'
/opt/gitlab/embedded/service/gitlab-rails/lib/gitlab/database/migration_helpers.rb:241:in `disable_statement_timeout'
/opt/gitlab/embedded/service/gitlab-rails/lib/gitlab/database/migration_helpers.rb:118:in `remove_concurrent_index'
/opt/gitlab/embedded/service/gitlab-rails/db/migrate/20191014132931_remove_index_on_snippets_project_id.rb:11:in `up'
/opt/gitlab/embedded/service/gitlab-rails/lib/tasks/gitlab/db.rake:49:in `block (3 levels) in <top (required)>'
/opt/gitlab/embedded/bin/bundle:23:in `load'
/opt/gitlab/embedded/bin/bundle:23:in `<main>'
Caused by:
ArgumentError: Multiple indexes found on snippets columns [:project_id]. Specify an index name from index_snippets_on_project_id, snippets_project_id_idx
/opt/gitlab/embedded/service/gitlab-rails/lib/gitlab/database/migration_helpers.rb:119:in `block in remove_concurrent_index'
/opt/gitlab/embedded/service/gitlab-rails/lib/gitlab/database/migration_helpers.rb:241:in `disable_statement_timeout'
/opt/gitlab/embedded/service/gitlab-rails/lib/gitlab/database/migration_helpers.rb:118:in `remove_concurrent_index'
/opt/gitlab/embedded/service/gitlab-rails/db/migrate/20191014132931_remove_index_on_snippets_project_id.rb:11:in `up'
/opt/gitlab/embedded/service/gitlab-rails/lib/tasks/gitlab/db.rake:49: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 => db:migrate
(See full trace by running task with --trace)
== 20191014132931 RemoveIndexOnSnippetsProjectId: migrating ===================
-- transaction_open?()
-> 0.0000s
-- index_exists?(:snippets, [:project_id], {:algorithm=>:concurrently})
-> 0.0160s
-- execute("SET statement_timeout TO 0")
-> 0.0006s
-- remove_index(:snippets, {:algorithm=>:concurrently, :column=>[:project_id]})
-- execute("RESET ALL")
-> 0.0007s
STDERR:
---- End output of "bash" "/tmp/chef-script20191126-34-1bg0n1r" ----
Ran "bash" "/tmp/chef-script20191126-34-1bg0n1r" returned 1
Running handlers complete
Chef Client failed. 4 resources updated in 14 seconds
Steps to reproduce
Upgrade from 12.2.9 to 12.5.0
What is the current bug behavior?
The upgrade fails during migration.
What is the expected correct behavior?
The upgrade succeeds.
Relevant logs and/or screenshots
Update History
11.0.4 -> 11.9.1 (also migrated from Synology Docker Image to official Docker Image)
11.9.1 -> 11.10.0
11.10.0 -> 11.11.0
11.11.0 -> 11.11.8
11.11.8 -> 12.0.0
12.0.0 -> 12.0.2
12.0.2 -> 12.0.9
12.0.9 -> 12.1.0
12.1.0 -> 12.1.14
12.1.14 -> 12.2.0
12.2.0 -> 12.2.9
12.2.9 -> 12.3.0 (failed)
12.2.9 -> 12.3.5 (failed)
12.2.9 -> 12.5.0 (failed)