no migrations returned by gitlab-rake gitlab:background_migrations:list

Summary

gitlab-rake gitlab:background_migrations:list does not return any migrations on my self-managed v18.7.1-ee instance.

It appears that the code to find database models to loop over (ActiveRecord::Tasks::DatabaseTasks.for_each(databases) do |database_name|) isn't generating a list to iterate over.

Steps to reproduce

Example Project

n/a. Administrative command.

What is the current bug behavior?

No migrations returned.

# sudo gitlab-rake gitlab:background_migrations:list

id | table_name | job_class_name | status
---|------------|----------------|-------

What is the expected correct behavior?

Table returned as documented.

Relevant logs and/or screenshots

Output of checks

Results of GitLab environment info

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

System information
System:		
Proxy:		no
Current User:	git
Using RVM:	no
Ruby Version:	3.2.8
Gem Version:	3.7.1
Bundler Version:2.7.1
Rake Version:	13.0.6
Redis Version:	7.2.11
Sidekiq Version:7.3.9
Go Version:	unknown

GitLab information
Version:	18.7.1-ee
Revision:	f7e162976dc
Directory:	/opt/gitlab/embedded/service/gitlab-rails
DB Adapter:	PostgreSQL
DB Version:	16.10
URL:		https://frontend.site
HTTP Clone URL:	https://frontend.site/some-group/some-project.git
SSH Clone URL:	git@frontend.site:some-group/some-project.git
Elasticsearch:	no
Geo:		no
Using LDAP:	no
Using Omniauth:	yes
Omniauth Providers: 

GitLab Shell
Version:	14.45.5
Repository storages:
- default: 	tcp://backend.site:8075
GitLab Shell path:		/opt/gitlab/embedded/service/gitlab-shell

Gitaly
- default Address: 	tcp://backend.site:8075
- default Version: 	18.7.1
- default Git Version: 	2.50.1

Results of GitLab application Check

commentary

Sidekiq is shut down while I investigate this; I want to preserve the state of the BBMs

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

Checking GitLab Shell ...

GitLab Shell: ... GitLab Shell version >= 14.45.5 ? ... OK (14.45.5)
Running /opt/gitlab/embedded/service/gitlab-shell/bin/gitlab-shell-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? ... no
  Try fixing it:
  sudo -u git -H RAILS_ENV=production bin/background_jobs start
  For more information see:
  doc/install/installation.md in section "Install Init Script"
  see log/sidekiq.log for possible errors
  Please fix the error above and rerun the checks.

Checking Sidekiq ... Finished

Checking Incoming Email ...

Incoming Email: ... Reply by email is disabled in config/gitlab.yml

Checking Incoming Email ... Finished

Checking LDAP ...

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

Checking LDAP ... Finished

Checking GitLab App ...

Database config exists? ... yes
Tables are truncated? ... skipped
All migrations up? ... yes
Database contains orphaned GroupMembers? ... no
GitLab config exists? ... yes
GitLab config up to date? ... yes
Cable config exists? ... yes
Resque config exists? ... 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
Systemd unit files or init script exist? ... skipped (omnibus-gitlab has neither init script nor systemd units)
Systemd unit files or init script up-to-date? ... skipped (omnibus-gitlab has neither init script nor systemd units)
Projects have namespace: ... 
4/3 ... yes
3/4 ... yes
6/5 ... yes
3/6 ... yes
3/7 ... yes
4/8 ... yes
4/9 ... yes
4/10 ... yes
4/11 ... yes
4/12 ... yes
4/13 ... yes
4/14 ... yes
4/15 ... yes
4/16 ... yes
4/17 ... yes
3/18 ... yes
6/19 ... yes
6/20 ... yes
4/21 ... yes
4/22 ... yes
4/24 ... yes
3/25 ... yes
3/26 ... yes
4/27 ... yes
4/28 ... yes
4/29 ... yes
4/30 ... yes
3/31 ... yes
4/32 ... yes
4/33 ... yes
4/34 ... yes
3/35 ... yes
4/36 ... yes
4/37 ... yes
4/38 ... yes
4/39 ... yes
4/40 ... yes
4/41 ... yes
4/42 ... yes
4/45 ... yes
2/47 ... yes
3/48 ... yes
3/49 ... yes
2/50 ... yes
2/51 ... yes
2/52 ... yes
2/53 ... yes
59/54 ... yes
59/55 ... yes
3/56 ... yes
59/57 ... yes
59/58 ... yes
Redis version >= 6.2.14? ... yes
Ruby version >= 3.0.6 ? ... yes (3.2.8)
Git user has default SSH configuration? ... yes
Active users: ... 3
Is authorized keys file accessible? ... yes
GitLab configured to store new projects in hashed storage? ... yes
All projects are in hashed storage? ... yes
Elasticsearch version 7.x-9.x or OpenSearch version 1.x-3.x ... skipped (advanced search is disabled)
All migrations must be finished before doing a major upgrade ... skipped (Advanced Search is disabled)

Checking GitLab App ... Finished


Checking GitLab subtasks ... Finished

Possible fixes

It appears that the code to find database models to loop over ActiveRecord::Tasks::DatabaseTasks.for_each(databases) do |database_name| isn't generating a list to iterate over.

Patch release information for backports

If the bug fix needs to be backported in a patch release to a version under the maintenance policy, please follow the steps on the patch release runbook for GitLab engineers.

Refer to the internal "Release Information" dashboard for information about the next patch release, including the targeted versions, expected release date, and current status.

High-severity bug remediation

To remediate high-severity issues requiring an internal release for single-tenant SaaS instances, refer to the internal release process for engineers.

Edited by Ben Prescott