terraform
install_error
ai_generated
partial
错误:下载模块失败:来自 registry.terraform.io/hashicorp/consul/aws 的模块源校验和不匹配
Error: Failed to download module: checksum mismatch for module source from registry.terraform.io/hashicorp/consul/aws
ID: terraform/module-source-checksum-mismatch
75%修复率
85%置信度
1证据数
2024-01-10首次发现
版本兼容性
| 版本 | 状态 | 引入 | 弃用 | 备注 |
|---|---|---|---|---|
| Terraform v1.6.0 | active | — | — | — |
| Terraform v1.7.0 | active | — | — | — |
| Terraform v1.8.0 | active | — | — | — |
根因分析
下载的模块存档的校验和与 Terraform 注册表中预期的校验和不匹配,表明下载损坏或模块被篡改。
English
The downloaded module archive's checksum does not match the expected checksum in the Terraform registry, indicating a corrupted download or tampered module.
官方文档
https://developer.hashicorp.com/terraform/language/modules/sources#module-checksums解决方案
-
清理模块缓存并重新下载:'rm -rf .terraform/modules && terraform init'。
-
如果问题持续存在,在源中指定精确模块版本:'source = "hashicorp/consul/aws" version = "0.11.0"' 并运行 'terraform init -upgrade'。
-
检查网络连接和代理设置,然后使用不同的镜像:'terraform init -plugin-dir=/path/to/mirror'。
无效尝试
常见但无效的做法:
-
90% 失败
The corrupted download persists in the .terraform/modules cache.
-
80% 失败
The lock file will be regenerated with the same mismatch on next init.
-
60% 失败
May introduce breaking changes or other errors.