-
Notifications
You must be signed in to change notification settings - Fork 9.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Error: Failed to query available provider packages: Client.Timeout exceeded while awaiting headers #26532
Comments
Im having the same issue trying to use the helm provider:
Error Message:`Initializing the backend... Successfully configured the backend "s3"! Terraform will automatically Initializing provider plugins...
Error: Failed to query available provider packages Could not retrieve the list of available versions for provider hashicorp/helm: |
Thank you for the report! Short of more information to help replicate this issue, I've tagged this as a registry issue as perhaps the concern may lie there. @crosbymichael1 -- it looks like your message cut of at the error message, so I'm not sure you have the same error here (the timeout). |
@pselle I figured out what was going on so I did a tg apply in one of the helm folders and got this error, which I thought was pretty weird because there is 100% a helm provider version > 1.3
After changing the version a bunch of times I found out that since I already had a different version of the binary in my tf plugins folder, that instead of downloading the new version, terraform just checked locally to see what I had installed, and since only 10.5 is there, well that is the only version I'd be allowed to use |
Thanks for the additional information @crosbymichael1! I've re-added the |
@snemetz Try to delete your local aws file in the terraform plugins folder and then rerun terraform init and see if it resolves your issue: rm -rf ~/.terraform.d/plugins/registry.terraform.io/hashicorp/aws If your changing aws provider version I have a feeling if terraform see you already have a provider installed locally then its only checking for versions within your local folder and not out in the terraform registry. |
That dir was empty. plugin-cache had a lot of versions. Remove all ./plugin-cache: ./plugin-cache/darwin_amd64: ./plugins: ./plugins/darwin_amd64:` Made no change. Same error. |
Debug log
|
I have this issue as well, its been happening since I switched to using any 0.13.x version. To me it looks like the new provider resolution functionality doesn't function correctly with having set a |
This may actually be a case of #26223 Edit: Yep, I just fixed my case of this issue with @snemetz Does this work for you? |
I can't speak for snemetz but I appear to be seeing the same issue and I have no files in ~/.terraform.d/ besides a checkpoint_signature file |
It looks like there are two different problems being reported in this issue: a registry timeout error for the AWS provider, and some provider installer-specific questions and issues. I'll see how many I can address! Error: Failed to query available provider packages w/net/http: request canceled while waiting for connectionUnfortunately I am not sure what caused this - I can't reproduce the issue now, and it's suspicious that Terraform not updating provider versionTerraform v0.13 will not query the registry for any provider it finds locally installed under This mechanism is changing in v0.14 so there is a separate installation directory for locally installed (non-registry) providers; I'm afraid I will mangle the details but you can take a look at the (draft!!) of the v0.14 upgrade guide for a nice explanation of the new options: https://github.com/hashicorp/terraform/blob/master/website/upgrade-guides/0-14.html.markdown#the-local-provider-cache-directory The TL;DR is that we recommend you use the filesystem_mirror configuration for local providers, but in v0.14 you will also be able to drop them in the following directory (relative to the terraform configuration files): Issues when setting plugin_cache_dir to implicit local mirror directory #26223Terraform expects to write to the |
Quick update: the registry team dug into their logs based on the timestamp on the original reported issue, and did not see anything suspicious, nor were there any reported outages with our various service providers. At this point I can't offer any explanation for the timeout beyond "vague unspecified network hiccups", but we'll definitely keep our eyes open and dig in if this happens again. |
I am currently verifying and seeing the issue consistently.
My versions.tf file for the module seeing the error is the following
This looks to be the same scenario as the original reported issue. We use no in-house providers, only the hashicorp AWS provider. |
@C-Howard thanks! Is that happening right now ? I'll report this to the registry folks; it will help if you can share your TRACE logs |
Yes it happens every time I run terraform init.
|
Thanks, I appreciate the quick response - we'll dig into this on our end. For anyone else reading this issue: Any new information is appreciated; anyone else experiencing this same issue please reply to the original comment with a 👍 (instead of adding comments that don't add information). |
This does not seem to be a registry issue Unless this can be figured out, 0.13 is a non-starter at my company |
Not sure if this will help. But I removed ~/.terraform and the error changed. `
Error: Failed to query available provider packages Could not retrieve the list of available versions for provider hashicorp/aws: And via curl |
@snemetz Thanks for the additional info! We're still not able to find any indication of failing requests at our application or CDN layer. Could you try a more detailed cURL request? I don't have the exact headers Terraform sends off-hand, but something like:
I'll try to recreate the exact headers and options now and update you when I have a better arg set. Also, where are you running these commands from? Are you on a home or office network, VPN, or if you're running this within a cloud provider, which provider and region? |
I did verify that the cURL above is the request that Terraform is making:
|
Works but terraform fails right afterward. In same shell
I'm running from home on a Mac. |
Well this is Officially Weird! We do update the go version and various dependencies with pretty much every release, and it is always possible that something in there is interacting with your local setup. Is there anything customized or atypical about your home network? Do you have a proxy/VPN/firewall/custom dns settings? What version mac os are you on? |
still occurs on |
Still having this issue on |
@0dragosh that was most likely the Fastly outage earlier today, see if your timing of it lines up with the incident on our status page or Fastly's. |
Timing coincides, thanks a lot for letting me know! |
i have the issue in 0.14.4 with the kubectl provider. For some reason it tries to download it from hashicorp/kubectl instead of gavinbunney/kubectl Could not retrieve the list of available versions for provider |
@LBoraz Thank you for trying to connect to a relevant issue, but I think you've actually run into something else! We also have discussion forums that might help in the future. What I suspect is happening for you is that you have a module that doesn't have the |
The issue is still present
In my case only if I use
this is my
|
I still have this issue with 0.15.0. Any updates on this? |
Same here. I have this issue with 0.15.0 |
Also having this issue |
I'm still getting this issue too, MacOS Downgraded to Terraform This problem completely borks a fresh install of Terraform. I couldn't even get copy-pasted example code from the official docs running, because I could never get past Seems like a cool tool, I hope this gets resolved soon! For the meantime I'm downgrading to the earlier version. For those also seeking to downgrade Terraform Switcher has worked great. |
It seems like this issue may have multiple underlying causes. For me, it seems to be a DNS issue. I originally shared a log here about seeing this error in WSL2, but like others if I downgraded to terraform 0.13 things worked fine. @apparentlymart replied there about differences between 0.13 and 0.14 but my issue went away for a couple days so I had nothing to go on. Since then, I've been 100% unable to run If I modify my If I turn on TF_LOG I see things like:
While I can have a second terminal window open looping on @apparentlymart mentioned some possible TLS changes, but if this were just a TLS or SSL issue, I don't believe changing nameservers would reliably resolve the issue for me. Below are my results of Editorial: I love terraform but this really needs to get resolved. Look at the number of issues if you search for the client timeout error message. I know those issues go back a few years and terraform has a lot of users but most of those issues have a good number of comments and other people commenting that they're having the same issue. There has to be some fundamental networking issue in terraform or the http client library it's using, otherwise simultaneous curl requests would be failing just like terraform. I'm going to find some time to try and compile and run terraform from source, if one of the developers wants to add a mess of logging output or try anything to resolve this, send me a branch name and I'll happily test it out and help as much as I can.
|
I have the same issue above. Resolved it by updating my DNS settings. |
I turned on my VPN and this resolved my issue. From what I read in other posts there is an issue with the DNS resolution with this version of Terraform. Before VPN:
After turning on VPN:
|
what change you did ? |
#26532 (comment) |
Hello, Starting with Terraform v1.0.1 the MacOS binary is natively compiled, allowing Terraform to use the host resolver. This should avoid most issues with DNS configuration, many of which show up as timeouts like shown here. Since this will likely resolve most of the issues represented by this thread I'm going to close it out. If anyone still encounters similar timeouts from the Terraform CLI on MacOS with v1.0.1 or newer, please file a new issue with the necessary information to reproduce it. Thanks! |
I'm still seeing this on WSL2 under windows. I'll get clean repro steps and create a new issue today or tomorrow. |
I am still getting this issue with Terraform 1.0.1 on an alpine docker image.
|
Yeah setting DNS to 8.8.8.8 resolved my issues |
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. |
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
The text was updated successfully, but these errors were encountered: