Omnibus upgrade from 12.2.1 to 12.4.0 fails
I've tried to upgrade our EE instance from 12.2.1 to 12.4.0 via Apt, and it fails with this error:
There was an error running gitlab-ctl reconfigure:
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-script20191029-24289-19au5du" ----
STDOUT: rake aborted!
StandardError: An error has occurred, all later migrations canceled:
Multiple indexes found on ci_trigger_requests columns [:trigger_id]. Specify an index name from ci_trigger_requests_trigger_id_idx, fk_rails_b8ec8b7245, index_ci_trigger_requests_on_trigger_id
/opt/gitlab/embedded/service/gitlab-rails/lib/gitlab/database/migration_helpers.rb:121:in `block in remove_concurrent_index'
/opt/gitlab/embedded/service/gitlab-rails/lib/gitlab/database/migration_helpers.rb:252:in `disable_statement_timeout'
/opt/gitlab/embedded/service/gitlab-rails/lib/gitlab/database/migration_helpers.rb:120:in `remove_concurrent_index'
/opt/gitlab/embedded/service/gitlab-rails/db/migrate/20191016072826_replace_ci_trigger_requests_index.rb:13: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 ci_trigger_requests columns [:trigger_id]. Specify an index name from ci_trigger_requests_trigger_id_idx, fk_rails_b8ec8b7245, index_ci_trigger_requests_on_trigger_id
/opt/gitlab/embedded/service/gitlab-rails/lib/gitlab/database/migration_helpers.rb:121:in `block in remove_concurrent_index'
/opt/gitlab/embedded/service/gitlab-rails/lib/gitlab/database/migration_helpers.rb:252:in `disable_statement_timeout'
/opt/gitlab/embedded/service/gitlab-rails/lib/gitlab/database/migration_helpers.rb:120:in `remove_concurrent_index'
/opt/gitlab/embedded/service/gitlab-rails/db/migrate/20191016072826_replace_ci_trigger_requests_index.rb:13: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)
== 20191016072826 ReplaceCiTriggerRequestsIndex: migrating ====================
-- transaction_open?()
-> 0.0000s
-- index_exists?(:ci_trigger_requests, [:trigger_id, :id], {:order=>{:id=>:desc}, :algorithm=>:concurrently})
-> 0.0047s
-- transaction_open?()
-> 0.0000s
-- select_one("SELECT current_setting('server_version_num') AS v")
-> 0.0003s
-- index_exists?(:ci_trigger_requests, [:trigger_id], {:algorithm=>:concurrently})
-> 0.0028s
-- execute("SET statement_timeout TO 0")
-> 0.0001s
-- remove_index(:ci_trigger_requests, {:algorithm=>:concurrently, :column=>[:trigger_id]})
-- execute("RESET ALL")
-> 0.0001s
STDERR:
---- End output of "bash" "/tmp/chef-script20191029-24289-19au5du" ----
Ran "bash" "/tmp/chef-script20191029-24289-19au5du" returned 1