【发布时间】:2022-08-14 08:44:21
【问题描述】:
我尝试做一个 terraform init,但它失败了。这以前可以工作,不知道发生了什么变化。请问有什么想法吗?
我能够卷曲相同的网址,并且效果很好。
tf 版本:1.1.5 aws 版本:4.4.0
Initializing provider plugins...
- Finding hashicorp/aws versions matching \"~> 4.4.0\"...
2022-08-10T10:05:00.750-0700 [DEBUG] Service discovery for registry.terraform.io at https://registry.terraform.io/.well-known/terraform.json
2022-08-10T10:05:11.191-0700 [DEBUG] GET https://registry.terraform.io/v1/providers/hashicorp/aws/versions
2022-08-10T10:05:21.196-0700 [ERROR] GET https://registry.terraform.io/v1/providers/hashicorp/aws/versions request failed: Get \"https://registry.terraform.io/v1/providers/hashicorp/aws/versions\": net/http: request canceled while waiting for connection (Client.Timeout exceeded while awaiting headers)
2022-08-10T10:05:21.196-0700 [DEBUG] GET https://registry.terraform.io/v1/providers/hashicorp/aws/versions: retrying in 1s (1 left)
2022-08-10T10:05:22.198-0700 [INFO] Previous request to the remote registry failed, attempting retry.
2022-08-10T10:05:32.199-0700 [ERROR] GET https://registry.terraform.io/v1/providers/hashicorp/aws/versions request failed: Get \"https://registry.terraform.io/v1/providers/hashicorp/aws/versions\": net/http: request canceled while waiting for connection (Client.Timeout exceeded while awaiting headers)
╷
│ Error: Failed to query available provider packages
│
│ Could not retrieve the list of available versions for provider hashicorp/aws: could not query provider registry for registry.terraform.io/hashicorp/aws: the
│ request failed after 2 attempts, please try again later: Get \"https://registry.terraform.io/v1/providers/hashicorp/aws/versions\": net/http: request canceled
│ while waiting for connection (Client.Timeout exceeded while awaiting headers)```
-
也许有一个暂时的停机时间,也许你有奇怪的网络设置。它是否在其他机器上工作,它最后一次工作是什么时候,它是什么时候第一次停止工作?
-
这取决于您在哪里进行
curl和terraform init。如果两者都在同一台机器上运行,.terraform目录会发生一些奇怪的事情。如果不是,则在拦截流量之间可能有网络设备。 -
使用 Curl 时,请求似乎需要很长时间?在 Unix 系统上,您可以运行
time curl ...来查看该请求大约需要多长时间。我想知道 Curl 是否比 Terraform 有更慷慨的超时。如果您尝试此操作,我建议您也更新您的问题,以包括您运行的确切命令及其产生的完整输出,因此更容易将其与 Terraform 所做的比较。
标签: amazon-web-services terraform terraform-provider-aws terraform0.12+