Repository Checks don't run if Geo is not enabled

From a Slack conversation:

https://gitlab.com/gitlab-org/gitlab/-/blob/master/ee/lib/gitlab/geo/cron_manager.rb runs every minute. in my case locally (and I'm assuming in Omnibus):

  1. Geo.connected? is true
  2. both Geo.primary? and Geo.secondary? are false

this means we disable GEO_JOBS: https://gitlab.com/gitlab-org/gitlab/-/blob/106972a833c7dc5559f09d4632dc6c1f79740572/ee/lib/gitlab/geo/cron_manager.rb#L42

this includes repository_check_worker: https://gitlab.com/gitlab-org/gitlab/-/blob/106972a833c7dc5559f09d4632dc6c1f79740572/ee/lib/gitlab/geo/cron_manager.rb#L9

Therefore, this feature is only available when Geo is enabled. But the feature is not specific to Geo.

https://docs.gitlab.com/ee/administration/repository_checks.html#enable-periodic-checks

Workaround 1

  1. Enable repository checks setting if it is disabled
  2. On a machine running Puma or Sidekiq, manually create a cron job to run the following command every hour: gitlab-rails runner "RepositoryCheck::DispatchWorker.perform_async".

Workaround 2

(If you don't have very many projects, you can trigger the job from the UI.)

  1. Enable repository checks setting if it is disabled
  2. Visit Admin Area > Monitoring > Background Jobs > Cron and click Enqueue now on the row for repository_check_worker.
  3. Repeat step 2, every hour or so, until gitlab-rails runner "RepositoryCheck::BatchWorker.send(:project_ids).size" returns 0
Edited by Michael Kozono