-
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
0.10.0: "terraform init" works, but "terraform plan" fails with "netrpc: connect: no such file or directory" #15756
Comments
Hi @patrickdappollonio! Sorry this isn't working. Based on what you describe here -- especially that it fails only when there's a resource block in the configuration -- it sounds like the plugin binary is failing to start up for some reason. Could you try running directly the command That it works okay with 0.9 is also very interesting. Is that using exactly the same provider binary as you're using with 0.10, or is it a separate build of the plugin that could potentially behave differently? |
I wonder if it fails because of the validation part of the schema. I have different builds for 0.9 and 0.10, since I don't want the vendored, frozen copy of terraform in 0.9 to misuse the same code in 0.10. And just to be fair, the provider used to use Let me know if you have any more questions! |
Thanks for this extra information, @patrickdappollonio! Just to constrain the possibilities here, could you try copying the plugin executable you're using with 0.9 to a location where your 0.10 install will find it, and try this again? Plugin binaries built for 0.9 should be compatible with 0.10, since there were no changes to the actual API here, just the discovery/installation mechanism. This test will hopefully allow us to narrow down whether the inconsistency lives on the side of Terraform core or on the side of the plugin itself (which includes some code from the core repository, included as a library, which may have changed.) |
Using terraform binary 0.10.0:
So, with
Now with a resource:
So it does work with an old binary with the repo at 0.9.11 vendored. I would expect that by doing the I'm here if you guys need any extra information. |
Just as an extra comment, I generate my binaries with the following command: GOOS=linux go build -a -tags netgo -ldflags '-s -w' -o $(FILENAME) |
I got this error when I built my plugin from the latest version of https://github.com/hashicorp/go-plugin. Using hashicorp/go-plugin@f72692a as frozen in the vendor file for https://github.com/terraform-providers/terraform-provider-azurerm fixed my problem. |
I can confirm @nbering's solution works. I pinned the package to
For the sake of completeness, here's both of my And here's a diff of both |
Tracking the issue further down the road, it definitely happens when Commit Pinning to |
Ahh right, yes... sorry that development work in Sorry this ended up falling on you both to debug. At the very least we should find somewhere visible to document this until we get Terraform itself ready to use the new grpc-based plugin protocol (which will be 0.11 at the absolute earliest, since it'd be a breaking change for existing plugin binaries) since I imagine all plugin developers will run into this if they're using the usual workflow of just taking what's on master when seeding a vendor dir. |
Well technically, we're vendoring |
There's some work going around in |
Hi all! After some internal discussion with the people who were working on The good news is that we think this can be addressed just by upgrading the Sorry again for this oversight, and thanks to @patrickdappollonio and @nbering for digging in and figuring out where the issue was coming from. |
This puts us on a version that has grpc protocol support. Although we're not actually using that yet, the plugin has handshake changed slightly to allow plugins to declare whether they use the old or new protocols, and so this upgrade allows us to support plugins that were built against newer versions of go-plugin that include this extra field in the handshake. This fixes #15756.
This puts us on a version that has grpc protocol support. Although we're not actually using that yet, the plugin has handshake changed slightly to allow plugins to declare whether they use the old or new protocols, and so this upgrade allows us to support plugins that were built against newer versions of go-plugin that include this extra field in the handshake. This fixes #15756.
This puts us on a version that has grpc protocol support. Although we're not actually using that yet, the plugin has handshake changed slightly to allow plugins to declare whether they use the old or new protocols, and so this upgrade allows us to support plugins that were built against newer versions of go-plugin that include this extra field in the handshake. This fixes #15756.
This puts us on a version that has grpc protocol support. Although we're not actually using that yet, the plugin has handshake changed slightly to allow plugins to declare whether they use the old or new protocols, and so this upgrade allows us to support plugins that were built against newer versions of go-plugin that include this extra field in the handshake. This fixes #15756.
I've upgraded Thanks again for the debugging effort here, and sorry we didn't catch this before the 0.10.0 release. |
To fix Bug with Plugins affected by hashicorp/terraform#15756 Upstream commit we need to fix Bug hashicorp/terraform@ee5fc3b
To fix Bug with Plugins affected by hashicorp/terraform#15756 Upstream commit we need to fix Bug hashicorp/terraform@ee5fc3b
Thanks! Some of that experimental work in go-plugin may have been triggered by some experimental work I was doing with an attempt to port the plugin interface to other languages. That stalled for the moment due to time constraints, but I still have a hopes of writing a NodeJS plugin interface with that added protocol buffers support. Hopefully pulling in those upstream changes will make it easier when I pick up on that experiment again. I was also a little surprised that |
Hi @nbering! Multi-language plugins are indeed the intended use-case here, though to be honest it's not Terraform driving that right now, but rather other things that also use |
@apparentlymart Ya, no problem. I honestly took on that project from a certain level of naivety. I was willing to read the code to figure out the protocol, but I didn't realize that the plugin API was like an iceberg. There's levels of the API that mimic the TCP protocol in software (yamux), but in the end the real killer up-front was that the gob protocol used by Go's RPC library was not even a little bit portable between languages. Not without some PHD-level work, anyway. I'm going to continue work on the protocol buffers implementation as I can, since it's a very interesting academic exercise - if nothing else - but there was definitely a lot more to it than I was initially expecting. If anyone is interested, I am willing to share the discoveries I maid with my first foray, and after a little more cleanup I'll open up my initial experiments, but it's definitely far from a working prototype. Specifically, Yamux remains the biggest sticking point. At this point I'm basically trying to implement Yamux in node without a test suite to work against. I'm also learning Go at the same time, so it's pretty exhausting work. Again, not pushing for any timelines or anything like that... it was just something I was playing with and asked a few questions on go-plugin and was really pleasantly surprised when @mitchellh came in with some commits that moved my project forward a bit. |
I'm running into this same issue as well. @patrickdappollonio are you saying there's not an easy way to resolve this with dep yet? I've been using glide and it doesn't look like there's a good solution for pinning to the older version of |
@jritsema it is definitely possible to solve it with [[override]]
name = "github.com/hashicorp/go-plugin"
revision = "b7d6477501c13292d71fd3b8e688269e51b028ba" For Glide is pretty much the same thing, followed by a - package: github.com/hashicorp/go-plugin
version: b7d6477501c13292d71fd3b8e688269e51b028ba |
Thanks @patrickdappollonio. I tried that and got the following error building my plugin...
Any idea which version of terraform is compatible? |
I'm running both 0.9.11 and 0.10.0 (both pinned with |
I tried both tf
|
That was it! Saw in Gopkg.lock that it was grabbing the 0.10.2. Sorry, first time using |
Perfect! And sorry, I misclicked the "delete comment" by mistake and there's no "are you sure?" message coming when you click it so sadly it's gone now. For people coming in because of the same issue, the problem was that |
To fix Bug with Plugins affected by hashicorp/terraform#15756 Upstream commit we need to fix Bug hashicorp/terraform@ee5fc3b
Thanks a lot for sharing this issue @patrickdappollonio ...was having some trouble to pin down the problem and this ticket was the salvation 🥇 |
- Pinned down a specific version of terraform plugins and terraform for compatibility reasons. Check the following link for more info: hashicorp/terraform#15756
- Pinned down a specific version of terraform plugins and terraform for compatibility reasons. Check the following link for more info: hashicorp/terraform#15756
- Pinned down a specific version of terraform plugins and terraform for compatibility reasons. Check the following link for more info: hashicorp/terraform#15756
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. |
Hello,
I have a custom provider called
myprovider
which I recently upgraded to terraform 0.10.0 using Godep
tool. My toml file looks like:Then I built the binary and delivered it as a zip file to a VM, along with the one available in the Terraform downloads page. I tried running some HCL file and it prompted me to run
terraform init
which I did, and then when ranterraform plan
I get the following:If I only define the provider with no resources, it works fine by saying "No changes. Infrastructure is up-to-date."
More info below:
Terraform Version
Terraform Configuration Files
This works (returns there's no changes and infrastructure is up-to-date):
Whereas this fails with the error mentioned above:
Do note that running
terraform apply
on 0.9.11 will fail since it doesn't have some required fields defined in the HCL code.Debug Output
Link here
Expected Behavior
It should detect and run the provider and say that the validation for required attributes failed.
Actual Behavior
It fails with the message
dial unix /tmp/plugin363438245|netrpc: connect: no such file or directory
Steps to Reproduce
Please list the steps required to reproduce the issue, for example:
terraform plan
. See it prompts for runningterraform init
.terraform init
, checks that it successfully executesterraform plan
again.terraform plan
again, notice it fails with the error message.Important Factoids
Virtual Machine, running Ubuntu:
The interesting part is, it only fails when adding a resource, but with no resource and just the provider declaration it works perfectly.
The text was updated successfully, but these errors were encountered: