terraform
dependency_error
ai_generated
true
Error: Module version requirements have changed: version constraint not met
ID: terraform/tf-module-version-mismatch
88%Fix Rate
90%Confidence
65Evidence
2023-01-01First Seen
Version Compatibility
| Version | Status | Introduced | Deprecated | Notes |
|---|---|---|---|---|
| 1 | active | — | — | — |
Root Cause
Module version specified in configuration does not match available versions in the registry.
genericWorkarounds
-
90% success Check available versions in the registry and update the version constraint
Visit registry.terraform.io for the module, update version = "~> X.Y" in the module block
Sources: https://developer.hashicorp.com/terraform/language/modules/syntax
-
85% success Run terraform init -upgrade to fetch the latest matching version
terraform init -upgrade will re-evaluate version constraints and download compatible versions
Sources: https://developer.hashicorp.com/terraform/cli/commands/init
Dead Ends
Common approaches that don't work:
-
Pin to a specific commit hash of a registry module
80% fail
Terraform Registry modules are versioned by semver tags, not commit hashes; this only works for git sources
-
Remove the version constraint entirely
65% fail
Without version constraints, terraform init may pull breaking changes from newer module versions
Error Chain
Frequently confused with: