Mirror Updates Silently Failing
Symptoms
Section titled “Symptoms”If logs suggest that a mirror was started but a success or failure log isn’t present, it’s possible that the job is silently failing.
Synchronously Retry to Expose the Error
Section titled “Synchronously Retry to Expose the Error”Retrying the mirror update synchronously in the Rails console might expose the error.
This first checks that an existing job is not running, and marks it as failed to safely execute the UpdateMirrorService
.
user = User.find(<user_id>) # user who created a pull mirrorproject = Project.find(<project_id>) # project with a pull mirror configuration
completed_jids = Gitlab::SidekiqStatus.completed_jids([project.import_state.jid])
if completed_jids.present? puts 'The job is not running.'
project.import_state.mark_as_failed('Manual failure through Rails console')
result = Projects::UpdateMirrorService.new(project, user).execute
puts result
resultelse puts 'The job is still running'end