Skip to content

2026-11-20: GitHub push mirror run gave up 10 s before the Gitea backup gate brought Gitea back

Kind: reference (incident report)

Severity: warning · Status: resolved · Resolved by: operator agent · Duration: 1:20 from detection to resolution, 22:25:33–23:45:11 UTC (fault from 22:10:06) · Taskbase task: #3533

Summary

The drained merge of #1640 (amazon/aws-cli 2.41.2 → 2.42.0) recreated the gitea-preupgrade Job, which scaled Gitea to 0 for 11 min 24 s. The push mirror CronJob's 22:00 run, gitea/github-push-mirror-29920200, waited for Gitea for its full 600 s and failed at 22:10:03. Gitea was Ready again at 22:10:13. Later runs succeeded, but the failed Job stayed, so KubeJobFailed fired until the operator deleted it. The reconciler's wait is raised to 840 s in this report's pull request.

Impact

  • Services: one run of the push mirror reconciler (components/gitea/push-mirror) failed. The GitHub push mirror itself stayed healthy: the 23:30 run reported its last update at 23:05:41. Gitea was down 21:58:49–22:10:13 by design of the backup gate, in a drained merge run (task #3530), not because of this incident.
  • Users: none noticed; the alert is a warning.
  • Data: none.
  • Duration: the Job failed at 22:10:06. KubeJobFailed fired from 22:25:33 until 23:45:11, when neither Prometheus nor Alertmanager had it left.

Timeline

All times UTC, 2026-11-20.

Time Event Source
21:54:29 #1640 merged to main by ops-agent in the drain merge run of task #3530 merged_at of #1640, merge commit bc8de0a2
21:58:42 gitea-preupgrade Job starts Job status.startTime
21:58:48 Gate logs Backing up Gitea 28.3.0 … before 28.3.0 and deployment.apps/gitea scaled (to 0) gate container log
22:00:01 Push mirror run github-push-mirror-29920200 starts, logs Gitea unreachable ([Errno 111] Connection refused), retrying for 599s pod log, container startedAt
22:09:22 gitea-preupgrade-dump pod succeeded gate container log
22:09:23 New Gitea pod gitea-668d986489-96p7f created pod creationTimestamp
22:10:03 Push mirror run's wait ends: URLError: <urlopen error [Errno 111] Connection refused> pod log, container finishedAt
22:10:06 Job Failed: BackoffLimitExceeded (backoffLimit: 0) Job status.conditions
22:10:13 Gitea pod Ready pod Ready condition
22:24:53 gitea-preupgrade Job completes Job status.completionTime
22:25:33 Detected: KubeJobFailed (job_name=github-push-mirror-29920200, fingerprint d05bb154ad6a149e) starts firing Alertmanager
23:30:05 A later push mirror run succeeds: push mirror … is healthy CronJob lastSuccessfulTime, pod log
23:44:26 Operator deletes the failed Job kubectl delete job
23:45:11 Resolved: kube_job_failed{namespace="gitea"} > 0 returns no series, and Alertmanager has no KubeJobFailed alert for gitea Prometheus and Alertmanager API

Root cause

The Gitea backup gate scales deployment/gitea to 0 while it dumps. A tool-image bump in its Job's pod template recreates the Job and runs a full gate, though nothing is upgraded (2026-11-18 report; the gate log says 28.3.0-to-28.3.0). This stop lasted 11 min 24 s: the dump took 10.5 min, and the new pod needed 50 s to become Ready.

After incident 2026-10-25, the push mirror reconciler waits up to GITEA_WAIT_SECONDS for Gitea to accept connections. The default of 600 s (components/gitea/push-mirror/reconcile-push-mirror.py) was set when the observed stop was about 6 minutes. The stops of 2026-11-18 took about 10.5 minutes, and this one 11 min 24 s. The 22:00 run started 1 min 12 s into the stop, so it needed 10 min 12 s and had 10 min. The CronJob keeps failed Jobs (failedJobsHistoryLimit: 3, ttlSecondsAfterFinished: 86400), so the alert would have fired for up to 24 hours.

The stop will come back on every Gitea upgrade, on a gitea-rollback and, until decision #3453 is carried out, on every tool-image bump of the gate.

What the agent did

The agent followed the ops runbook section KubeJobFailed for a Job that Flux applies, case CronJob-created Jobs, the one-off window branch.

  1. kubectl --context admin@mgmt-cluster get --raw "$AM/api/v2/alerts" through the Alertmanager Service proxy: KubeJobFailed for gitea/github-push-mirror-29920200, cluster=hetzner-mgmt, active, not silenced. /api/v2/silences had no active silence.
  2. kubectl --context admin@mgmt-cluster -n gitea get cronjob,job and get pods: the Job is Failed 0/1, and the 23:30 run github-push-mirror-29920290 is Complete 1/1. describe job showed BackoffLimitExceeded. logs github-push-mirror-29920200-krtt2: Gitea unreachable ([Errno 111] Connection refused) every 5 s from 22:00:01 for 600 s, then URLError.
  3. git log, kubectl … -n gitea get jobs and the gitea-preupgrade-mspbh gate container log: #1640 merged at 21:54:29, and the gate scaled Gitea to 0 at 21:58:48. The Gitea pod's creation and Ready times put Gitea back at 22:10:13. The stop is over.
  4. gitea pull_status of #1640: merged by ops-agent, label drain-before-merge, so the merge was a drained merge run.
  5. get cronjob github-push-mirror: lastSuccessfulTime 23:30:05, later than the failure at 22:10:06, so the runbook allows deleting the Job.
  6. Write: kubectl --context admin@mgmt-cluster -n gitea delete job github-push-mirror-29920200 at 23:44:26, to clear the alert. Flux does not recreate a CronJob's Jobs, and the cause had passed. Exit 0, and the Job and its Error pod are gone. The Job held no data.
  7. Polled Prometheus (kube_job_failed{namespace="gitea"} > 0) and Alertmanager through the Service proxy. At 23:45:11 there was no series and no alert. count by (nodename) (node_uname_info) answered worker-1 control-plane-1 worker-2 worker-3, and every alert had cluster=hetzner-mgmt, so the answers came from hetzner-mgmt.
  8. flux --context admin@mgmt-cluster get kustomizations -A --status-selector ready=false: harbor and harbor-postupgrade were waiting on harbor-preupgrade, whose gate from the same merge completed at 23:45:23. At 23:46:03 every Kustomization was Ready. No HelmRelease was not Ready, and helm history gitea shows revision 12 deployed.
  9. This report's pull request raises the default of GITEA_WAIT_SECONDS from 600 to 840 s and updates the GiteaPushMirrorFailing runbook and the push mirror section of the Flux docs. The component's unit tests pass (12 tests).

No Kustomization or HelmRelease was suspended or reconciled, and no silence was set.

Resolution and verification

The failed Job was deleted. Prometheus had no kube_job_failed series in gitea, and Alertmanager had no KubeJobFailed alert for it at 23:45:11. The CronJob's 23:45 run succeeded (lastSuccessfulTime 23:45:05).

The lasting fix is the longer wait. 840 s covers every stop seen so far (11 min 24 s at most), wherever in it a run starts, and still ends before the next 15-minute schedule. The test is the next gate run that covers a quarter hour. GiteaPushMirrorFailing (no success for 50 min) is unaffected, because a run that waits longer still ends long before 50 minutes.

Follow-ups

  • 3453 (owner's decision) and #3454 (operator): stop tool-image bumps from running a full Gitea gate. That would remove most of these stops; the longer wait still covers real upgrades and gitea-rollback.

References

Open questions

  • The harbor-preupgrade gate from the same merge ran for 1 h 47 min (21:58:42–23:45:23) and passed. This run did not look into why it took so long; the 2026-11-19 report records a 68-minute run.