Inconsistent dependency lock file Terraform Origin: Platform & cloud Last updated 15 Oct 2026

Terraform: Error: Inconsistent dependency lock file — provider x: required by this configuration but no version is selected

The .terraform.lock.hcl file doesn’t match the providers/versions your configuration now requires, or init wasn’t run.

Exact message you may see Inconsistent dependency lock filerequired by this configuration but no version is selectedthe cached package does not match any of the checksums recorded in the dependency lock file
Seen on: Terraform

Meaning

Adding a provider, changing version constraints, or switching platforms (lock file only has hashes for one OS) requires terraform init -upgrade or providers lock for all platforms.

Common causes

  • Provider added/changed without terraform init
  • Lock file missing hashes for the CI platform (darwin vs linux)
  • Version constraint changed
  • .terraform directory stale

⚡ Quick fix

  1. Run terraform init -upgrade and commit the lock file
  2. Add hashes for all platforms with terraform providers lock
  3. Delete .terraform/ and init again

Detailed fix by platform

Shell

  1. hcl
    terraform init -upgrade
    terraform providers lock -platform=linux_amd64 -platform=darwin_arm64 -platform=windows_amd64

How to diagnose

  1. Lock — Providers listed
  2. Platforms — Hashes for CI OS?
  3. Init — Run after change?

🔧 Still not fixed?

Many errors look alike. If the steps above didn’t solve it, one of these is probably what you’re facing:

Where this error sits

Origin: Platform & cloud. Errors that are often confused with or caused by this one (click to open):

Error acquiring the state lock — Terraform: Error: Error acquiring the state lock — ConditionalCheckFailedException / state blob is already locked (Terraform)Error acquiring the s…Reference to undeclared resource — Terraform: Error: Reference to undeclared resource / Reference to undeclared input variable (Terraform)Reference to undeclar…Inconsist…

Explore the map of this error Full error map →

🧠 Still stuck? Analyze your error

Paste the full message, response headers or stack trace — we'll detect the platform and point to the most likely cause.

💬 What worked for others

No tips yet — did something else fix this for you?

Share what worked for you

Tips are checked by an editor before they appear. Links are removed.