Skip to content

2026-10-20: Dashboard deployer Job fails, Grafana rejects the admin password

Kind: reference (incident report)

Severity: warning · Status: resolved · Resolved by: the owner with Claude Code (password reset), then the operator agent (Job replaced) · Duration: 74:34 from detection to resolution, 2026-10-21 19:26 – 2026-10-24 22:00 UTC (Job failed 12:16 UTC on 2026-10-20) · Taskbase task: #1543

Summary

On 2026-10-20 a Renovate bump of the curl image (a1407eb) changed the monitoring/dashboard-deployer Job, so Flux recreated it. The Job uploads the Cluster overview dashboard through Grafana's API as admin. Grafana returns 401 Invalid username or password for the password in the Helm-generated Secret monitoring-kube-prometheus-stack-grafana, so the Job failed. KubeJobFailed has fired since 2026-10-21. Grafana itself is up. The fix was a credential change, so a person made it. On 2026-10-24 the owner reset Grafana's admin password to the Secret's value (decision #1554, option 1). The operator then replaced the failed Job. The new Job completed, and the alert resolved at 22:00 UTC.

Impact

  • Services: Grafana is up (/api/health 200). Only the Job that publishes cluster-overview.json fails, so any dashboard change merged after it last succeeded has not reached Grafana. The dashboard sidecar's /api/admin/provisioning/dashboards/reload call uses the same admin password. Grafana's file provisioner also rescans the dashboard folder on its own, so sidecar dashboards still load.
  • Users: none reported.
  • Data: none lost. Until 2026-10-24 21:33 UTC the admin password stored in Grafana's database (on grafana-pv) and the one in the Secret did not match. The owner backed up grafana.db before the reset.
  • Duration: 74:34 from detection (19:26 UTC on 2026-10-21) to resolution (22:00 UTC on 2026-10-24). The Job had failed earlier, at 12:16 UTC on 2026-10-20.

Timeline

All times UTC.

Time Event Source
2026-10-17 00:00 helm-controller last writes the Secret monitoring-kube-prometheus-stack-grafana. Whether the password changed is not recorded Secret managedFields
2026-10-18 21:15 #1189 stops Flux blanking GF_ADMIN_PASSWORD in the Job (a8d7a49) Git
2026-10-20 12:02 Renovate bumps curlimages/curl 8.7.1 → 8.23.0 in the Job (a1407eb) Git
2026-10-20 12:13 Flux recreates the Job (kustomize.toolkit.fluxcd.io/force: enabled) Job creationTimestamp
2026-10-20 12:16 Job Failed, BackoffLimitExceeded Job status
2026-10-21 19:26 Detected: KubeJobFailed (job_name=dashboard-deployer) starts firing Alertmanager, fingerprint aaef2a0787ae7d30
2026-10-24 15:06 Taskbase raises incident #1543 Taskbase
2026-10-24 15:20 operator confirms the alert is active and not silenced Alertmanager API
2026-10-24 ~15:25 operator shows GET /api/user as admin returns 401 with the Secret's password; stops for a person Run log
2026-10-24 16:19 The report's pull request #709 merges, so Taskbase closes #1543 although the alert still fires Git, Taskbase
2026-10-24 19:11 Taskbase reopens #1543 because the alert still fires; decision #1554 goes to the owner Taskbase
2026-10-24 ~21:33 Owner backs up grafana.db and resets the admin password from the Secret with grafana cli; GET /api/user → 200 #1554
2026-10-24 21:53–22:00 operator waits for a Flux rollout (de0900f, then e6ab094) to settle; nothing is left not ready flux get kustomizations
2026-10-24 22:00 operator confirms GET /api/user → 200, deletes the failed Job and reconciles prometheus-stack Run log
2026-10-24 22:00 New Job created at 22:00:18 and Complete at 22:00:28; Grafana returns "status":"success" for cluster-overview Job status and log
2026-10-24 22:00 Resolved: kube_job_failed for the Job is gone, and Alertmanager has no KubeJobFailed alert Prometheus and Alertmanager API

Root cause

components/prometheus-stack/helmrelease.yaml sets grafana.adminPassword: "", so the Grafana chart generates the password and stores it in the Secret. Grafana writes the admin password into its database only on first start; later changes to the Secret do not reach it. The Job (components/prometheus-stack/dashboard-deployer.yaml) calls curl -sf -u "admin:$GF_ADMIN_PASSWORD" -X POST .../api/dashboards/db. On a 401 that call exits 22, the container restarts with restartPolicy: OnFailure until backoffLimit: 5, and the Job ends Failed.

The curl bump only triggered the failure, by recreating the Job. The mismatch is in the credential. Removing the failed Job, as the alert text suggests, would make Flux recreate it, and it would fail again the same way.

What the agent did

First run (2026-10-24, ~15:20)

The operator agent ran only read-only commands. It made no write to the cluster and set no silence. The checks followed the KubeJobFailed runbook.

  1. kubectl -n monitoring port-forward svc/alertmanager-operated 19093:9093, then curl -sG .../api/v2/alerts --data-urlencode 'filter=alertname="KubeJobFailed"': the alert is active, with empty silencedBy. It also shows mattermost/mattermost-files-backup-29877360, which is incident #1544.
  2. flux get kustomizations -A --status-selector ready=false: 14–19 Kustomizations showed DependencyNotReady while b114c37 rolled through cnpg-drill → keycloak-preupgrade → keycloak → prometheus-stack. A minute later the list was empty, with no action. flux get helmreleases -A --status-selector ready=false was empty.
  3. kubectl -n monitoring get job dashboard-deployer -o yaml: Failed, BackoffLimitExceeded, with no pods left, so no logs.
  4. git log -p -- components/prometheus-stack/dashboard-deployer.yaml: found the curl bump a1407eb and the earlier fix a8d7a49.
  5. kubectl -n monitoring port-forward svc/monitoring-kube-prometheus-stack-grafana 13000:80, then curl http://localhost:13000/api/health → 200. curl -K - http://localhost:13000/api/user as admin, with the Secret's password sent on stdin and never printed → 401 {"message":"Invalid username or password"}.
  6. kubectl -n monitoring get secret monitoring-kube-prometheus-stack-grafana --show-managed-fields: Helm-owned and created 2026-07-02, last written by helm-controller at 00:00:03 on 2026-10-17.
  7. kubectl -n monitoring logs deploy/monitoring-kube-prometheus-stack-grafana -c grafana-sc-dashboard: the sidecar is working, and 26 ConfigMaps carry grafana_dashboard=1.
  8. Stopped for a person. Both ways out need a person:
  9. Resetting Grafana's admin password is a credential change, on a component with no backup gate.
  10. Moving the dashboard back to the sidecar reverses 73da600, which moved it off because row repeat broke on clusters with more than two nodes. That can only be checked by logging in to Grafana.

Owner (2026-10-24, ~21:33)

The owner chose option 1 on decision #1554. Using Claude Code, they backed up grafana.db (11 MB, pragma integrity_check ok) through a temporary debug container and ran grafana cli admin reset-admin-password --password-from-stdin with the value from the Secret. The password was never printed.

Second run (2026-10-24, ~21:50)

  1. kubectl -n monitoring port-forward svc/alertmanager-operated 9093, then curl -sG .../api/v2/alerts --data-urlencode 'filter=alertname="KubeJobFailed"': still active (aaef2a0787ae7d30), with no silence.
  2. flux get kustomizations -A --status-selector ready=false: about 20 showed DependencyNotReady while de0900f, then e6ab094, rolled through. Polling every 30 s with no action, the list was empty by 21:59:54. flux get helmreleases -A --status-selector ready=false was empty. Neither revision touches the Job.
  3. kubectl -n monitoring port-forward svc/monitoring-kube-prometheus-stack-grafana 13000:80, then curl -K - http://localhost:13000/api/user as admin, with the Secret's password on stdin and never printed → 200. /api/health → 200.
  4. Write: kubectl -n monitoring delete job dashboard-deployer, to replace the failed Job, which Git still defines. Exit 0, job.batch "dashboard-deployer" deleted. The Job held no data and had no pods left.
  5. Write: flux reconcile kustomization prometheus-stack -n flux-system, so Flux recreates the Job from Git. Exit 0, applied revision main@sha1:e6ab0944. The Job came back Running.
  6. kubectl -n monitoring wait --for=condition=complete job/dashboard-deployer --timeout=180s: condition met, Complete 1/1 in 10 s. The log shows the Grafana health JSON, then {"slug":"cluster-overview","status":"success",...,"version":2}.
  7. Through port-forwards to Prometheus and Alertmanager: the query kube_job_failed{job="kube-state-metrics",namespace="monitoring",job_name="dashboard-deployer"} > 0 returns no series, Prometheus has no matching alert, and Alertmanager (/api/v2/status 200) has no KubeJobFailed alert.
  8. Stopped the port-forwards. The agent set no silence, suspended nothing and added no annotations.

Resolution and verification

Resolved at 22:00 UTC on 2026-10-24. The owner reset Grafana's admin password to the Secret's value, and the operator replaced the failed Job. Checked afterwards: kubectl -n monitoring get job dashboard-deployer shows Complete 1/1, Alertmanager has no KubeJobFailed alert, and both flux get kustomizations -A --status-selector ready=false and flux get helmreleases -A --status-selector ready=false are empty. No change in Git was needed: the Job's manifest was correct, and only Grafana's stored credential had drifted.

Follow-ups

Option 1 was carried out. The cause can come back: Grafana keeps the admin password in its database, while the chart generates the Secret, so they can drift apart again. The other two options would remove the dependency on the admin password. They remain open as decision #1563 for the owner:

  • Reset Grafana's admin password to the Secret's value, then replace the failed Job. Done on 2026-10-24.
  • Ship cluster-overview.json through the dashboard sidecar again: add the grafana_dashboard: "1" label to its configMapGenerator entry and remove the Job. First check in Grafana that row repeat now works on this four-node cluster.
  • Give the Job a Grafana service-account token from OpenBao instead of the admin password.

The owner chose the service-account token (decision #1563). Since #1659 the Job authenticates with the token of the Grafana service account dashboard-deployer, synced from OpenBao by the ExternalSecret grafana-dashboard-deployer, and no longer reads admin-password. See Cluster overview dashboard.

The ops runbook had no section for a failed Job that Flux manages. #1564 added KubeJobFailed for a Job that Flux applies.

References

  • Alert: KubeJobFailed, runbook
  • Taskbase incident task: #1543
  • Runs: two operator runs on #1543 and the owner's session for decision #1554, all on 2026-10-24
  • Pull requests: #709 (the report), and this update
  • Runbook sections: none in the ops runbook fits a failed one-off Job; the alert's own runbook was followed

Open questions

  • Did the Job last succeed after #1189 (2026-10-18)? That Job was replaced on 2026-10-20 and its status is gone. If it succeeded, Grafana's stored password changed after the Secret's last write on 2026-10-17. If not, the two have not matched since an earlier date.
  • Does the Helm chart keep the generated password across upgrades on this cluster, or regenerate it? The managedFields time does not show whether the 2026-10-17 write changed the value.