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):
- Geo.connected? is true
- 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
- Enable repository checks setting if it is disabled
- 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.)
- Enable repository checks setting if it is disabled
- Visit Admin Area > Monitoring > Background Jobs > Cron and click
Enqueue nowon the row forrepository_check_worker. - Repeat step 2, every hour or so, until
gitlab-rails runner "RepositoryCheck::BatchWorker.send(:project_ids).size"returns0