You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When running a terraform init on a system that is providing the authority information in the DNS response, Terraform isn't querying the correct IP address for registry.terraform.io, causing the init to fail. If the authority information isn't provided in the DNS response, Terraform works without issue.
Terraform Version
$ terraform version
Terraform v1.0.3
on linux_amd64
$ tf init
Initializing the backend...
Initializing provider plugins...
- Finding hashicorp/aws versions matching ">= 3.52.0"...
- Installing hashicorp/aws v3.52.0...
- Installed hashicorp/aws v3.52.0 (signed by HashiCorp)
Partner and community providers are signed by their developers.
If you'd like to know more about provider signing, you can read about it here:
https://www.terraform.io/docs/cli/plugins/signing.html
Terraform has created a lock file .terraform.lock.hcl to record the provider
selections it made above. Include this file in your version control repository
so that Terraform can guarantee to make the same selections by default when
you run "terraform init" in the future.
Terraform has been successfully initialized!
You may now begin working with Terraform. Try running "terraform plan" to see
any changes that are required for your infrastructure. All Terraform commands
should now work.
If you ever set or change modules or backend configuration for Terraform,
rerun this command to reinitialize your working directory. If you forget, other
commands will detect it and remind you to do so if necessary.
Actual Behavior
$ tf init
Initializing the backend...
Initializing provider plugins...
- Finding hashicorp/aws versions matching ">= 3.52.0"...
╷
│ Error: Failed to query available provider packages
│
│ Could not retrieve the list of available versions for provider hashicorp/aws: could not connect to registry.terraform.io: Failed to request discovery document: Get
│ "https://registry.terraform.io/.well-known/terraform.json": net/http: TLS handshake timeout
╵
Steps to Reproduce
On WSL (windows subsystem for Linux) Ubuntu 20.04 with the authority information being sent in the DNS repsonse: terraform init
Additional Context
When running a terraform init, Terraform reaches out to registry.terraform.io. However, a packet capture shows that Terraform is trying to reach out to a NS server returned in the DNS request. For example, based on the output below, terraform is trying to talk to 23.235.32.32. However, this is wrong. It should be connecting to 199.232.6.49. The TLS handshake message is misleading because the server hello packet is never sent from the NS server (nor should it). Here is a nslookup:
Could you provide some more information on the DNS configuration you are using? You mention the added authority section, but neither response contains an ;; AUTHORITY SECTION: in the output. The ns server A records with 0 ttl do look strange to me, but it's been a while since I've had to troubleshoot these things.
We've seen various similar issues in combination with Windows or WSL, but it's usually turned out to be network configuration problems that Terraform cannot avoid on its own. Terraform also is not specifically interpreting the DNS response on it's own, but I do not see any mention of similar issues upstream either.
After more searching, I may have jumped the gun. I found microsoft/WSL#5806, which indicates the issue is on Microsoft's side in regards to how they are returning the DNS response.
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.
When running a
terraform init
on a system that is providing the authority information in the DNS response, Terraform isn't querying the correct IP address for registry.terraform.io, causing theinit
to fail. If the authority information isn't provided in the DNS response, Terraform works without issue.Terraform Version
Terraform Configuration Files
Expected Behavior
Actual Behavior
Steps to Reproduce
On WSL (windows subsystem for Linux) Ubuntu 20.04 with the authority information being sent in the DNS repsonse:
terraform init
Additional Context
When running a
terraform init
, Terraform reaches out toregistry.terraform.io
. However, a packet capture shows that Terraform is trying to reach out to a NS server returned in the DNS request. For example, based on the output below, terraform is trying to talk to 23.235.32.32. However, this is wrong. It should be connecting to 199.232.6.49. The TLS handshake message is misleading because the server hello packet is never sent from the NS server (nor should it). Here is a nslookup:And here is a dig:
This is what a dig looks like when terraform works, notice the answer section doens't include the authority info in the response:
The text was updated successfully, but these errors were encountered: