Skip to content
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

Incompatible API version with plugin #30

Open
kostyrev opened this issue Nov 18, 2016 · 10 comments
Open

Incompatible API version with plugin #30

kostyrev opened this issue Nov 18, 2016 · 10 comments

Comments

@kostyrev
Copy link

cd example/
terraform plan
Error configuring: 1 error(s) occurred:

* Incompatible API version with plugin. Plugin version: 2, Ours: 1
$ terraform -v
Terraform v0.7.9

Your version of Terraform is out of date! The latest version
is 0.7.11. You can update by downloading from www.terraform.io

Am I the only one with this error?

@AndreaCrotti
Copy link

Yep got the same error sadly @kostyrevaa

@akerl
Copy link

akerl commented Nov 24, 2016

This seems to be caused by this commit: hashicorp/terraform@b3124e1

They've bumped the number in the repo, so things built against HEAD of terraform will be version 2.

@AndreaCrotti
Copy link

Ah thanks @akerl
Can I recompile it myself somehow otherwise in the meanwhile?

@cocoy
Copy link

cocoy commented Nov 26, 2016

@AndreaCrotti we're you able to recompile it? Or any instructions how to recompile this? thanks.

@kostyrev
Copy link
Author

@cocoy Here are instructions how to recompile on Fedora 24 box

$ vagrant init fedora/24-cloud-base; vagrant up --provider virtualbox
$ vagrant ssh default
[vagrant@localhost ~]$ sudo dnf install go -y
[vagrant@localhost ~]$ mkdir -p $HOME/work
[vagrant@localhost ~]$ echo 'export GOPATH=$HOME/work' >> $HOME/.bashrc
[vagrant@localhost ~]$  source $HOME/.bashrc
[vagrant@localhost ~]$ go env | grep GOPATH
GOPATH="/home/vagrant/work"
[vagrant@localhost ~]$ go env | grep GOROOT
GOROOT="/usr/lib/golang"
[vagrant@localhost ~]$ sudo dnf install git -y
[vagrant@localhost ~]$ cd $GOPATH
[vagrant@localhost work]$ mkdir {src,pkg,bin}
[vagrant@localhost work]$ cd src/
[vagrant@localhost src]$ git clone https://github.com/jonmorehouse/terraform-provisioner-ansible
[vagrant@localhost src]$ cd terraform-provisioner-ansible/
[vagrant@localhost terraform-provisioner-ansible]$ go get -v
[vagrant@localhost terraform-provisioner-ansible]$ go build

after build you'll find binary in $GOPATH/bin/

@cocoy
Copy link

cocoy commented Nov 26, 2016

Thanks @kostyrevaa

@boznius
Copy link

boznius commented Mar 26, 2017

@akostyrev

Tried your method a few minutes ago , but it errors out maybe something connected with the Go version ?

[vagrant@localhost terraform-provisioner-ansible]$ go get -v package context: unrecognized import path "context" (import path does not begin with hostname) [vagrant@localhost terraform-provisioner-ansible]$ pwd /home/vagrant/work/src/terraform-provisioner-ansible [vagrant@localhost terraform-provisioner-ansible]$ go version go version go1.6.4 linux/amd64 [vagrant@localhost terraform-provisioner-ansible]$ pwd /home/vagrant/work/src/terraform-provisioner-ansible [vagrant@localhost terraform-provisioner-ansible]$ ll total 79756 -rwxrwxr-x. 1 vagrant vagrant 5377 Mar 26 14:02 ansible-local.py drwxrwxr-x. 4 vagrant vagrant 4096 Mar 26 14:02 example -rw-rw-r--. 1 vagrant vagrant 81618401 Sep 7 2016 go1.7.1.linux-amd64.tar.gz -rw-rw-r--. 1 vagrant vagrant 226 Mar 26 14:02 Godeps -rw-rw-r--. 1 vagrant vagrant 336 Mar 26 14:02 main.go -rw-rw-r--. 1 vagrant vagrant 5306 Mar 26 14:29 provisioner.go -rw-rw-r--. 1 vagrant vagrant 945 Mar 26 14:02 provisioner_test.go -rw-rw-r--. 1 vagrant vagrant 2647 Mar 26 14:02 README.md -rw-rw-r--. 1 vagrant vagrant 3108 Mar 26 14:02 resource_provisioner.go -rw-rw-r--. 1 vagrant vagrant 1103 Mar 26 14:02 resource_provisioner_test.go -rw-rw-r--. 1 vagrant vagrant 45 Mar 26 14:02 version.go [vagrant@localhost terraform-provisioner-ansible]$

Let me know how i can build this for myself , are there any official requirements list or supported versions of Go or anything else ?

Thanks in advance !

@kostyrev
Copy link
Author

kostyrev commented Mar 26, 2017

@bbozhev according to this Go version 1.8+ is required to build terraform sources.
You could try to use

curl -o fedora-rawhide.box https://dl.fedoraproject.org/pub/fedora/linux/development/rawhide/CloudImages/x86_64/images/Fedora-Cloud-Base-Vagrant-Rawhide-20170326.n.0.x86_64.vagrant-virtualbox.box
vagrant box add fedora-rawhide ./fedora-rawhide.box
vagrant init fedora-rawhide

Update: it seems that rawhide box does not boot up.
So you'll have to figure out how to install go1.8 in distro of your choice or use docker image.

@boznius
Copy link

boznius commented Mar 26, 2017

@akostyrev thanks for the hint , but now i have the following issue :
`
go version go1.8 darwin/amd64
boz@bdogs:[~/.go/src/terraform-provisioner-ansible]$ go get -v
github.com/hashicorp/terraform (download)
.........
github.com/hashicorp/terraform/plugin
github.com/hashicorp/terraform/communicator
terraform-provisioner-ansible

terraform-provisioner-ansible

./main.go:9: cannot use ResourceProvisioner literal (type *ResourceProvisioner) as type terraform.ResourceProvisioner in return argument:
*ResourceProvisioner does not implement terraform.ResourceProvisioner (missing Stop method)
boz@bdogs:[~/.go/src/terraform-provisioner-ansible]$ go build

terraform-provisioner-ansible

./main.go:9: cannot use ResourceProvisioner literal (type *ResourceProvisioner) as type terraform.ResourceProvisioner in return argument:
*ResourceProvisioner does not implement terraform.ResourceProvisioner (missing Stop method)
`

I have the same error on fedora with :

./main.go:9: cannot use ResourceProvisioner literal (type *ResourceProvisioner) as type terraform.ResourceProvisioner in return argument: *ResourceProvisioner does not implement terraform.ResourceProvisioner (missing Stop method) [vagrant@localhost terraform-provisioner-ansible]$ go version go version go1.8 linux/amd64

Does anything come to your mind ?

@kostyrev
Copy link
Author

@bbozhev no idea

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants