terraformer: plugin error 1: open /Users/me/.terraform.d/plugins/darwin_amd64: no such file or directory [Terraform Version v0.13.0]

I am seeing the same issue as indicated in https://github.com/GoogleCloudPlatform/terraformer/issues/184 when using terraformer with plugins initiated by terraform v0.13.0

  1. brew uninstall terraformer && brew install terraformer (version 0.8.8 installed)
  2. Make directory, cd
  3. init.tf:
provider "google" {
  version = "~> 3.35"
  project_id = "credible-torus-262216"
}
  1. terraform init
  2. terraformer import google ...
2020/08/22 00:32:34 google importing... 
2020/08/22 00:32:35 open /Users/me/.terraform.d/plugins/darwin_amd64: no such file or directory

Terraform version:

Terraform v0.13.0
+ provider registry.terraform.io/hashicorp/google v3.35.0

Note that this error does not occur for previous versions of terraform, e.g.

Terraform v0.12.10
+ provider.google v3.35.0

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Reactions: 19
  • Comments: 30 (3 by maintainers)

Commits related to this issue

Most upvoted comments

Here’s what I had to do in order to get it working.

  1. Created the path ~/.terraform.d/plugins/darwin_amd64
  2. Downloaded https://releases.hashicorp.com/terraform-provider-google/, extracted the package, copied the file in ~/.terraform.d/plugins/darwin_amd64 as terraform-provider-google.
  3. chmod +x ~/.terraform.d/plugins/darwin_amd64/terraform-provider-google
  4. I had to manually open the executable manually once in order to get rid of the Mac malicious executable warning.

Idk if anyone is still wrestling with this issue, but the following fixed it for me with versions 0.12.31, 0.13.2 and 0.14.8. It seems you just need a new directory, with a versions file in it. E.g.:

$ mkdir some-new-dir
$ cd some-new-dir
$ tee -a versions.tf <<EOF
terraform {
 ​required_version = ">= 0.13"
 ​required_providers {
   ​aws = {
     ​source  = "hashicorp/aws"
   ​}
 ​}
}
EOF
$ terraform init
$ terraformer import aws ...

Why it’s closed? The issue is here

@jjorissen52 give brew uninstall terraformer and brew install --HEAD terraformer a shot, I fixed the head build recently.

In my case using MacOS Ventura 13.0 on Apple M1, thanks to @peterdeme’s comment, I have created providers.tf in the folder I’m working in and put the provider (aws in my case)

provider "aws" {}

and then ran

terraform init

and finally ran the terraformer import aws ... and everything worked smoothly.

Is there any way to get this plugin working with Terraform v0.13?

I believe that the issue stems from the fact that Terrafrom 0.13+ installs plugins to a different path than Terraform < 0.13.

This is still an issue on terraform 1.0 & terraformer v0.8.14even after applying the above-mentioned workaround:

brew uninstall terraformer and brew install --HEAD terraformer

In my case using MacOS Ventura 13.0 on Apple M1, thanks to @peterdeme’s comment, I have created providers.tf in the folder I’m working in and put the provider (aws in my case)

provider "aws" {}

and then ran

terraform init

and finally ran the terraformer import aws ... and everything worked smoothly.

thank you, work like a charm

Here’s what I had to do in order to get it working.

  1. Created the path ~/.terraform.d/plugins/darwin_amd64
  2. Downloaded https://releases.hashicorp.com/terraform-provider-google/, extracted the package, copied the file in ~/.terraform.d/plugins/darwin_amd64 as terraform-provider-google.
  3. chmod +x ~/.terraform.d/plugins/darwin_amd64/terraform-provider-google
  4. I had to manually open the executable manually once in order to get rid of the Mac malicious executable warning.

Similar but slightly different. Running the following version:

terraform -v
Terraform v1.1.7 on darwin_amd64

Steps I took:

  1. Add provider you need (in this case newrelic/newrelic to a .tf file and run terraform init

    terraform {
      required_providers {
        google = {
          source = "newrelic/newrelic"
        }
      }
      required_version = ">= 0.13"
    }
    
  2. Create plugin directory

      mkdir -p ~/.terraform.d/plugins/darwin_amd64
    
  3. Copy provider that was imported in step 1

      cp ~/.terraform/providers/registry.terraform.io/newrelic/newrelic/2.48.1/darwin_amd64/terraform-provider-newrelic_v2.48.1 ~/.terraform.d/plugins/darwin_amd64/terraform-provider-newrelic_v2.48.1
    

brew uninstall terraformer and brew install --HEAD terraformer

This didn’t work with me using terraform 0.14.

the issue is still there when execute the terraformer import with google provider. fork/exec : no such file or directory

with latest terraform version:V1.01 on Darwin_amd64, Terraformer version:V0.8.15

https://github.com/GoogleCloudPlatform/terraformer/issues/1171

You need to run terraform init first

Here’s what I had to do in order to get it working.

  1. Created the path ~/.terraform.d/plugins/darwin_amd64
  2. Downloaded https://releases.hashicorp.com/terraform-provider-google/, extracted the package, copied the file in ~/.terraform.d/plugins/darwin_amd64 as terraform-provider-google.
  3. chmod +x ~/.terraform.d/plugins/darwin_amd64/terraform-provider-google
  4. I had to manually open the executable manually once in order to get rid of the Mac malicious executable warning.

This worked for me with terraform 0.13 and latest terraformer. The file shouldn’t be renamed though, otherwise it causes Can't find provider version warning when calling terraformer import plan.

The issue might be here:

https://github.com/GoogleCloudPlatform/terraformer/blob/8be92a9f59e1b551fdda1cf6a6191fdaff0547e9/terraformutils/providerwrapper/provider.go#L244

This seems to assume to search in a flat structure here:

.terraform/plugins/darwin_amd64

But in reality in 0.13 this should now be searching through a registry structure, so now the provider appears here (using azurerm as an example):

.terraform/plugins/registry.terraform.io/hashicorp/azurerm/2.20.0/darwin_amd64

So this code just needs to be updated to account for this new registry/version structure I believe.

More details here:

https://www.terraform.io/upgrade-guides/0-13.html#new-filesystem-layout-for-local-copies-of-providers

In my case using MacOS Ventura 13.0 on Apple M1, thanks to @peterdeme’s comment, I have created providers.tf in the folder I’m working in and put the provider (aws in my case)

provider "aws" {}

and then ran

terraform init

and finally ran the terraformer import aws ... and everything worked smoothly.

thank you, work like a charm

Worked for me too! thanks! 😃

If you’re on a silicon mac, note this will be darwin_arm64 and not darwin_amd64

Here’s what I had to do in order to get it working.

  1. Created the path ~/.terraform.d/plugins/darwin_amd64
  2. Downloaded https://releases.hashicorp.com/terraform-provider-google/, extracted the package, copied the file in ~/.terraform.d/plugins/darwin_amd64 as terraform-provider-google.
  3. chmod +x ~/.terraform.d/plugins/darwin_amd64/terraform-provider-google
  4. I had to manually open the executable manually once in order to get rid of the Mac malicious executable warning.

This it worked for me in terraform 1.1 && terraformer 0.8… Thank you

the issue is still there when execute the terraformer import with google provider. fork/exec : no such file or directory

with latest terraform version:V1.01 on Darwin_amd64, Terraformer version:V0.8.15

To ensure backwards compatibility, the tool should check two paths. Thanks for the feedback!

Yesterday I found out Terraform changed how they define version definition in 0.13 - https://www.terraform.io/docs/configuration/provider-requirements.html Started working on the change.

Appreciate feedback. Confirming that this is indeed the case. Moving Terraform to latest 0.12.29 changed the terraformer behavior. Good as a work around, however, probably this issue needs attention in a future.

To me, the issue was that my Terraform was an arm64 binary and Terraformer was amd64.

I downloaded the darwin-arm64 image and it fixed it. Although it’s pretty huge (380mb)

edit: Oh and the other reason is that hashicorp/aws module is not initialized. You need to add hashicorp/aws into providers.tf (or whatever file) and then terraform init.

I just tried to use terraformer on WSL2 and I got this error. I’m using latest release from github.