Terraform study
Offline — showing the cached copy.
Home / Terraform / 17. Common errors, decoded

17. Common errors, decoded

One-liner. Most Terraform pain is state, locks, or cycles.

Memorize

  • Error acquiring the state lock → another run crashed; confirm no active run, then force-unlock <id>.
  • Provider produced inconsistent result → usually a bad ignore_changes or a computed attribute fight; read the plan.
  • Cycle: ... → circular reference; break it with depends_on removal or split into modules/stacks.
  • Error: resource already exists → import it (block or CLI), don't delete it.
  • No valid credential sources → profile/SSO expired or CI role not assumed.
  • Unsupported argument after upgrade → provider major version change; check the upgrade guide.
  • Objects have changed outside of Terraform → drift; plan -refresh-only to inspect, then decide.

Trap. Repeatedly force-unlock when a pipeline is actually running — you corrupt state, not fix it. Pick it when. the pipeline is red and everyone is guessing.