{
  "id": "terraform/conflicting-backend-configuration",
  "signature": "Error: Conflicting backend configuration: partial backend configuration specified for the 's3' backend",
  "signature_zh": "错误：后端配置冲突：为 's3' 后端指定了部分后端配置",
  "regex": "Conflicting backend configuration: partial backend configuration specified for the '.*' backend",
  "domain": "terraform",
  "category": "config_error",
  "subcategory": null,
  "root_cause": "Terraform backend configuration is partially specified in both the terraform block and via command-line -backend-config options, creating an unresolvable conflict.",
  "root_cause_type": "generic",
  "root_cause_zh": "Terraform 后端配置同时在 terraform 块和命令行 -backend-config 选项中部分指定，导致无法解决的冲突。",
  "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": "Removing all -backend-config flags and relying solely on the terraform block",
      "why_fails": "If the terraform block itself is incomplete (e.g., missing required attributes like bucket or key), init will fail with missing configuration errors.",
      "fail_rate": 0.65,
      "condition": "",
      "sources": []
    },
    {
      "action": "Setting all backend config directly in the terraform block without any -backend-config flags, then rerunning init",
      "why_fails": "If the backend block contains partial config that conflicts with inherited state, Terraform may still detect a mismatch and refuse to initialize.",
      "fail_rate": 0.5,
      "condition": "",
      "sources": []
    },
    {
      "action": "Deleting the .terraform directory and rerunning init without -backend-config",
      "why_fails": "Deleting .terraform doesn't resolve the config conflict; Terraform will still parse the backend block and report the same error if partial config remains.",
      "fail_rate": 0.8,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "Use a fully specified backend block in the terraform configuration: `terraform { backend \"s3\" { bucket = \"my-bucket\" key = \"path/to/state\" region = \"us-east-1\" } }` and remove all -backend-config flags from the init command.",
      "success_rate": 0.9,
      "how": "Use a fully specified backend block in the terraform configuration: `terraform { backend \"s3\" { bucket = \"my-bucket\" key = \"path/to/state\" region = \"us-east-1\" } }` and remove all -backend-config flags from the init command.",
      "condition": "",
      "sources": []
    },
    {
      "action": "Use only command-line -backend-config options with an empty backend block: `terraform { backend \"s3\" {} }` then run `terraform init -backend-config=\"bucket=my-bucket\" -backend-config=\"key=path/to/state\"`.",
      "success_rate": 0.85,
      "how": "Use only command-line -backend-config options with an empty backend block: `terraform { backend \"s3\" {} }` then run `terraform init -backend-config=\"bucket=my-bucket\" -backend-config=\"key=path/to/state\"`.",
      "condition": "",
      "sources": []
    },
    {
      "action": "Run `terraform init -reconfigure` to force reinitialization and ignore existing state configuration, then provide complete config via -backend-config flags.",
      "success_rate": 0.75,
      "how": "Run `terraform init -reconfigure` to force reinitialization and ignore existing state configuration, then provide complete config via -backend-config flags.",
      "condition": "",
      "sources": []
    }
  ],
  "workarounds_zh": [
    "Use a fully specified backend block in the terraform configuration: `terraform { backend \"s3\" { bucket = \"my-bucket\" key = \"path/to/state\" region = \"us-east-1\" } }` and remove all -backend-config flags from the init command.",
    "Use only command-line -backend-config options with an empty backend block: `terraform { backend \"s3\" {} }` then run `terraform init -backend-config=\"bucket=my-bucket\" -backend-config=\"key=path/to/state\"`.",
    "Run `terraform init -reconfigure` to force reinitialization and ignore existing state configuration, then provide complete config via -backend-config flags."
  ],
  "transition_graph": {
    "leads_to": [],
    "preceded_by": [],
    "frequently_confused_with": []
  },
  "official_doc_url": "https://developer.hashicorp.com/terraform/language/settings/backends/configuration#partial-configuration",
  "official_doc_section": null,
  "error_code": null,
  "verification_tier": "ai_generated",
  "confidence": 0.88,
  "fix_success_rate": 0.85,
  "resolvable": "true",
  "first_seen": "2023-09-15",
  "last_confirmed": "2024-06-01",
  "last_updated": "2024-06-01",
  "evidence_count": 1,
  "tags": [],
  "locale": "en",
  "aliases": []
}