Terraform "Saved plan is stale" - Plan No Longer Matches State in CI
By Daniel Zoghalchali·Latchkey
You saved a plan in one job and applied it in another, but the state changed in between. Terraform rejects the saved plan because applying it would no longer be safe.
What this error means
terraform apply tfplan in a separate job fails saying the saved plan is stale - the state has a different serial than when the plan was created. It happens when another run (or a manual change) touched state between plan and apply.
terraform apply output
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.
Diagnose it: init, state, or credentials?
Terraform failures in CI are dominated by backend and credential problems rather than configuration errors. Confirm the runner can initialise, authenticate, and lock state before reading the plan.
Keep the gap between plan and apply short, and re-plan if it grows.
Serialize Terraform runs with a concurrency group.
Treat a stale-plan error as a signal to re-plan, never to bypass.
Frequently asked questions
What causes Terraform "Saved plan is stale"?
There are 2 common causes: state changed between plan and apply and long gap or no serialization between jobs. Another apply, a drift, or a manual edit advanced the state serial after the plan file was written, so the saved plan no longer matches reality.
How do I fix Terraform "Saved plan is stale"?
There are 2 fixes depending on which cause you have: re-plan and apply against current state and serialize plan and apply. Work through them in order, since the first is the most common.
What does Terraform "Saved plan is stale" actually mean?
terraform apply tfplan in a separate job fails saying the saved plan is stale - the state has a different serial than when the plan was created.
How do I stop Terraform "Saved plan is stale" happening again?
Keep the gap between plan and apply short, and re-plan if it grows. The prevention section lists 3 changes that keep it from recurring.