Incompatible API version with plugin. Plugin version: 2, Ours: 1

344 views
Skip to first unread message

Svend Sorensen

unread,
Oct 8, 2014, 2:51:28 PM10/8/14
to terrafo...@googlegroups.com
I'm getting the following error when building and running the dummy provider plugin plugin.

Incompatible API version with plugin. Plugin version: 2, Ours: 1

I have terraform v0.2.2 checked out and built, and I have been unable to figure why the plugin is building as v2.


Commands I am using to build are:

rm -rf $GOPATH
git checkout -b v0.2.2-branch v0.2.2
make updatedeps
make
make dev
go build -o terraform-provider-dummy
terraform plan


Here is the build environment and package versions.

echo $GOPATH
/Users/ssorensen/gocode
which terraform
/Users/ssorensen/gocode/bin/terraform
terraform --version
Terraform v0.2.2
cd $GOPATH/src/github.com/hashicorp/terraform; git describe --tags
v0.2.2
grep 'const APIVersion' $GOPATH/src/github.com/hashicorp/terraform/plugin/server.go
const APIVersion = "1" 

Mitchell Hashimoto

unread,
Oct 8, 2014, 3:04:41 PM10/8/14
to Svend Sorensen, <terraform-tool@googlegroups.com>
Svend,

The problem is because Go is unfortunately picking up the latest
version (master). That is quite annoying. The only solution I can
think of is to go into $GOPATH/src/github.com/hashicorp/terraform and
manually `git checkout v0.2.2` to match the versions.

Terraform 0.3 is actually not too far off now....

Best,
Mitchell
> --
> You received this message because you are subscribed to the Google Groups
> "Terraform" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to terraform-too...@googlegroups.com.
> To post to this group, send email to terrafo...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/terraform-tool/03d86a0d-4ce9-4715-8230-545bb68623e6%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

Svend Sorensen

unread,
Oct 8, 2014, 3:15:32 PM10/8/14
to terrafo...@googlegroups.com, sv...@ciffer.net
I am checking out v0.2.2 in my build script.

git checkout -b v0.2.2-branch v0.2.2


cd $GOPATH/src/github.com/hashicorp/terraform; git describe --tags
v0.2.2


Someone on #terraform-tool tried the same build commands, and it worked for them. I'm not sure what is wrong with my setup.

Thanks,
Svend

Mitchell Hashimoto

unread,
Oct 8, 2014, 3:17:52 PM10/8/14
to Svend Sorensen, <terraform-tool@googlegroups.com>
Svend,

I can see this isn't happening (or not obviously happening), but if
you're somehow calling `go get` anywhere in there, I think that resets
to master. :-\ I see you're checking before/after though so I don't
know.

There are some shenanigans happening somewhere.

Best,
Mitchell
> https://groups.google.com/d/msgid/terraform-tool/b4cd8648-c3a0-4cc6-83b4-7702e8ba3796%40googlegroups.com.

Svend Sorensen

unread,
Oct 8, 2014, 3:29:21 PM10/8/14
to terrafo...@googlegroups.com, sv...@ciffer.net
Copying the terraform-provider-dummy binary to $GOPATH/bin, which is in my PATH fixed the error. If I remove it from that directory, the API mismatch error comes back.

I missed that step from the blog post, and the error message was confusing me, since it seemed to be loading the plugin from the CWD (just with an API mismatch).

Thanks to svanharmelen on IRC for getting me sorted out.

Svend
Reply all
Reply to author
Forward
0 new messages