kreuzwerker / m1-terraform-provider-helper

CLI to support with downloading and compiling terraform providers for Mac with M1 chip

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Unable to install a provider

chandniahuja opened this issue · comments

➜ ~ m1-terraform-provider-helper install hashicorp/aws -v v2.69.0

Getting provider data from terraform registry
Getting source code...
FATA[0001] Bash execution did not run successfully: exit status 1.
Output:
error: The following untracked working tree files would be overwritten by checkout:
docs/faq.md
Please move or remove them before you switch branches.
Aborting

I get above error while installing any provider. I can't find this file anywhere (docs/faq.md) which this tool is asking me to delete.

Which version of the m1-terraform-provider-helper are you running?

Latest one 'Current version: 0.8.1'

I tested the command locally, it works for me.
The tool clones the repo to $HOME/.m1-terraform-provider-helper so you should be able to take a look whats going on in $HOME/.m1-terraform-provider-helper/terraform-provider-aws
I am surprised this happens, because before any installation a total reset is performed https://github.com/kreuzwerker/m1-terraform-provider-helper/blob/main/internal/app/install.go#L148.

You also mentioned it is happening for every provider, what about m1-terraform-provider-helper install hashicorp/random -v v3.4.3?

Can you run both commands with https://github.com/kreuzwerker/m1-terraform-provider-helper#logging enabled and send the results in a gist?

Installing other providers worked, for eg.m1-terraform-provider-helper install hashicorp/random -v v3.4.3

But the issue with terraform-provider-aws provider continued. Here is the output with debug mode on (https://gist.github.com/chandniahuja/ab3ebd1c528805dff23e24c7cd73b362)

Although there was nothing suspicious in $HOME/.m1-terraform-provider-helper/terraform-provider-aws but I deleted this repository on my local and tried again to install the provider with command m1-terraform-provider-helper install hashicorp/aws -v v2.69.0 and it worked this time. So I assume something was wrong with that repository. But you mentioned that you do a total reset before any installation, not sure why it didn't resolve.

But anyways, I'm now able to install the required providers. I have issues with terraform though. Terraform 0.12 is not able to find the required plugins in $HOME/.terraform.d/plugins/registry.terraform.io/hashicorp directory. I tried to move them to $HOME/.terraform.d/plugins/darwin_arm64 but that doesn't work either. Well this is a separate problem, will try to see what we can do.

Thanks for all your help for resolving this issue. I think pointing out that the tool clones the repo to $HOME/.m1-terraform-provider-helper was useful piece of information that we can be added to README file.

Thanks for all the information!
In https://github.com/kreuzwerker/m1-terraform-provider-helper/pull/74/files I tried to fix handling of providers with Terraform v0.12, but apparently that is not sufficient. While looking through the code I found some small errors, I will file a new PR:
Can you try moving the plugins to ~/.terraform.d/plugins/darwin_arm64/ (that's what the cli should be doing) and see if that works? (This path is mentioned by https://developer.hashicorp.com/terraform/language/v1.1.x/configuration-0-11/providers#plugin-names-and-versions)

Additionally I will add more output when the building of a provider fails, so that the users knows where and what to debug

Yeah I tried that path already ~/.terraform.d/plugins/darwin_arm64/ but it doesn't work as well.
We will probably plan to upgrade all the providers to latest versions as a full-proof solution.

Thanks for your help. Fee free to close the issue at your convenience.

If you manage to find out the reason why it doesn't work, please let me know!
Closing this