{
  "id": "terraform/conflicting-terraform-version-constraints",
  "signature": "Error: Conflicting version constraints for module 'vpc': required_version = \">= 1.6, < 2.0\" but other module requires \">= 1.5, < 1.8\"",
  "signature_zh": "错误：模块 'vpc' 的版本约束冲突：required_version = \">= 1.6, < 2.0\" 但其他模块要求 \">= 1.5, < 1.8\"",
  "regex": "Conflicting version constraints for module '.*': required_version = \".*\" but other module requires \".*\"",
  "domain": "terraform",
  "category": "config_error",
  "subcategory": null,
  "root_cause": "Multiple modules define overlapping but conflicting required_version constraints, making it impossible to select a single Terraform version that satisfies all.",
  "root_cause_type": "generic",
  "root_cause_zh": "多个模块定义了重叠但冲突的 required_version 约束，导致无法选择满足所有要求的单一 Terraform 版本。",
  "versions": [
    {
      "version": "Terraform v1.5",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "Terraform v1.6",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "Terraform v1.7",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    }
  ],
  "os_specific": {},
  "dead_ends": [
    {
      "action": "",
      "why_fails": "Root module constraints are combined with child module constraints; overriding doesn't work because Terraform enforces intersection of all constraints.",
      "fail_rate": 0.95,
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "why_fails": "Removing constraints from child modules may cause them to be used with incompatible Terraform versions, leading to other errors. Terraform still validates root constraints.",
      "fail_rate": 0.7,
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "why_fails": "This doesn't resolve existing conflicts; it may introduce new ones if modules have different minimum version requirements.",
      "fail_rate": 0.85,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "Align all module required_version constraints to a single compatible range. For example, change all to required_version = \">= 1.6, < 2.0\". Then run 'terraform init -upgrade' to reinitialize.",
      "success_rate": 0.85,
      "how": "Align all module required_version constraints to a single compatible range. For example, change all to required_version = \">= 1.6, < 2.0\". Then run 'terraform init -upgrade' to reinitialize.",
      "condition": "",
      "sources": []
    },
    {
      "action": "If alignment is not possible, remove required_version from conflicting modules and rely on root module's constraint. Edit each module's versions.tf to delete the required_version line, then run 'terraform init'.",
      "success_rate": 0.75,
      "how": "If alignment is not possible, remove required_version from conflicting modules and rely on root module's constraint. Edit each module's versions.tf to delete the required_version line, then run 'terraform init'.",
      "condition": "",
      "sources": []
    }
  ],
  "workarounds_zh": [
    "Align all module required_version constraints to a single compatible range. For example, change all to required_version = \">= 1.6, < 2.0\". Then run 'terraform init -upgrade' to reinitialize.",
    "If alignment is not possible, remove required_version from conflicting modules and rely on root module's constraint. Edit each module's versions.tf to delete the required_version line, then run 'terraform init'."
  ],
  "transition_graph": {
    "leads_to": [],
    "preceded_by": [],
    "frequently_confused_with": []
  },
  "official_doc_url": "https://developer.hashicorp.com/terraform/language/expressions/version-constraints",
  "official_doc_section": null,
  "error_code": null,
  "verification_tier": "ai_generated",
  "confidence": 0.85,
  "fix_success_rate": 0.8,
  "resolvable": "true",
  "first_seen": "2023-09-15",
  "last_confirmed": "2024-06-01",
  "last_updated": "2024-06-01",
  "evidence_count": 1,
  "tags": [],
  "locale": "en",
  "aliases": []
}