Pcornel
Automation · Automation Troubleshooting

Idempotency Failure

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

Back to the Topic

Answer

Idempotency Failure isolates automation that changes state or creates side effects on repeated execution despite already having reached the intended state.

Remember

  • Second run changed ≠ change was necessarily harmful, but it requires explanation.
  • changed=0 ≠ workload/service is healthy.
  • Same desired input ≠ provider/API returns stable normalized state.
  • No textual diff ≠ no external side effect occurred.

First checks

  • Second run shows changes — symptom
  • Task causing change each run — culprit
  • Normalisation of compared values — fix

Commands

ansible-playbook --check --diff <playbook.yml>
Read-only/validation observation for Ansible's predicted change set and diff for modules that support check mode.

Verify in this order

run twice → changed>0 → find task → fix

Where it usually breaks

An idempotent rerun proves convergence only for the observed state model and side effects; it does not prove broader service health or hidden external actions.

Input/desired state → request accepted → job/task terminal status → target object read-back → effective runtime state → original workload → regression/rollback readiness.

Idempotency Failure 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=6059

Confirmation

Confirm action

Continue?