m1-terraform-provider-helper: template provider not working with terraform 0.12.31

Hi there,

I’ve installed the template provider as per:

m1-terraform-provider-helper install hashicorp/template -v 2.2.0

Expected Behavior

Terraform commands work:

Actual Behavior

Error installing provider “template”: no available version is compatible for the requested platform.

Steps to Reproduce (including precondition)

m1-terraform-provider-helper status
Status: Active
Local providers are us
m1-terraform-provider-helper list
hashicorp/template -> 2.2.0
ben/.terraform.d -> plugins

terraform init (with trace logging):

2022/06/16 11:19:35 [DEBUG] checking for provider in "."
2022/06/16 11:19:35 [DEBUG] checking for provider in "/opt/homebrew/opt/terraform@0.12/bin"
2022/06/16 11:19:35 [DEBUG] checking for provider in ".terraform/plugins/darwin_arm64"
2022/06/16 11:19:35 [DEBUG] found provider "terraform-provider-aws_v3.75.2_x5"
2022/06/16 11:19:35 [DEBUG] checking for provider in "/Users/ben/.terraform.d/plugins"
2022/06/16 11:19:35 [DEBUG] checking for provider in "/Users/ben/.terraform.d/plugins/darwin_arm64"
2022/06/16 11:19:35 [WARN] found legacy provider "terraform-provider-template_2.2.0_x5"
2022/06/16 11:19:35 [DEBUG] found valid plugin: "template_2.2.0_x5", "0.0.0", "/Users/ben/.terraform.d/plugins/darwin_arm64/terraform-provider-template_2.2.0_x5"
2022/06/16 11:19:35 [DEBUG] found valid plugin: "aws", "3.75.2", "/Users/ben/Code/owsy/infrastructure-live/scotam-prod/us-west-2/scotam-prod/data-stores/flowable/postgres/.terragrunt-cache/CoUyt-8Q4K3IIvxGLbTrKVSQw-c/wQX_94XlHXOC511wEnd47cONrjA/data-stores/rds/.terraform/plugins/darwin_arm64/terraform-provider-aws_v3.75.2_x5"

2022/06/16 11:19:35 [DEBUG] plugin requirements: "template"=""
2022/06/16 11:19:35 [DEBUG] plugin requirements: "aws"="~> 3.0"
Initializing provider plugins...
2022/06/16 11:19:35 [DEBUG] Service discovery for registry.terraform.io at https://registry.terraform.io/.well-known/terraform.json
2022/06/16 11:19:35 [TRACE] HTTP client GET request to https://registry.terraform.io/.well-known/terraform.json
- Checking for available provider plugins...
2022/06/16 11:19:35 [DEBUG] fetching provider versions from "https://registry.terraform.io/v1/providers/-/template/versions"
2022/06/16 11:19:35 [DEBUG] GET https://registry.terraform.io/v1/providers/-/template/versions
2022/06/16 11:19:35 [TRACE] HTTP client GET request to https://registry.terraform.io/v1/providers/-/template/versions

Error installing provider "template": no available version is compatible for the requested platform.

Terraform analyses the configuration and state and automatically downloads
plugins for the providers used. However, when attempting to download this
plugin an unexpected error occurred.

This may be caused if for some reason Terraform is unable to reach the
plugin repository. The repository may be unreachable if access is blocked
by a firewall.

If automatic installation is not possible or desirable in your environment,
you may alternatively manually install plugins by downloading a suitable
distribution package and placing the plugin's executable file in the
following directory:
    terraform.d/plugins/darwin_arm64

I don’t know if this is a problem, but terrform asks for the plugin to be in ~/.terraform.d/plugins/darwin_arm64, but it’s in ~/.terraform.d/plugins/registry.terraform.io/hashicorp/template/2.2.0/darwin_arm64

after copying terraform-provider-template_2.2.0_x5 to ~/.terraform.d/plugins/darwin_arm64, the log is slightly the different:

(note the WARN] found legacy provider "terraform-provider-template_2.2.0_x5")

2022/06/16 11:19:35 [DEBUG] checking for provider in "."
2022/06/16 11:19:35 [DEBUG] checking for provider in "/opt/homebrew/opt/terraform@0.12/bin"
2022/06/16 11:19:35 [DEBUG] checking for provider in ".terraform/plugins/darwin_arm64"
2022/06/16 11:19:35 [DEBUG] found provider "terraform-provider-aws_v3.75.2_x5"
2022/06/16 11:19:35 [DEBUG] checking for provider in "/Users/ben/.terraform.d/plugins"
2022/06/16 11:19:35 [DEBUG] checking for provider in "/Users/ben/.terraform.d/plugins/darwin_arm64"
2022/06/16 11:19:35 [WARN] found legacy provider "terraform-provider-template_2.2.0_x5"
2022/06/16 11:19:35 [DEBUG] found valid plugin: "template_2.2.0_x5", "0.0.0", "/Users/ben/.terraform.d/plugins/darwin_arm64/terraform-provider-template_2.2.0_x5"
2022/06/16 11:19:35 [DEBUG] found valid plugin: "aws", "3.75.2", "/Users/ben/Code/owsy/infrastructure-live/scotam-prod/us-west-2/scotam-prod/data-stores/flowable/postgres/.terragrunt-cache/CoUyt-8Q4K3IIvxGLbTrKVSQw-c/wQX_94XlHXOC511wEnd47cONrjA/data-stores/rds/.terraform/plugins/darwin_arm64/terraform-provider-aws_v3.75.2_x5"

2022/06/16 11:19:35 [DEBUG] plugin requirements: "template"=""
2022/06/16 11:19:35 [DEBUG] plugin requirements: "aws"="~> 3.0"
Initializing provider plugins...
2022/06/16 11:19:35 [DEBUG] Service discovery for registry.terraform.io at https://registry.terraform.io/.well-known/terraform.json
2022/06/16 11:19:35 [TRACE] HTTP client GET request to https://registry.terraform.io/.well-known/terraform.json
- Checking for available provider plugins...
2022/06/16 11:19:35 [DEBUG] fetching provider versions from "https://registry.terraform.io/v1/providers/-/template/versions"
2022/06/16 11:19:35 [DEBUG] GET https://registry.terraform.io/v1/providers/-/template/versions
2022/06/16 11:19:35 [TRACE] HTTP client GET request to https://registry.terraform.io/v1/providers/-/template/versions

Error installing provider "template": no available version is compatible for the requested platform.

Terraform analyses the configuration and state and automatically downloads
plugins for the providers used. However, when attempting to download this
plugin an unexpected error occurred.

This may be caused if for some reason Terraform is unable to reach the
plugin repository. The repository may be unreachable if access is blocked
by a firewall.

If automatic installation is not possible or desirable in your environment,
you may alternatively manually install plugins by downloading a suitable
distribution package and placing the plugin's executable file in the
following directory:
    terraform.d/plugins/darwin_arm64

Screenshot on This Problem (if possible)

Your Environment

  • OS: 12.4
  • m1-terraform-provider-helper version: 0.6.0

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Comments: 23 (8 by maintainers)

Most upvoted comments

think i fixed it.

i found an old reference here: https://www.terraform.io/language/configuration-0-11/providers#plugin-names-and-versions (i can’t find v0.12 of the docs?) that the filename must be terraform-provider-<NAME>_vX.Y.Z

i renamed terraform-provider-template_2.2.0_x5 to terraform-provider-template_v2.2.0 and it worked.