Use it when the symptom is “State Drift”: work through the layers in order and stop at the first one that fails.
State Drift
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.
1. State drift causes unexpected diffs.
2. Identify changed resources.
3. Decide revert vs codify.
4. Find the source (manual change, other tool).
5. Prevent recurrence.
actual ≠ desired → diff → resolve
Context & applicabilityCommon mistakes · platform/version boundaries
Operational reference
Fast context before you go deeper.
Verification & Troubleshooting
Start with the observed symptom, prove the nearest boundary, and move outward only when the current state is understood.
Use the operational verification above to establish the expected state.
Capture the concrete output, symptom, packet, log or counter before changing anything.
Step 1 Operational evidence path Verify boundary
desired source revision → recorded automation state → fresh live read → normalized diff → drift origin/time → reconcile/adopt/source update decision → apply/import → fresh diff → workload acceptance
Healthy evidence: desired, recorded and live states are separately captured, drift origin is known, chosen reconciliation is intentional, fresh comparison is clean and workload verifies.
Step 2 Failure modes and next checks Narrow the fault
Suspicious evidence: cached state is compared to itself, manual drift is overwritten without audit, provider-computed fields generate noise, or a clean diff replaces service acceptance.
Step 3 Common mistakes Narrow the fault
- Manual changes reverted by the next run.
Evidence · 1 on this Topic
Expected observations and documentation recipes are reference material. Record actual output, device identity, scope and time before claiming a verified result.
- 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.
ansible-playbook site.yml --check --diff— CM driftterraform plan -refresh-only— IaC drift- Change audit for manual edits — source
ReferenceWhat it is1 section · depth on demand
Core model
Pin desired source revision and state snapshot; refresh/read live target; normalize comparable fields; classify external/manual change, provider default, failed apply or stale cached state; assess blast radius; choose reconcile, import/adopt or intentional source update; verify fresh plan/read-back and workload.
ReferenceImportant terms & boundaries2 sections · depth on demand
What this shows and what it does not
Drift evidence shows disagreement among compared representations; it does not by itself identify which representation is authoritative or whether the difference is harmful.
In depth
State drift as an automation problem means the real system no longer matches what the automation tool believes or intends, so plans contain unexpected changes or runs undo manual work.
| Clue | Meaning |
|---|---|
terraform plan shows unrelated changes | Someone changed resources outside Terraform |
| Ansible reverts a fix | Desired state not updated with the emergency change |
| Resource "not found" in state | Deleted outside the tool |
Resolve by deciding which side is correct, then either update the code or let the tool revert the system — never just ignore the difference.
Additional reference context Scope · expected state · examples · history · terminology Open only when you need the supporting context
Verification history & basis
When and against what this Topic was checked. Later text edits do not count as a new check.
Authoritative/upstream documentation reviewed for bounded claims in Automation Troubleshooting > State Drift. Documentation verification only; this is not observed lab or production Evidence.
Basis: https://learn.microsoft.com/en-us/azure/architecture/patterns/retry · confidence 94%Terms & aliases
Hover a linked term for a quick definition; click it to open its glossary entry. Aliases are other names that find this Topic in search.
Quick lookup tables
State Drift troubleshooting proof-boundary map
Fast symptom/scope, first-failed-boundary, effective-outcome and recovery/closure map for State Drift.
| Boundary | Healthy evidence | Suspicious evidence |
|---|---|---|
| Symptom / scope | Time window, immutable source/run identity, effective inputs and exact targets are explicit | Floating source, changed inputs or ambiguous targets destroy reproducibility |
| First failed boundary | Transport/auth/dependency/render/operation evidence identifies the earliest divergence | Investigation starts at the final error and skips earlier unproven boundaries |
| Effective outcome | Controller result is paired with target read-back and workload/service acceptance | Green execution state or changed symptom substitutes for effective-state verification |
| Recovery / closure | Minimal change restores the original test and regression/partial-state checks are clean | Broad retry or unrelated edits make the incident non-reproducible and hide residual state |