2026-10-25: flux2 upgrade to 2.19.1 failed with "context canceled" while helm-controller replaced itself¶
Kind: reference (incident report)
Severity: warning · Status: resolved · Resolved by: operator agent (no action needed; helm-controller retried on its own) · Duration: ~0:00:19 from detection to resolution, 13:36:24–13:36:43 UTC · Taskbase task: #1617
Summary¶
Merging the Flux upgrade from chart flux2 2.18.2 to 2.19.1 (Flux 2.8.3 → 2.9.5, #756, task #1583) made helm-controller upgrade the release that runs helm-controller. The upgrade replaced helm-controller's own Deployment. The old pod was stopped while it was still applying the release, so Helm revision 4 failed with context canceled, and the error event became task #1617. The new helm-controller pod took the leader lease 15 s later, upgraded again and deployed revision 5 on chart 2.19.1. No rollback ran, and the operator changed nothing on the cluster.
Impact¶
- Services: HelmRelease
flux-system/flux2was not Ready from 13:36:24 to 13:36:40. Helm reconciliation onhetzner-mgmtpaused for about 15 s while no helm-controller held the leader lease. Every Kustomization and every other HelmRelease stayed Ready. - Users: none noticed.
- Data: none. The Flux CRDs kept their
storedVersions. All 14 areEstablished. - Duration: from the failed revision 4 (13:36:24) to the deployed revision 5 (13:36:40, in sync at 13:36:43).
Timeline¶
All times UTC, 2026-10-25.
| Time | Event | Source |
|---|---|---|
| 13:34:15 | #756 (chore(deps): update helm release flux2 to v2.19.1) merged to main |
merge commit 76a535c |
| 13:36:10 | helm-controller (v1.5.3, pod helm-controller-5d6f5c7df5-zsxj8) starts the upgrade to flux2@2.19.1 |
Helm log in the task |
| 13:36:11 | Revision 4 (flux2-2.19.1) created |
helm history flux2 |
| 13:36:13 | "checking resources for changes" (37 resources) | Helm log in the task |
| 13:36:15 | New ReplicaSet helm-controller-6444fb5679 (v1.6.4) and pod helm-controller-6444fb5679-n92lv created |
events in flux-system |
| 13:36:24 | Old pod helm-controller-5d6f5c7df5-zsxj8 killed ("Stopping container manager"). The same second: "warning: upgrade failed", revision 4 failed: context canceled |
events, helm history flux2 |
| 13:36:24 | Detected: UpgradeFailed event sent to Taskbase, task #1617 created at 13:36:25 |
Flux Alert taskbase-platform, task |
| 13:36:39 | New pod becomes leader. It reads revision 4 as "release not observed to be made for object" and runs upgrade again |
lease helm-controller-leader-election, helm-controller log |
| 13:36:40 | Revision 5 (flux2-2.19.1, Flux 2.9.5) deployed |
helm history flux2 |
| 13:36:43 | Resolved: "release in-sync with desired state", Ready=True UpgradeSucceeded |
helm-controller log, HelmRelease status |
| 13:58–14:05 | Operator run for #1617: read-only checks only (below) | this report |
Root cause¶
The flux2 HelmRelease (components/flux/base/helmrelease.yaml) installs Flux's own controllers, so helm-controller applies every upgrade of it to itself (Flux: safe change workflow). Chart 2.19.1 changes the helm-controller image (v1.5.3 → v1.6.4), so Helm updates the helm-controller Deployment during the upgrade. Kubernetes starts the new pod and then stops the old one. The old pod is the process running the Helm upgrade. When it stops, its context is canceled and the remaining Helm steps abort with context canceled. Helm marks the revision failed.
The old controller can't run its upgrade.remediation rollback because it has already stopped. The new controller doesn't see the failed revision as one it made ("release not observed to be made for object"). So it upgrades again, and nothing is being replaced this time, so that attempt succeeds. The same thing happened on 2026-07-02: revision 2 (flux2-2.18.2) failed with context canceled, and revision 3 succeeded 32 s later (helm history flux2). The upgrade evidence on #756 had named this as the self-upgrade hazard.
So any flux2 upgrade that changes the helm-controller Deployment can raise this event. It is not a fault in chart 2.19.1.
What the agent did¶
Only read-only commands. No write to the cluster, no suspend, no rollback, no silence. The ops runbook's triage order was followed, and the generic Flux freeze section was not needed: the release was already deployed and nothing was frozen.
flux get helmreleases -A—flux2Ready: "Helm upgrade succeeded for release flux-system/flux2.v5 with chart flux2@2.19.1". Every other HelmRelease was Ready too.helm -n flux-system history flux2 --max 10— revision 4failed("context canceled"), revision 5deployed,flux2-2.19.1, app 2.9.5. Revision 2 on 2026-07-02 shows the same failure.flux get kustomizations -A --status-selector ready=falseandflux get helmreleases -A --status-selector ready=false— nothing listed. All 66 Kustomizations are Ready.flux-systemhas appliedmain@sha1:c9a50147, which is the tip ofmain.kubectl -n flux-system get hr flux2 -o jsonpath=…—Ready=True UpgradeSucceeded,Released=True, history has one entry (version 5, deployed 13:36:40).kubectl -n flux-system get events(HelmReleaseflux2and helm-controller objects) — the timeline above: new ReplicaSet at 13:36:15, old pod killed at 13:36:24, leader election at 13:36:39.kubectl -n flux-system logs deploy/helm-controller --since=40m— the new pod's "release not observed to be made for object", then "running 'upgrade' action", then "release in-sync with desired state".kubectl -n flux-system get pods,flux version— six controllers Running with 0 restarts. The distribution isflux-2.9.5(helm-controller v1.6.4, kustomize-controller v1.9.5, source-controller v1.9.5, notification-controller v1.9.4, image-* v1.2.5).flux checkand theEstablishedcondition andstoredVersionsof the 14*.toolkit.fluxcd.ioCRDs — "all checks passed". All areEstablished. The stored versions are the same as in the #756 pre-flight (v1,v2for HelmRelease,v1beta3for Alert and Provider).- Rollback or forward: the release is already deployed on 2.19.1, the version in Git, so Git matches the cluster. A Helm rollback to revision 3 (
flux2-2.18.2) would still be valid (pre-flight on #756: rollback goes both ways). It isn't needed, though, and it would replace helm-controller again in the same way. So the decision is to keep the upgrade as it is. - This report, and a note in Flux: safe change workflow on how to tell this transient failure from a stuck one.
Resolution and verification¶
At 14:05 UTC, about 29 minutes after revision 5 deployed:
helm -n flux-system history flux2: revision 5deployed,flux2-2.19.1.flux get helmreleases -A --status-selector ready=falseandflux get kustomizations -A --status-selector ready=false: empty.flux check: all checks passed. The Flux controllers have run 2.9.5 since 13:36 with 0 restarts.
The post-merge checks in #756's review expected revision 4. Because of the retry, the release is at revision 5. Everything else on that list holds.
Follow-ups¶
-
1621: add a section to the ops runbook on the
flux2self-upgradecontext canceledfailure, covering what to check and when it needs action (technical-writer).¶
References¶
- Alert: Flux
UpgradeFailederror event via Alerttaskbase-platform(no Alertmanager alert) - Taskbase task: #1617, a follow-up of #1583
- Pull requests: #756 (the upgrade and its upgrade evidence), and this report's pull request
- Runbook sections: Triage order, Generic Flux freeze (checked, not needed)
Open questions¶
- Every
flux2upgrade that changes helm-controller is likely to raise this event and a post-merge failure task, even though it heals within a minute. That happened twice out of two times (2026-07-02 and 2026-10-25). Should the Flux Alert, or Taskbase, wait to see whether the release recovers before opening a task? That is a change to failure reporting, and it is left to the owner. - Why didn't Kubernetes keep the old pod until the new one was Ready? The Deployment rolls out with
maxSurge: 25%/maxUnavailable: 25%andterminationGracePeriodSeconds: 600, and the events show "Killing" and the new pod's first failed readiness probe in the same second. The record doesn't settle whether the pod could have finished the Helm upgrade during graceful shutdown.