Followed the tutorial and getting Error: Failed to query available provider packages
.
Tried the following as resolutions.
- Made sure there is no corporate firewall or VPN.
- I tried cleaning out all the unnecessary certificates
- ran in sudo
- rebooted the mac.
Nothing helps, still getting this error.
Running on OSX Catalina (10.15.6) with iTerm and Zsh. Docker desktop version 2.3.0.5 (engine: 19.03.12). Running curl works perfectly fine on the urls as you can see at the bottom. Just terraform init
fails.
➜ terraform-docker-demo terraform init
2020/09/24 00:01:08 [INFO] Terraform version: 0.13.3
2020/09/24 00:01:08 [INFO] Go runtime version: go1.14.7
2020/09/24 00:01:08 [INFO] CLI args: []string{"/usr/local/bin/terraform", "init"}
2020/09/24 00:01:08 [DEBUG] Attempting to open CLI config file: /Users/sai.puli/.terraformrc
2020/09/24 00:01:08 [DEBUG] File doesn't exist, but doesn't need to. Ignoring.
2020/09/24 00:01:08 [DEBUG] ignoring non-existing provider search directory terraform.d/plugins
2020/09/24 00:01:08 [DEBUG] ignoring non-existing provider search directory /Users/sai.puli/.terraform.d/plugins
2020/09/24 00:01:08 [DEBUG] ignoring non-existing provider search directory /Users/sai.puli/Library/Application Support/io.terraform/plugins
2020/09/24 00:01:08 [DEBUG] ignoring non-existing provider search directory /Library/Application Support/io.terraform/plugins
2020/09/24 00:01:08 [INFO] CLI command args: []string{"init"}
Initializing the backend...
2020/09/24 00:01:08 [TRACE] Meta.Backend: no config given or present on disk, so returning nil config
2020/09/24 00:01:08 [TRACE] Meta.Backend: backend has not previously been initialized in this working directory
2020/09/24 00:01:08 [DEBUG] New state was assigned lineage "aba0361d-7979-2835-5700-4134cc8d04ec"
2020/09/24 00:01:08 [TRACE] Meta.Backend: using default local state only (no backend configuration, and no existing initialized backend)
2020/09/24 00:01:08 [TRACE] Meta.Backend: instantiated backend of type <nil>
2020/09/24 00:01:08 [DEBUG] checking for provisioner in "."
2020/09/24 00:01:08 [DEBUG] checking for provisioner in "/usr/local/bin"
2020/09/24 00:01:08 [INFO] Failed to read plugin lock file .terraform/plugins/darwin_amd64/lock.json: open .terraform/plugins/darwin_amd64/lock.json: no such file or directory
2020/09/24 00:01:08 [TRACE] Meta.Backend: backend <nil> does not support operations, so wrapping it in a local backend
2020/09/24 00:01:08 [TRACE] backend/local: state manager for workspace "default" will:
- read initial snapshot from terraform.tfstate
- write new snapshots to terraform.tfstate
- create any backup at terraform.tfstate.backup
2020/09/24 00:01:08 [TRACE] statemgr.Filesystem: reading initial snapshot from terraform.tfstate
2020/09/24 00:01:08 [TRACE] statemgr.Filesystem: snapshot file has nil snapshot, but that's okay
2020/09/24 00:01:08 [TRACE] statemgr.Filesystem: read nil snapshot
2020/09/24 00:01:08 [TRACE] providercache.fillMetaCache: scanning directory .terraform/plugins
2020/09/24 00:01:08 [TRACE] getproviders.SearchLocalDirectory: failed to resolve symlinks for .terraform/plugins: lstat .terraform: no such file or directory
Initializing provider plugins...
2020/09/24 00:01:08 [TRACE] providercache.fillMetaCache: error while scanning directory .terraform/plugins: cannot search .terraform/plugins: lstat .terraform/plugins: no such file or directory
2020/09/24 00:01:08 [WARN] Failed to scan provider cache directory .terraform/plugins: cannot search .terraform/plugins: lstat .terraform/plugins: no such file or directory
- Finding latest version of terraform-providers/docker...
2020/09/24 00:01:08 [DEBUG] Service discovery for registry.terraform.io at https://registry.terraform.io/.well-known/terraform.json
2020/09/24 00:01:08 [TRACE] HTTP client GET request to https://registry.terraform.io/.well-known/terraform.json
2020/09/24 00:01:11 [ERR] Checkpoint error: Get "https://checkpoint-api.hashicorp.com/v1/check/terraform?arch=amd64&os=darwin&signature=&version=0.13.3": context deadline exceeded (Client.Timeout exceeded while awaiting headers)
2020/09/24 00:01:19 [DEBUG] GET https://registry.terraform.io/v1/providers/terraform-providers/docker/versions
2020/09/24 00:01:19 [TRACE] HTTP client GET request to https://registry.terraform.io/v1/providers/terraform-providers/docker/versions
2020/09/24 00:01:29 [ERR] GET https://registry.terraform.io/v1/providers/terraform-providers/docker/versions request failed: Get "https://registry.terraform.io/v1/providers/terraform-providers/docker/versions": context deadline exceeded (Client.Timeout exceeded while awaiting headers)
2020/09/24 00:01:29 [DEBUG] GET https://registry.terraform.io/v1/providers/terraform-providers/docker/versions: retrying in 1s (1 left)
2020/09/24 00:01:30 [INFO] Previous request to the remote registry failed, attempting retry.
2020/09/24 00:01:30 [TRACE] HTTP client GET request to https://registry.terraform.io/v1/providers/terraform-providers/docker/versions
2020/09/24 00:01:40 [ERR] GET https://registry.terraform.io/v1/providers/terraform-providers/docker/versions request failed: Get "https://registry.terraform.io/v1/providers/terraform-providers/docker/versions": context deadline exceeded (Client.Timeout exceeded while awaiting headers)
Error: Failed to query available provider packages
Could not retrieve the list of available versions for provider
terraform-providers/docker: could not query provider registry for
registry.terraform.io/terraform-providers/docker: the request failed after 2
attempts, please try again later: Get
"https://registry.terraform.io/v1/providers/terraform-providers/docker/versions":
context deadline exceeded (Client.Timeout exceeded while awaiting headers)
➜ terraform-docker-demo curl https://checkpoint-api.hashicorp.com/v1/check/terraform\?arch\=amd64\&os\=darwin\&signature\=\&version\=0.13.3
{"product":"terraform","current_version":"0.13.3","current_release":1600286461,"current_download_url":"https://releases.hashicorp.com/terraform/0.13.3/","current_changelog_url":"https://github.com/hashicorp/terraform/blob/v0.13.3/CHANGELOG.md","project_website":"https://www.terraform.io","alerts":[]}%
➜ terraform-docker-demo curl https://registry.terraform.io/.well-known/terraform.json
{"modules.v1":"/v1/modules/","providers.v1":"/v1/providers/"}
➜ terraform-docker-demo curl https://registry.terraform.io/v1/providers/terraform-providers/docker/versions
{"id":"terraform-providers/docker","versions":[{"version":"1.1.0","protocols":["4"],"platforms":[{"os":"darwin","arch":"amd64".......%