Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Bug: generate fails with "Provider registry.terraform.io/hashicorp/mongodbatlas v0.0.1 does not have a package available for your current platform, darwin_arm64." #317

Closed
andreaangiolillo opened this issue Jan 2, 2024 · 6 comments

Comments

@andreaangiolillo
Copy link

andreaangiolillo commented Jan 2, 2024

Bug:

The tfplugindocs generate command returns the following error when running for https://github.com/mongodb/terraform-provider-mongodbatlas

Error executing command: unable to generate website: exit status 1

Error: Incompatible provider version

Provider registry.terraform.io/hashicorp/mongodbatlas v0.0.1 does not have a
package available for your current platform, darwin_arm64.

How to reproduce the issue:

tfplugindocs generate                                                            

rendering website for provider "terraform-provider-mongodbatlas" (as "terraform-provider-mongodbatlas")
exporting schema from Terraform
compiling provider "mongodbatlas"
using Terraform CLI binary from PATH if available, otherwise downloading latest Terraform CLI binary
running terraform init
Error executing command: unable to generate website: exit status 1

Error: Incompatible provider version

Provider registry.terraform.io/hashicorp/mongodbatlas v0.0.1 does not have a
package available for your current platform, darwin_arm64.

Provider releases are separate from Terraform CLI releases, so not all
providers are available for all platforms. Other versions of this provider
may have different platforms supported.

Other info

OS: Sonoma 14.2.1 (23C71)
Machine: M1 mac

@andreaangiolillo
Copy link
Author

Installing tfplugindocs via go install fixed the issue

go install github.com/hashicorp/terraform-plugin-docs/cmd/tfplugindocs@latest

@bflad
Copy link
Contributor

bflad commented Jan 2, 2024

Hi @andreaangiolillo 👋 Thank you for reporting this and glad you resolved your issue.

To help others, could you explain how you originally installed or had tfplugindocs available to run?

In your reproduction steps:

Download https://github.com/mongodb/terraform-provider-mongodbatlas
Run tfplugindocs generate in the terraform-provider-mongodbatlas

The first step would not make tfplugindocs available as a command to run locally in the second step. We would love to ensure that our documentation is clear for future travelers to help prevent this issue. Thanks!

@andreaangiolillo
Copy link
Author

I download the binary via the GH release page https://github.com/hashicorp/terraform-plugin-docs/releases. I updated the description of the issue. Thanks

@bflad
Copy link
Contributor

bflad commented Jan 2, 2024

Thanks -- I was able to reproduce by downloading the incorrect architecture binary (amd64) for my arm64 workstation:

$ mv ~/Downloads/tfplugindocs_0.16.0_darwin_amd64/tfplugindocs ~/go/bin/tfplugindocs-amd64
$ xattr -d com.apple.quarantine ~/go/bin/tfplugindocs-amd64
$ file ~/go/bin/tfplugindocs-amd64
/Users/bflad/go/bin/tfplugindocs-amd64: Mach-O 64-bit executable x86_64
$ tfplugindocs-amd64 generate
rendering website for provider "terraform-provider-mongodbatlas" (as "terraform-provider-mongodbatlas")
exporting schema from Terraform
compiling provider "mongodbatlas"
using Terraform CLI binary from PATH if available, otherwise downloading latest Terraform CLI binary
running terraform init
Error executing command: unable to generate website: exit status 1

Error: Incompatible provider version

Provider registry.terraform.io/hashicorp/mongodbatlas v0.0.1 does not have a
package available for your current platform, darwin_arm64.

Provider releases are separate from Terraform CLI releases, so not all
providers are available for all platforms. Other versions of this provider
may have different platforms supported.

macOS allows amd64/x86_64 binaries to run emulated on arm64 hardware as if its runtime is amd64/x86_64, so when Terraform commands are called, if Terraform is arm64, then there will be a mismatch between where it expects providers to be installed.

@maidul98
Copy link

The way we fixed this was by setting GOOS and GOARCH to what the error was complaining about

GOOS=darwin GOARCH=amd64 go generate ./...

Copy link

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.
If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 23, 2024
# for free to subscribe to this conversation on GitHub. Already have an account? #.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants