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

其他格式: JSON · Markdown 中文 · English
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.

generic

官方文档

https://developer.hashicorp.com/terraform/language/modules/sources#module-checksums

解决方案

  1. 清理模块缓存并重新下载:'rm -rf .terraform/modules && terraform init'。
  2. 如果问题持续存在,在源中指定精确模块版本:'source = "hashicorp/consul/aws" version = "0.11.0"' 并运行 'terraform init -upgrade'。
  3. 检查网络连接和代理设置,然后使用不同的镜像:'terraform init -plugin-dir=/path/to/mirror'。

无效尝试

常见但无效的做法:

  1. 90% 失败

    The corrupted download persists in the .terraform/modules cache.

  2. 80% 失败

    The lock file will be regenerated with the same mismatch on next init.

  3. 60% 失败

    May introduce breaking changes or other errors.