--- source_keys: - adr-0032-action-tiers - delivery-guard-flux-allowlist --- # Diagnose flow Find why a Flux object is failing, walking the dependency chain from source to Kustomization to HelmRelease. Read tier only; every command here is in the `SKILL.md` tier table. ## 1 — Find the object - Given a Flux object (source, Kustomization, HelmRelease) → start from it. - Given a workload or other Kubernetes object → `flux trace -n ` names the Kustomization or HelmRelease that owns it and the source revision; start from that owner. Not Flux-managed → say so and stop. - Given only a symptom ("Flux is stuck") → `flux get all -A --status-selector ready=false`; take every failing object as a candidate. ## 2 — Rule out the controllers Run `flux stats -A`. When most objects are failing, or nothing has reconciled for longer than its interval, run `flux check`. A controller reported not ready ends the walk: the finding is the controller, handed off as a workload in `flux-system`. If `flux check` itself returns `forbidden`, report controller health as unknown and continue. ## 3 — Walk upstream first The chain is: source (`GitRepository`, `OCIRepository`, `HelmRepository`, `HelmChart`, `Bucket`) → `Kustomization` → `HelmRelease`, plus every `dependsOn` edge. Downstream objects fail as a symptom of an upstream one (`ArtifactFailed`, `DependencyNotReady`), so diagnose the most upstream failing object and treat the rest as consequences. For each object on the path, read in this order and stop once the cause is clear: 1. `flux get -n ` — Ready, revision and message. 2. `flux events --for / -n --types warning`. 3. `flux logs --kind --name -n --level error --since 1h`. A `HelmRelease`'s upstream is its chart: the `HelmChart` (from a `HelmRepository`) or the `OCIRepository` named in `spec.chartRef`. ## 4 — Read the reason | Kind | Ready reason or message | Meaning | Next | |---|---|---|---| | source | authentication or `secretRef` error | credentials rejected or missing | name the `secretRef` only, never read it; human fixes the Secret | | source | fetch, clone or timeout error | remote unreachable or ref missing | check the ref exists in the repo; report | | Kustomization | `ArtifactFailed` | source artifact unavailable | walk to the source | | Kustomization | `DependencyNotReady` | a `dependsOn` object is not Ready | walk to that object | | Kustomization | `BuildFailed` | kustomize build failed on the repo content | repo fix by PR; reproduce offline with `flux build kustomization --path --kustomization-file --dry-run` | | Kustomization | `ReconciliationFailed` | apply rejected: schema, immutable field, missing CRD or namespace, decryption | repo fix by PR, or a human for an immutable field | | Kustomization | `HealthCheckFailed` | applied, but a workload never became ready | hand the named workload to `k8s-diagnose` | | Kustomization | `PruneFailed` | garbage collection was refused | report the object named in the message | | HelmRelease | `ArtifactFailed`, chart not ready | chart unavailable | walk to the chart source | | HelmRelease | `InstallFailed`, `UpgradeFailed` | Helm action failed or timed out waiting | read the message; workload not ready → `k8s-diagnose` | | HelmRelease | `TestFailed` | a Helm test pod failed | hand the test pod to `k8s-diagnose` | | HelmRelease | `RollbackSucceeded` and others after remediation | the upgrade failed and was undone | report the original failure from events | | HelmRelease | Stalled, retries exhausted | the controller stopped retrying | a fixing commit or a human odd job resumes it | A message this table does not cover: quote its first line and the events that match it, and say the cause is unclassified. Do not guess. ## 5 — Return Output format: ```text Root cause: / — : | Step | Kind | Namespace/Name | Ready | Reason | Finding | Next: () | k8s-diagnose on / ``` One row per object walked, upstream first. `Next` names one action and its tier from the `SKILL.md` table: a repo change is Apply-by-merge, `flux reconcile` is an odd job for a human, and a workload fault routes to `k8s-diagnose`. Never paste Secret data, Helm values or full log text; quote one line.