josenk / terraform-provider-esxi

Terraform-provider-esxi plugin
GNU General Public License v3.0
540 stars 154 forks source link

OSX - Error: Failed to install provider #119

Closed scaery closed 4 years ago

scaery commented 4 years ago

Reference:

  1. https://stackoverflow.com/questions/63381671/unable-to-load-exsi-terraform-provider-on-mac-catalina
  2. https://serverfault.com/questions/1029858/unable-to-load-exsi-terraform-provider-on-mac-catalina

Experiencing the same issue:

My Log from OSX:

$ export TF_LOG=TRACE
$ terraform init

2020/08/13 22:06:42 [INFO] Terraform version: 0.13.0
2020/08/13 22:06:42 [INFO] Go runtime version: go1.13.15
2020/08/13 22:06:42 [INFO] CLI args: []string{"/usr/local/bin/terraform", "init"}
2020/08/13 22:06:42 [DEBUG] Attempting to open CLI config file: /Users/scaery/.terraformrc
2020/08/13 22:06:42 [DEBUG] File doesn't exist, but doesn't need to. Ignoring.
2020/08/13 22:06:42 [DEBUG] checking for credentials in "/Users/scaery/.terraform.d/plugins"
2020/08/13 22:06:42 [DEBUG] ignoring non-existing provider search directory terraform.d/plugins
2020/08/13 22:06:42 [DEBUG] will search for provider plugins in /Users/scaery/.terraform.d/plugins
2020/08/13 22:06:42 [DEBUG] ignoring non-existing provider search directory /Users/scaery/Library/Application Support/io.terraform/plugins
2020/08/13 22:06:42 [DEBUG] ignoring non-existing provider search directory /Library/Application Support/io.terraform/plugins
2020/08/13 22:06:42 [INFO] CLI command args: []string{"init"}

Initializing the backend...
2020/08/13 22:06:42 [TRACE] Meta.Backend: no config given or present on disk, so returning nil config
2020/08/13 22:06:42 [TRACE] Meta.Backend: backend has not previously been initialized in this working directory
2020/08/13 22:06:42 [DEBUG] New state was assigned lineage "31f2e924-268f-22c4-45f2-63a1c45c638f"
2020/08/13 22:06:42 [TRACE] Meta.Backend: using default local state only (no backend configuration, and no existing initialized backend)
2020/08/13 22:06:42 [TRACE] Meta.Backend: instantiated backend of type <nil>
2020/08/13 22:06:42 [DEBUG] checking for provisioner in "."
2020/08/13 22:06:42 [DEBUG] checking for provisioner in "/usr/local/bin"
2020/08/13 22:06:42 [DEBUG] checking for provisioner in "/Users/scaery/.terraform.d/plugins"
2020/08/13 22:06:42 [INFO] Failed to read plugin lock file .terraform/plugins/darwin_amd64/lock.json: open .terraform/plugins/darwin_amd64/lock.json: no such file or directory
2020/08/13 22:06:42 [TRACE] Meta.Backend: backend <nil> does not support operations, so wrapping it in a local backend

Initializing provider plugins...
2020/08/13 22:06:42 [TRACE] backend/local: state manager for workspace "default" will:
 - read initial snapshot from terraform.tfstate
 - write new snapshots to terraform.tfstate
 - create any backup at terraform.tfstate.backup
2020/08/13 22:06:42 [TRACE] statemgr.Filesystem: reading initial snapshot from terraform.tfstate
2020/08/13 22:06:42 [TRACE] statemgr.Filesystem: snapshot file has nil snapshot, but that's okay
2020/08/13 22:06:42 [TRACE] statemgr.Filesystem: read nil snapshot
2020/08/13 22:06:42 [TRACE] providercache.fillMetaCache: scanning directory .terraform/plugins
2020/08/13 22:06:42 [DEBUG] Service discovery for registry.terraform.io at https://registry.terraform.io/.well-known/terraform.json
2020/08/13 22:06:42 [TRACE] HTTP client GET request to https://registry.terraform.io/.well-known/terraform.json
- Finding latest version of hashicorp/esxi...
2020/08/13 22:06:42 [DEBUG] GET https://registry.terraform.io/v1/providers/hashicorp/esxi/versions
2020/08/13 22:06:42 [TRACE] HTTP client GET request to https://registry.terraform.io/v1/providers/hashicorp/esxi/versions
2020/08/13 22:06:42 [DEBUG] GET https://registry.terraform.io/v1/providers/-/esxi/versions
2020/08/13 22:06:42 [TRACE] HTTP client GET request to https://registry.terraform.io/v1/providers/-/esxi/versions

Error: Failed to install provider

Error while installing hashicorp/esxi: provider registry registry.terraform.io
does not have a provider named registry.terraform.io/hashicorp/esxi

Is the provider somehow not registered? Where do I have to fix it?

josenk commented 4 years ago

I just added this provider to the terraform registry. See the updated README for more information.

Here is an example block to add to your existing terraform project to download the provider automatically.

https://github.com/josenk/terraform-provider-esxi/blob/master/examples-0.13/01%20Simple%20Guest/versions.tf

scaery commented 4 years ago

Works now, many thanks for the quick update to 1.7.1 and the provided sample for terraform 0.13!

❯ terraform init

Initializing the backend...

Initializing provider plugins...
- Finding latest version of josenk/esxi...
- Installing josenk/esxi v1.7.1...
- Installed josenk/esxi v1.7.1 (self-signed, key ID <snipsnap>)

Partner and community providers are signed by their developers.
If you'd like to know more about provider signing, you can read about it here:
https://www.terraform.io/docs/plugins/signing.html

The following providers do not have any version constraints in configuration,
so the latest version was installed.

To prevent automatic upgrades to new major versions that may contain breaking
changes, we recommend adding version constraints in a required_providers block
in your configuration, with the constraint strings suggested below.

* josenk/esxi: version = "~> 1.7.1"

Terraform has been successfully initialized!

You may now begin working with Terraform. Try running "terraform plan" to see
any changes that are required for your infrastructure. All Terraform commands
should now work.

If you ever set or change modules or backend configuration for Terraform,
rerun this command to reinitialize your working directory. If you forget, other
commands will detect it and remind you to do so if necessary.