Skip to content

2026-10-25: GitHub push mirror run failed while the Gitea backup gate had Gitea stopped

Kind: reference (incident report)

Severity: warning · Status: resolved · Resolved by: operator agent · Duration: ~0:07 from detection to resolution, 08:30–08:37 UTC (fault from 08:15 UTC) · Taskbase task: #1590

Summary

The Gitea upgrade from 1.25.5 to 1.27.3 (#748) ran the gitea-preupgrade backup gate, which scales Gitea to 0 while it dumps the database. The push mirror CronJob's 08:15 run, gitea/github-push-mirror-29881935, started inside that window. Its first call to Gitea failed, and the Job failed. The next run at 08:30 succeeded, but the failed Job stayed, so KubeJobFailed fired until the operator deleted the Job.

Impact

  • Services: one run of the push mirror reconciler (components/gitea/push-mirror) failed. Gitea was down from 08:13:35 to 08:19:16 by design of the backup gate, not because of this incident. The GitHub push mirror itself was healthy: the 08:30 run reports its last update at 08:21:00.
  • Users: none noticed; the alert is a warning.
  • Data: none.
  • Duration: the Job failed at 08:15:07. KubeJobFailed fired from 08:30:33, and it was resolved at 08:37:39 when Alertmanager had no KubeJobFailed alert left.

Timeline

All times UTC, 2026-10-25.

Time Event Source
08:09 #748 (chore(deps): update gitea) merged to main merge commit 2be919c
08:13:29 gitea-preupgrade Job starts Job status.startTime
08:13:35 Gitea pod gitea-84b5d4644d-4t9b7 stopped (scaled to 0 by the gate) events in gitea
08:15:00 CronJob creates github-push-mirror-29881935 events in gitea
08:15:07 Job fails: BackoffLimitExceeded (backoffLimit: 0) after URLError: <urlopen error [Errno 1] Operation not permitted> pod log, Job status.conditions
08:19:16 Gitea scaled back from 0 to 1 by the gate events in gitea
08:25:31 gitea-preupgrade Job completes Job status.completionTime
08:26:04 Helm upgrade to chart 12.7.0 (Gitea 1.27.3) deployed, revision 5 helm history gitea
08:30:06 Next push mirror run succeeds: "push mirror … is healthy" CronJob lastSuccessfulTime, pod log
08:30:33 Detected: KubeJobFailed (job_name=github-push-mirror-29881935, fingerprint ba6fb7bd1ae9f725) starts firing Alertmanager
08:31:34 Taskbase incident #1590 created Taskbase
08:37 Operator deletes the failed Job (exact second not recorded; before the 08:37:39 check) kubectl delete job
08:37:39 Resolved: kube_job_failed for the Job returns no series, and Alertmanager has no KubeJobFailed alert Prometheus and Alertmanager API

Root cause

The Gitea backup gate (components/gitea/backup/scripts/preupgrade.sh) stops writes by scaling deployment/gitea to 0 while it dumps the database, because Gitea before 1.26 has no maintenance mode. The push mirror reconciler (components/gitea/push-mirror/reconcile-push-mirror.py) runs every 15 minutes with backoffLimit: 0 and calls http://gitea-http.gitea.svc:3000 without retrying. A run that falls inside the gate's stop window finds no backend for the Service. Its connect() is refused with EPERM, and the Job fails on the first try. No NetworkPolicy or CiliumNetworkPolicy selects the Gitea pods, and the same call succeeded at 08:30, so a policy denial is ruled out.

The CronJob keeps up to three failed Jobs (failedJobsHistoryLimit: 3, ttlSecondsAfterFinished: 86400), and a later success does not remove them. Left alone, KubeJobFailed would have fired for up to 24 hours. The stop window will happen again on every Gitea upgrade and on a gitea-rollback, so any of them that covers a quarter hour can raise this alert again (#1591).

What the agent did

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

  1. kubectl -n monitoring port-forward svc/alertmanager-operated 9093 and curl -sG .../api/v2/alerts --data-urlencode 'filter=alertname="KubeJobFailed"': one alert, active, for gitea/github-push-mirror-29881935, not silenced or inhibited. /api/v2/silences had no active silence.
  2. kubectl -n gitea get cronjob,job and get pods: the Job is Failed 0/1, the 08:30 run github-push-mirror-29881950 is Complete 1/1, and gitea-preupgrade and gitea-smoke are complete.
  3. kubectl -n gitea logs github-push-mirror-29881935-cv2mh: the first GET /push_mirrors failed with URLError: <urlopen error [Errno 1] Operation not permitted>. get job -o jsonpath='{.status}' returned BackoffLimitExceeded at 08:15:07, and the owner is CronJob/github-push-mirror.
  4. helm -n gitea history gitea, kubectl -n gitea get events, and the gitea-preupgrade Job's start and completion times: Gitea was scaled to 0 from 08:13:35 to 08:19:16, and the Helm upgrade was deployed at 08:26:04. That is the cause, and it is already over.
  5. kubectl -n gitea get cronjob github-push-mirror -o jsonpath='{.status}': lastSuccessfulTime 08:30:06, which is newer than the failure, so the runbook allows deleting the Job. flux get kustomizations -A --status-selector ready=false and the same for HelmReleases showed nothing not Ready. kubectl -n gitea get networkpolicy,ciliumnetworkpolicy showed only the gitea-postgresql policy.
  6. Write: kubectl -n gitea delete job github-push-mirror-29881935 cleared the alert, because 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",job_name="github-push-mirror-29881935"} > 0) and Alertmanager (/api/v2/status 200): no series and no KubeJobFailed alert at 08:37:39.
  8. Created follow-ups #1591 and #1592, and opened this report's pull request.

No Git change was needed to fix the cause, and no Kustomization or HelmRelease was suspended or reconciled.

Resolution and verification

  • Alertmanager: /api/v2/alerts?filter=alertname="KubeJobFailed" returns [], and there is no GiteaPushMirrorFailing alert.
  • Prometheus: kube_job_failed{namespace="gitea",job_name="github-push-mirror-29881935"} > 0 returns no series.
  • flux get kustomizations -A --status-selector ready=false and flux get helmreleases -A --status-selector ready=false list nothing.
  • helm -n gitea history gitea: revision 5 is deployed, chart gitea-12.7.0. deployment/gitea is 1/1 Ready on gitea:1.27.3-rootless.

Follow-ups

  • 1591: keep the push mirror CronJob from failing while the backup gate or the rollback Job has

    Gitea stopped. Two ways are proposed: retry the first API call, or suspend the CronJob for the window. A persistent failure must still fail the run.
  • 1592: add this case to the ops runbook's CronJob-created Jobs: a one-off cause that is already

    over, with a later run that succeeded, needs no Git fix before the Job is deleted.

References

Open questions

  • Is EPERM (rather than ECONNREFUSED) what Cilium's socket load balancer returns for a Service with no backends? The record shows the Service had no running pod at 08:15 and no policy selects Gitea, but it does not show the Cilium datapath decision itself.