terra-farm / terraform-provider-virtualbox

VirtualBox provider for Terraform
https://terra-farm.github.io/provider-virtualbox/
MIT License
324 stars 136 forks source link

Plugin reinitialization required. Please run "terraform init". #35

Closed cmoulliard closed 5 years ago

cmoulliard commented 5 years ago

Version

Terraform: v0.11.10 Terraform-provider-virtualbox: latest installed using ()

Steps to reproduce

cd $GOPATH/src/github.com/terra-form/terraform-provider-virtualbox/examples
terraform plan
Plugin reinitialization required. Please run "terraform init".
Reason: Could not satisfy plugin requirements.

Plugins are external binaries that Terraform uses to access and manipulate
resources. The configuration provided requires plugins which can't be located,
don't satisfy the version constraints, or are otherwise incompatible.

1 error(s) occurred:

* provider.virtualbox: no suitable version installed
  version requirements: "(any version)"
  versions installed: none

Terraform automatically discovers provider requirements from your
configuration, including providers used in child modules. To see the
requirements and constraints from each module, run "terraform providers".

Error: error satisfying plugin requirements

Initializing provider plugins...

Provider "virtualbox" not available for installation.

A provider named "virtualbox" could not be found in the official repository.

This may result from mistyping the provider name, or the given provider may be a third-party provider that cannot be installed automatically.

In the latter case, the plugin must be installed manually by locating and downloading a suitable distribution package and placing the plugin's executable file in the following directory: terraform.d/plugins/darwin_amd64

Terraform detects necessary plugins by inspecting the configuration and state. To view the provider versions requested by each module, run "terraform providers".

cmoulliard commented 5 years ago

Solution is first to copy or move the virtualbox provider

export OS=darwin_amd64 // or linux, ....
mkdir -p ~/.terraform.d/plugins/${OS}
cp $GOPATH/bin/terraform-provider-virtualbox ~/.terraform.d/plugins/${OS}
terraform init
terraform plan
terraform apply

Can you please add such info to the README page please ?

ringods commented 5 years ago

@cmoulliard We have added the manual installation instructions: https://terra-farm.github.io/main/installation.html

As long as Terraform itself can't download third-party providers from non-Hashicorp sites, this is the best we can do.

Meanwhile, we released a TF 0.12 compatible version: https://github.com/terra-farm/terraform-provider-virtualbox/releases/tag/v0.2.0