Pcornel
Automation · Automation Troubleshooting

State Drift

Cheat sheet · https://pcornel.dk/topic.php?topic=6060

Back to the Topic

Answer

State Drift isolates divergence between authoritative desired state, automation-managed recorded state and live target state, identifying whether drift is intentional, external, stale-read or failed reconciliation.

Remember

  • Drift detected ≠ target is wrong; desired source may be stale.
  • No drift in cached state ≠ live target matches.
  • Manual change ≠ unauthorized change in every case.
  • Reconciliation succeeded ≠ workload behavior restored.

First checks

  • ansible-playbook site.yml --check --diff — CM drift
  • terraform plan -refresh-only — IaC drift
  • Change audit for manual edits — source

Verify in this order

actual ≠ desired → diff → resolve

Where it usually breaks

Drift evidence proves disagreement among compared representations; it does not by itself identify which representation is authoritative or whether the difference is harmful.

Configuration/input → graph/state refresh → plan → provider API request → provider terminal result → resource read-back → effective service state → workload.

State Drift troubleshooting proof-boundary map

BoundaryHealthy evidenceSuspicious evidence
Symptom / scopeTime window, immutable source/run identity, effective inputs and exact targets are explicitFloating source, changed inputs or ambiguous targets destroy reproducibility
First failed boundaryTransport/auth/dependency/render/operation evidence identifies the earliest divergenceInvestigation starts at the final error and skips earlier unproven boundaries
Effective outcomeController result is paired with target read-back and workload/service acceptanceGreen execution state or changed symptom substitutes for effective-state verification
Recovery / closureMinimal change restores the original test and regression/partial-state checks are cleanBroad retry or unrelated edits make the incident non-reproducible and hide residual state

Read-only verification commands unless stated otherwise. Confirm syntax for your platform and release. Full reference: https://pcornel.dk/topic.php?topic=6060

Confirmation

Confirm action

Continue?