# 错误：状态快照由 Terraform v1.6 创建，比当前 v1.5 更新

- **ID:** `terraform/state-version-mismatch-major-upgrade`
- **领域:** terraform
- **类别:** runtime_error
- **验证级别:** ai_generated
- **修复率:** 95%

## 根因

Terraform 状态文件由较新版本的 Terraform（v1.6）写入，无法被较旧版本（v1.5）读取，因为状态格式不兼容。

## 版本兼容性

| 版本 | 状态 | 引入 | 弃用 |
|------|------|------|------|
| Terraform v1.5.0 | active | — | — |
| Terraform v1.6.0 | active | — | — |
| Terraform v1.7.0 | active | — | — |

## 解决方案

1. ```
   Upgrade the local Terraform version to match or exceed the version that wrote the state: install Terraform v1.6 or later via `tfenv install 1.6.0 && tfenv use 1.6.0`
   ```
2. ```
   If you must use an older version, restore a state backup from before the newer version was used (if available): `aws s3 cp s3://bucket/terraform.tfstate.backup terraform.tfstate`
   ```

## 无效尝试

- **** — Terraform does not support backward state compatibility. Once state is written by a newer version, older versions cannot parse it. (100% 失败率)
- **** — The state format is not just a version number; the internal serialization changed. Editing the version field corrupts the state and may cause data loss. (100% 失败率)
