Pcornel
Browse topics
Options
Recent
Favorites
Automation · Technical reference

Idempotency Failure

Direct answer

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

When to use this

Use it when the symptom is “Idempotency Failure”: work through the layers in order and stop at the first one that fails.

First 30 seconds

1. Idempotency failure: rerun changes something every time.

2. Find the task.

3. Guard commands, avoid timestamps, normalise comparisons.

4. Add idempotence test.

5. Fix and verify.

Operational verification

run twice → changed>0 → find task → fix

Context & applicabilityCommon mistakes · platform/version boundaries
Platform / version applicability
automation troubleshooting and failure analysis
applies
Structured applicability is explicit Topic metadata; it does not infer compatibility beyond the stored rows.
At a glance

Operational reference

Fast context before you go deeper.

Platformautomation troubleshooting and failure analysis · Idempotency Failure owns generic reconciliation behavior; tool-specific idempotency semantics remain with Ansible/Terraform/API branches. · Ansible
Key commandansible-playbook --check --diff <playbook.yml>
Scope / prerequisiteUse it when the symptom is “Idempotency Failure”: work through the layers in order and stop at the first one that fails.
Reference · 1
What next?3 suggested next steps
Catalog command links1
Evidence1
On this pageJump to a specific section
Automation command reference

Primary Commands

Configuration and operational commands for this Topic.

Operational workflow

Verification & Troubleshooting

Start with the observed symptom, prove the nearest boundary, and move outward only when the current state is understood.

6 steps Observe → verify → isolate → change minimally → repeat the original test.
ObservedRecord what the original test actually shows

Capture the concrete output, symptom, packet, log or counter before changing anything.

Step 1 Operational evidence path Verify boundary

desired state → current-state read → normalization/comparison → planned operation → target mutation → read-back → second identical run → residual diff/side effects → acceptance

Healthy evidence: converged state is explicit, repeat runs produce no unexplained target mutation or external side effect, and workload acceptance remains healthy.

Step 2 Telling causes apart Verify boundary

Known-good is a second identical run/read-only check reporting no unintended changes and direct target state remaining equal to the desired state; a deliberate drift should be detected and corrected exactly once. Broken evidence is recurring diff/change on unchanged input or target values oscillating between runs. The check result should report success with the relevant change count at 0 after convergence; a non-zero recurring change count is broken state. --check --diff is supporting evidence only because check mode may be incomplete; durable idempotency requires repeated target read-back under the same inputs.

Step 3 Common mistakes Verify boundary
  • Tasks that always report changed.
Step 4 Failure modes and next checks Narrow the fault

Suspicious evidence: every run reports changes from timestamps/order, non-idempotent create calls are repeated, changed=0 is treated as service evidence, or drift is silently ignored.

Step 5 Observation-driven branch and next-check logic Narrow the fault

After a controlled successful apply, run ansible-playbook --check --diff <playbook.yml> with identical inventory/variables. If it still reports changes, inspect the first changed task and diff for unstable data, command/shell use, missing creates/removes guards or comparison normalization. If check mode reports clean but real runs still change, confirm module check-mode fidelity and inspect runtime-generated values. Compare two successive real read-backs in a safe environment rather than simply adding changed_when: false to silence the symptom.

Step 6 Where it fails Narrow the fault

Where Idempotency Failure usually goes wrong: stable operation key, desired/current-state comparison, no-op behavior and duplicate-mutation prevention.

Evidence references

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.

observation · 1
Key points
  • 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.
Key checks
  • Second run shows changes — symptom
  • Task causing change each run — culprit
  • Normalisation of compared values — fix
ReferenceWhat it is1 section · depth on demand

Core model

Run against a known converged target; capture before/after state and operation diff; determine whether detection logic, normalization, unstable ordering, generated values, timestamps, API defaults or non-idempotent endpoints cause repeated change; fix comparison/reconciliation; rerun until no unintended mutation while acceptance stays green.

ReferenceHow it works1 section · depth on demand

How it works and how it fails

Idempotency Failure means the same desired input produces repeated unnecessary changes or divergent state after the first convergence. Causes include volatile inputs, non-idempotent modules/commands, unstable ordering, timestamps/random values or incomplete state detection. The reconciliation engine owns desired-versus-current state comparison and applies module logic through downstream target dependencies; check-mode state is separate from a real apply. ansible-playbook --check --diff estimates change intent against current state, but module check-mode support varies; it is a diagnostic projection, not guaranteed no-side-effect execution.

ReferenceImportant terms & boundaries2 sections · depth on demand

What this shows and what it does not

An idempotent rerun shows convergence only for the observed state model and side effects, but it does not show broader service health or hidden external actions.

Method

An idempotency failure is automation that reports changes (or makes changes) on every run even though nothing should differ. Finding it follows a method.

1. Run twice and list tasks that report changed on the second run.

2. For each, compare what it reads with what it writes (diff output).

3. Look for unstable inputs: timestamps, random values, unordered lists, generated passwords.

4. Look for commands without state checks (command, shell, raw API POST).

5. Fix by normalising, sorting, adding changed_when/creates, or using a state-aware module.

Typical causeFix
Template contains {{ ansible_date_time }}Remove volatile content
Device normalises config differentlyMatch device format in desired state
POST instead of PUTCheck existence first
Source basisSource attribution states what this section is based on; it is not independent proof that the current environment matches it.
Additional reference context Scope · expected state · examples · history · terminology Open only when you need the supporting context
Technical verification history

Verification history & basis

When and against what this Topic was checked. Later text edits do not count as a new check.

2026-09-14 · vendor docautomation troubleshooting and failure analysis current

Authoritative/upstream documentation reviewed for bounded claims in Automation Troubleshooting > Idempotency Failure. Documentation verification only; this is not observed lab or production Evidence.

Basis: https://learn.microsoft.com/en-us/azure/architecture/patterns/retry · confidence 94%
Terminology layer

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.

Aliases that resolve here
idempotency failureautomation changes every runnon idempotent automation
Embedded reference data

Quick lookup tables

Idempotency Failure troubleshooting proof-boundary map

Fast symptom/scope, first-failed-boundary, effective-outcome and recovery/closure map for Idempotency Failure.

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
Depth when you need it

Deep reference

Healthy vs suspicious evidence

Output interpretation

For Idempotency Failure, rely on structured fields and stable IDs (stable operation key, desired/current-state comparison, no-op behavior and duplicate-mutation prevention) rather than text formatted for display.

Confirmation

Confirm action

Continue?