Terraform: Run "Terraform plan" getting error "Failed to request discovery document"

Created on 12 Sep 2019  路  16Comments  路  Source: hashicorp/terraform

Terraform Version

Terraform v0.11.14

Terraform Configuration Files

terraform {
  backend "remote" {
    hostname = "terraform.abc.io"
    organization = "Security"

    workspaces {
      name = "monitoring"
    }
  }
}

Debug Output

Crash Output

Expected Behavior

display plan

Actual Behavior


getting below error

Error configuring the backend "remote": Failed to request discovery document: Get https://terraform.abc.io/.well-known/terraform.json: net/http: request canceled while waiting for connection (Client.Timeout exceeded while awaiting headers)

Please update the configuration in your Terraform files to fix this error
then run this command again.

Steps to Reproduce

  1. terraform init
  2. terraform plan

Additional Context

References

backenremote bug v0.11 v0.12

Most helpful comment

I am getting this a lot recently, seems like a very short timeout is set on this request. Right now in Singapore it's failing for me on ~50% of import, plan or apply commands, seemingly at random.

edit: terraform v0.12.24

All 16 comments

Hi @jennihan!

Based on the fact that you are using the remote backend with a hostname other than app.terraform.io, we're assuming you're a Terraform Enterprise customer. If so, we'd recommend contacting the Terraform Enterprise support team about this, as they can provide more tailored advice due to having more context about how your Terraform Enterprise deployment is configured.

@jennihan was the issue has been resolved?

I get this at random times also, I don't know if it is a coincidence, but I seem to get it more after an aborted terraform, when I have to manually release the lock... First time it fails with the above and succeeds there-on.

Error: Failed to request discovery document: Get https://app.terraform.io/.well-known/terraform.json: net/http: request canceled while waiting for connection (Client.Timeout exceeded while awaiting headers)

I am getting this a lot recently, seems like a very short timeout is set on this request. Right now in Singapore it's failing for me on ~50% of import, plan or apply commands, seemingly at random.

edit: terraform v0.12.24

I'm good if I don't use -parallelism.

@alen-z can you please also note what terraform version you're using?

Terraform v0.12.24

I am getting this a lot recently, seems like a very short timeout is set on this request. Right now in Singapore it's failing for me on ~50% of import, plan or apply commands, seemingly at random.

edit: terraform v0.12.24

I'm getting this intermittently running terraform apply from Malaysia (usually in the evenings)...

Terraform v0.12.26

Same intermittent error with 0.12.28 from Sydney

I Have the same problem:
terraform 0.12.24


2020/06/29 09:09:29 [TRACE] HTTP client GET request to https://registry.terraform.io/.well-known/terraform.json
2020/06/29 09:09:32 [ERR] Checkpoint error: Get https://checkpoint-api.hashicorp.com/v1/check/terraform?arch=amd64&os=linux&signature=df7afca7-9552-b80b-2298-4a8246bd841f&version=0.12.24: net/http: request canceled while waiting for connection (Client.Timeout exceeded while awaiting headers)

2020/06/29 09:09:39 [DEBUG] Failed to request discovery document: Get https://registry.terraform.io/.well-known/terraform.json: proxyconnect tcp: net/http: TLS handshake timeout

@jim-hashicorp
@hashicorp-cloud

Same problem here - London, UK

Having the same problem lately. So annoying. My continuous integration is blocked.

I started having this today.
Poland, Germany (VPN), USA (VPN), second network... all fails.

What's annoying about this issue is that it will probably never affect anyone with commit access.

In my case, it occurred to be some weird issue with aws-vault and credentials.
I used aws-vault with --no-session parameter and it started to fail. After opening the new terminal window problem disappeared.

If you're a mac user you can try removing _expired_ certificates from your keychain - https://discuss.hashicorp.com/t/error-when-running-terraform-init/3135/3

Make sure you go through both system & login certificates

Was this page helpful?
0 / 5 - 0 ratings