Terraform: Saved plan is stale (tested)

Error: Saved plan is stale means the .tfplan file you're applying no longer matches the real state — something else changed the infrastructure after the plan was saved. We reproduced it on Terraform v1.16.5 and measured the exact fix.

1. The exact error, from a genuinely stale plan

We saved a plan changing a value from v1 to v2:

terraform plan -out=saved.tfplan

Then, before applying it, ran a different change directly (v2 → v3), which updated the real state out from under the saved plan. Applying the now-outdated plan file gave:

Error: Saved plan is stale

The given plan file can no longer be applied because the state was changed
by another operation after the plan was created.

Why: a saved plan file is a snapshot of both the intended changes and the state it was computed against. If the real state moves on — a teammate's apply, a separate CI run, even your own later command — applying the old plan could silently produce the wrong result. Terraform refuses rather than guess.

2. The fix: regenerate the plan against current state

We confirmed the fix is simply to re-run plan and apply the fresh output:

terraform plan -out=saved2.tfplan
terraform apply saved2.tfplan

In our case the real state had already reached the intended value from the other change, so the regenerated plan correctly reported "No changes" and the apply completed as a no-op. If the real state had diverged in a way that still required changes, the regenerated plan would show exactly those, computed fresh against what's actually there now — there's no way to "patch" a stale plan file; it has to be recomputed.

This is a different failure from the state lock error: a lock blocks a concurrent run from touching the state at the same time, while a stale plan is caught after the fact — the apply runs, finds the state doesn't match what the plan assumed, and refuses. Both exist to stop the same class of mistake (acting on infrastructure information that's no longer current), just at different points in the pipeline.

Frequently asked questions

What causes 'Saved plan is stale' in practice?

Any change to the real state between saving a plan (terraform plan -out=file) and applying it: a teammate's apply, a separate CI pipeline run, a manual terraform apply without the saved file, or even your own later command. We reproduced this directly by applying an unrelated change before applying the saved plan.

Can I force-apply a stale plan anyway?

No — we found no flag that overrides this check, and that's deliberate: the point of a saved plan is to guarantee the exact change you reviewed is what gets applied. Regenerating the plan (terraform plan -out=...) against current state is the only path forward; we confirmed this works cleanly.

Does regenerating the plan always show the same changes?

No — it reflects reality as it stands now, which may differ from what the original stale plan intended. We measured this directly: in our repro, the real state had already reached the value the stale plan was trying to set, so the regenerated plan correctly reported 'No changes' instead of repeating a change that was no longer needed.

Is this the same error as the state lock error?

No — a lock error blocks a concurrent run from touching the state at the same time as another run; a stale-plan error is caught later, when an apply discovers the state no longer matches what its saved plan assumed. See our separate guide on terraform error acquiring the state lock for that one.

Written with AI assistance. Measured on 2026-10-03 with Terraform v1.16.5 on Linux, local backend, using a terraform_data resource and a saved plan file (terraform plan -out=...). Every message below is copy-pasted output, not paraphrased. PlainHeaders is our extension; Terraform is free.