Skip to content

gitlab:db:decomposition:migrate task always complains about unfinished migrations that do not seem to exist

While preparing for database decomposition, following the documentation for scripted migration via gitlab-ctl pg-decomposition-migration, the rake task gitlab:db:decomposition:migrate always aborts with

Found 19 unfinished Background Migration(s). Please wait until they are finished.

[ERROR] Failed to execute: gitlab-rake gitlab:db:decomposition:migrate

but there are no background tasks pending when looking in the UI or in the database:

~ # gitlab-psql -c "SELECT job_class_name, table_name, column_name, job_arguments FROM batched_background_migrations WHERE status NOT IN(3, 6);"
 job_class_name | table_name | column_name | job_arguments 
----------------+------------+-------------+---------------
(0 rows)

This is happening on a running gitlab-ee 17.0.0 instance on Ubuntu 20.04.