terraform
network_error
ai_generated
true
查询可用提供程序包失败:无法检索提供程序 hashicorp/aws 的可用版本列表:registry.terraform.io 没有响应
Error: Failed to query available provider packages: could not retrieve the list of available versions for provider hashicorp/aws: the registry at registry.terraform.io did not respond
ID: terraform/invalid-provider-registry-source
85%修复率
87%置信度
1证据数
2023-03-01首次发现
版本兼容性
| 版本 | 状态 | 引入 | 弃用 | 备注 |
|---|---|---|---|---|
| Terraform 1.4 | active | — | — | — |
| Terraform 1.5 | active | — | — | — |
| Terraform 1.6 | active | — | — | — |
| Terraform 1.7 | active | — | — | — |
根因分析
Terraform 无法访问 Terraform Registry (registry.terraform.io) 来获取提供程序元数据,通常是由于网络问题、DNS 故障或代理配置错误。
English
Terraform cannot reach the Terraform Registry (registry.terraform.io) to fetch provider metadata, often due to network issues, DNS failures, or proxy misconfiguration.
官方文档
https://developer.hashicorp.com/terraform/cli/config/environment-variables解决方案
-
Check network connectivity: curl -v https://registry.terraform.io/.well-known/terraform.json
-
Use a local provider mirror or filesystem mirror: terraform init -plugin-dir=/path/to/mirror
-
Set TF_REGISTRY_DISCOVERY_RETRY=3 to increase retry attempts: export TF_REGISTRY_DISCOVERY_RETRY=3 && terraform init
无效尝试
常见但无效的做法:
-
80% 失败
Using a non-existent or misconfigured proxy worsens connectivity.
-
40% 失败
This is an extreme measure that compromises security and may not solve DNS issues.