terraform-provider-mongodbatlas icon indicating copy to clipboard operation
terraform-provider-mongodbatlas copied to clipboard

Provider "mongodbatlas" not available for installation.

Open abramovi opened this issue 6 years ago • 13 comments

Hi ,

I am trying to use this provider following the example folder, but when I ran terraform init, i am getting - Provider "mongodbatlas" not available for installation.

Any idea ?

abramovi avatar Mar 06 '19 10:03 abramovi

@abramovi have you installed the provider? Check the Readme for installation guide, it's basically about downloading the binary from the release page and putting it into ~/.terraform.d/plugins

Sent with GitHawk

Knappek avatar Mar 06 '19 11:03 Knappek

We are experiencing the same issues. Downloaded the binary, put in into ~/.terraform.d/plugins and .../pluginslinux_amd64/ and get the same error. :(

The weird thing is that according to DEBUG log it appears to find the plugin, but still want to download it from releases.terraform.

-----------------------------------------------------
2019/03/07 10:44:54 [DEBUG] [aws-sdk-go] 
2019/03/07 10:44:54 [DEBUG] checking for provider in "."
2019/03/07 10:44:55 [DEBUG] checking for provider in "/usr/bin"
2019/03/07 10:44:55 [DEBUG] checking for provider in ".terraform/plugins/linux_amd64"
2019/03/07 10:44:55 [DEBUG] found provider "terraform-provider-aws_v2.0.0_x4"
2019/03/07 10:44:55 [DEBUG] found provider "terraform-provider-template_v2.1.0_x4"
2019/03/07 10:44:55 [DEBUG] checking for provider in "/home/gschaffer/.terraform.d/plugins"
2019/03/07 10:44:55 [DEBUG] checking for provider in "/home/gschaffer/.terraform.d/plugins/linux_amd64"
2019/03/07 10:44:55 [DEBUG] found provider "terraform-provider-mongodbatlas_v0.8.1_linux_amd64"
2019/03/07 10:44:55 [DEBUG] found valid plugin: "template", "2.1.0", "/home/gschaffer/repos/cxn/terraform-infra/aws/cxn-prod-eu-west-1/prod-vpc01/services/license-server/.terraform/plugins/linux_amd64/terraform-provider-template_v2.1.0_x4"
2019/03/07 10:44:55 [DEBUG] found valid plugin: "aws", "2.0.0", "/home/gschaffer/repos/cxn/terraform-infra/aws/cxn-prod-eu-west-1/prod-vpc01/services/license-server/.terraform/plugins/linux_amd64/terraform-provider-aws_v2.0.0_x4"
2019/03/07 10:44:55 [DEBUG] plugin requirements: "aws"=""
2019/03/07 10:44:55 [DEBUG] plugin requirements: "mongodbatlas"=""
2019/03/07 10:44:55 [DEBUG] plugin requirements: "template"=""

Initializing provider plugins...
- Checking for available provider plugins on https://releases.hashicorp.com...
2019/03/07 10:44:55 [ERROR] failed to fetch plugin versions from https://releases.hashicorp.com/terraform-provider-mongodbatlas/
403 Forbidden
<html>
<head><title>403 Forbidden</title></head>
<body>
<h1>403 Forbidden</h1>
<ul>
<li>Code: AccessDenied</li>
<li>Message: Access Denied</li>
<li>RequestId: FCC9B7B4C1FE05E3</li>
<li>HostId: NNgLgnTDseSnIeVPfj3G0jq6lviMIsdDgtNSNBA7MZV+PvvtJYLOtr7s0TARItaoE3PlcytvN24=</li>
</ul>
<hr/>
</body>
</html>
2019/03/07 10:44:55 [ERROR] 1 error(s) occurred:

* no provider exists with the given name
2019/03/07 10:44:55 [DEBUG] plugin: waiting for all plugin processes to complete...

Provider "mongodbatlas" not available for installation.

A provider named "mongodbatlas" 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/linux_amd64

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

gschaffer-cxn avatar Mar 07 '19 09:03 gschaffer-cxn

I'm currently not on my computer so I can't reproduce it, but I guess the filename is not correct, you have to remove the "_linux_amd64" according to the naming scheme: https://www.terraform.io/docs/configuration/providers.html#third-party-plugins

Sent with GitHawk

Knappek avatar Mar 07 '19 10:03 Knappek

Hi @Knappek we just experienced this issue and renaming (removing "_linux_amd64" ) helps, plugin is installed correctly

christianuhlcc avatar Mar 07 '19 10:03 christianuhlcc

That fixed it for me aswell, thanks

gschaffer-cxn avatar Mar 07 '19 13:03 gschaffer-cxn

@akshaykarle you can close this issue.

Sent with GitHawk

Knappek avatar Mar 08 '19 08:03 Knappek

@Knappek I would leave it open for a follow-up PR that fixes the actual issue - that the name of the compiled binary is not suitable for installation, otherwise every new user needs to find this closed issue to install it, right?

I can try to propose a PR, but I am horrible at go, so I for sure need some help.

christianuhlcc avatar Mar 08 '19 08:03 christianuhlcc

@christianuhlcc I don't think this is possible as you need to differentiate between the different operating systems...it's quite common that you need to rename binaries that you download from the web. What you can do though is enhancing the Readme maybe...

Sent with GitHawk

Knappek avatar Mar 08 '19 09:03 Knappek

@Knappek the same issue exists within the zipped releases, we could at least fix those along with the README

gschaffer-cxn avatar Mar 08 '19 10:03 gschaffer-cxn

I looked around how other community providers handle it, and everybody does it differently ...

Maybe only serving ZIP files with the target system in the name, and the containing file in the usable filename would be the way to go? That would make it obvious for downloaders and easy for installers to do the right thing.

christianuhlcc avatar Mar 08 '19 14:03 christianuhlcc

hey all, thanks for all the inputs. I will update the readme with instructions to rename the binaries to avoid confusion.

akshaykarle avatar Mar 25 '19 21:03 akshaykarle

This was my first 3rd party plugin, phew complicated.

#for OSX
wget -O ~/.terraform.d/plugins/terraform-provider-mongodbatlas_v1.1.0 https://github.com/akshaykarle/terraform-provider-mongodbatlas/releases/download/v1.1.0/terraform-provider-mongodbatlas_v1.1.0_darwin_amd64

nitrag avatar Jun 26 '19 01:06 nitrag

This worked for me, adding the following lines before using any resources:

terraform {
  required_providers {
    mongodbatlas = {
      source  = "mongodb/mongodbatlas"
      version = "0.9.1"
    }
  }
}

provider "mongodbatlas" {
  public_key  = var.mongodb_atlass_public_key
  private_key = var.mongodb_atlass_private_key
}

petr-nazarov avatar May 19 '21 10:05 petr-nazarov