Closed snemetz closed 3 years ago
I am still getting this issue with Terraform 1.0.1 on an alpine docker image.
bash-5.1# ./terraform init
2021-06-29T09:15:06.197Z [DEBUG] Adding temp file log sink: /tmp/terraform-log106468856
2021-06-29T09:15:06.197Z [INFO] Terraform version: 1.0.1
2021-06-29T09:15:06.197Z [INFO] Go runtime version: go1.16.4
2021-06-29T09:15:06.197Z [INFO] CLI args: []string{"/data/terraform", "init"}
2021-06-29T09:15:06.197Z [TRACE] Stdout is a terminal of width 175
2021-06-29T09:15:06.197Z [TRACE] Stderr is a terminal of width 175
2021-06-29T09:15:06.197Z [TRACE] Stdin is a terminal
2021-06-29T09:15:06.197Z [DEBUG] Attempting to open CLI config file: /root/.terraformrc
2021-06-29T09:15:06.197Z [DEBUG] File doesn't exist, but doesn't need to. Ignoring.
2021-06-29T09:15:06.197Z [DEBUG] checking for credentials in "/root/.terraform.d/plugins"
2021-06-29T09:15:06.197Z [DEBUG] ignoring non-existing provider search directory terraform.d/plugins
2021-06-29T09:15:06.197Z [DEBUG] will search for provider plugins in /root/.terraform.d/plugins
2021-06-29T09:15:06.198Z [TRACE] getproviders.SearchLocalDirectory: found registry.terraform.io/hashicorp/alicloud v1.120.0 for linux_amd64 at /root/.terraform.d/plugins/registry.terraform.io/hashicorp/alicloud/1.120.0/linux_amd64
2021-06-29T09:15:06.198Z [TRACE] getproviders.SearchLocalDirectory: found registry.terraform.io/hashicorp/aws v3.36.0 for linux_amd64 at /root/.terraform.d/plugins/registry.terraform.io/hashicorp/aws/3.36.0/linux_amd64
2021-06-29T09:15:06.198Z [DEBUG] ignoring non-existing provider search directory /root/.local/share/terraform/plugins
2021-06-29T09:15:06.198Z [DEBUG] ignoring non-existing provider search directory /usr/local/share/terraform/plugins
2021-06-29T09:15:06.198Z [DEBUG] ignoring non-existing provider search directory /usr/share/terraform/plugins
2021-06-29T09:15:06.199Z [INFO] CLI command args: []string{"init"}
Initializing modules...
2021-06-29T09:15:06.203Z [TRACE] ModuleInstaller: installing child modules for . into .terraform/modules
2021-06-29T09:15:06.204Z [DEBUG] Module installer: begin vpc
2021-06-29T09:15:06.204Z [TRACE] ModuleInstaller: vpc is not yet installed
2021-06-29T09:15:06.204Z [TRACE] ModuleInstaller: cleaning directory .terraform/modules/vpc prior to install of vpc
2021-06-29T09:15:06.204Z [TRACE] ModuleInstaller: vpc is a registry module at terraform-google-modules/network/google
2021-06-29T09:15:06.204Z [DEBUG] vpc listing available versions of terraform-google-modules/network/google at registry.terraform.io
2021-06-29T09:15:06.204Z [DEBUG] Service discovery for registry.terraform.io at https://registry.terraform.io/.well-known/terraform.json
2021-06-29T09:15:06.204Z [TRACE] HTTP client GET request to https://registry.terraform.io/.well-known/terraform.json
2021-06-29T09:15:09.201Z [ERROR] Checkpoint error: Get "https://checkpoint-api.hashicorp.com/v1/check/terraform?arch=amd64&os=linux&signature=2884c382-efd8-0c50-23d5-16d0383a2b06&version=1.0.1": context deadline exceeded (Client.Timeout exceeded while awaiting headers)
2021-06-29T09:15:17.204Z [TRACE] modsdir: writing modules manifest to .terraform/modules/modules.json
╷
│ Error: Error accessing remote module registry
│
│ Failed to retrieve available versions for module "vpc" (main.tf:1) from registry.terraform.io: Failed to request discovery document: Get
│ "https://registry.terraform.io/.well-known/terraform.json": net/http: request canceled while waiting for connection (Client.Timeout exceeded while awaiting headers).
╵
╷
│ Error: Error accessing remote module registry
│
│ Failed to retrieve available versions for module "vpc" (main.tf:1) from registry.terraform.io: Failed to request discovery document: Get
│ "https://registry.terraform.io/.well-known/terraform.json": net/http: request canceled while waiting for connection (Client.Timeout exceeded while awaiting headers).
╵
bash-5.1# curl https://checkpoint-api.hashicorp.com/v1/check/terraform?arch=amd64&os=linux&signature=6935a4be-5f95-e966-58da-a1fe8d135790&version=0.14.10
[1] 505
[2] 506
[3] 507
[2]- Done os=linux
bash-5.1# {"product":"terraform","current_version":"1.0.1","current_release":1624550981,"current_download_url":"https://releases.hashicorp.com/terraform/1.0.1/","current_changelog_url":"https://github.com/hashicorp/terraform/blob/v1.0.1/CHANGELOG.md","project_website":"https://www.terraform.io","alerts":[]}
[1]- Done curl https://checkpoint-api.hashicorp.com/v1/check/terraform?arch=amd64
[3]+ Done signature=6935a4be-5f95-e966-58da-a1fe8d135790
The issue is with dns on your mac. Open your network preferences and go to DNS servers listing tab and delete all the ip addresses there. the issue will be fixed. Took me 2 days to figure it out.
Yeah setting DNS to 8.8.8.8 resolved my issues https://www.support.com/how-to/how-to-change-dns-settings-on-a-mac-10189
I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.
Terraform Version
Terraform Configuration Files
Expected Behavior
Expected init to work
Actual Behavior
Initializing provider plugins...
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)
Steps to Reproduce
terraform init
Additional Context
I can use curl and access the url that terraform says it can't access with no issues I've tried multiple times over 2 days and issue doesn't change. Terraform always fails, curl always succeeds Had no issues with 0.12, but 0.13 has not worked yet Terraform section was the only change made going to 0.13 This is on Mac I also tried with only the posted terraform config and still get same issue