# 错误：查询可用提供程序包失败：无法获取 hashicorp/aws 提供程序的可用版本列表：请求在 30 秒后超时

- **ID:** `terraform/terraform-provider-registry-timeout`
- **领域:** terraform
- **类别:** network_error
- **验证级别:** ai_generated
- **修复率:** 80%

## 根因

网络连接问题或注册表服务器超时，导致 Terraform 无法从注册表获取提供程序版本。

## 版本兼容性

| 版本 | 状态 | 引入 | 弃用 |
|------|------|------|------|
| Terraform v1.5 | active | — | — |
| Terraform v1.6 | active | — | — |
| Terraform v1.7 | active | — | — |
| Terraform v1.8 | active | — | — |

## 解决方案

1. ```
   Set the environment variable 'TF_REGISTRY_CLIENT_TIMEOUT' to a higher value, e.g., 60 seconds, and rerun 'terraform init'.
   ```
2. ```
   Use a local provider mirror by configuring 'provider_installation' in .terraformrc to use a filesystem mirror or network mirror.
   ```

## 无效尝试

- **** — Debug logging does not resolve network timeouts; it only adds verbosity without addressing the root cause. (90% 失败率)
- **** — Without a local mirror, Terraform cannot find any providers, leading to a different error about missing providers. (80% 失败率)
- **** — Provider blocks do not have a timeout attribute for registry queries; this is a client-side setting. (95% 失败率)
