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.
KubeJobFailedfired from 08:30:33, and it was resolved at 08:37:39 when Alertmanager had noKubeJobFailedalert 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.
kubectl -n monitoring port-forward svc/alertmanager-operated 9093andcurl -sG .../api/v2/alerts --data-urlencode 'filter=alertname="KubeJobFailed"': one alert,active, forgitea/github-push-mirror-29881935, not silenced or inhibited./api/v2/silenceshad no active silence.kubectl -n gitea get cronjob,jobandget pods: the Job isFailed 0/1, the 08:30 rungithub-push-mirror-29881950isComplete 1/1, andgitea-preupgradeandgitea-smokeare complete.kubectl -n gitea logs github-push-mirror-29881935-cv2mh: the firstGET /push_mirrorsfailed withURLError: <urlopen error [Errno 1] Operation not permitted>.get job -o jsonpath='{.status}'returnedBackoffLimitExceededat 08:15:07, and the owner isCronJob/github-push-mirror.helm -n gitea history gitea,kubectl -n gitea get events, and thegitea-preupgradeJob'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.kubectl -n gitea get cronjob github-push-mirror -o jsonpath='{.status}':lastSuccessfulTime08:30:06, which is newer than the failure, so the runbook allows deleting the Job.flux get kustomizations -A --status-selector ready=falseand the same for HelmReleases showed nothing not Ready.kubectl -n gitea get networkpolicy,ciliumnetworkpolicyshowed only thegitea-postgresqlpolicy.- Write:
kubectl -n gitea delete job github-push-mirror-29881935cleared the alert, because Flux does not recreate a CronJob's Jobs and the cause had passed. Exit 0, and the Job and itsErrorpod are gone. The Job held no data. - Polled Prometheus (
kube_job_failed{namespace="gitea",job_name="github-push-mirror-29881935"} > 0) and Alertmanager (/api/v2/status200): no series and noKubeJobFailedalert at 08:37:39. - 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 noGiteaPushMirrorFailingalert. - Prometheus:
kube_job_failed{namespace="gitea",job_name="github-push-mirror-29881935"} > 0returns no series. flux get kustomizations -A --status-selector ready=falseandflux get helmreleases -A --status-selector ready=falselist nothing.helm -n gitea history gitea: revision 5 isdeployed, chartgitea-12.7.0.deployment/giteais 1/1 Ready ongitea: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¶
- Alert:
KubeJobFailed,gitea/github-push-mirror-29881935on hetzner-mgmt; runbook - Taskbase incident task: #1590 (the upgrade: #1576)
- Runs: the
operatorrun of #1590 on 2026-10-25 - Pull requests: #748 (the Gitea upgrade), this report's pull request
- Runbook sections:
KubeJobFailedfor a Job that Flux applies: CronJob-created Jobs
Open questions¶
- Is
EPERM(rather thanECONNREFUSED) 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.