Unable to retrieve list of available versions for hashicorp/google provider with specific constraints.
fveas opened this issue ยท 5 comments
TL;DR
When attempting to initialize Terraform with specific version constraints for the hashicorp/google provider, an error is encountered indicating that no available versions match the given constraints.
Expected behavior
Terraform should successfully initialize, or provide a clear error message indicating incompatible version constraints.
Observed behavior
Received the error: "Could not retrieve the list of available versions for provider hashicorp/google: no available releases match the given constraints >= 3.39.0, >= 3.43.0, >= 3.53.0, >= 4.0.0, >= 4.38.0, >= 4.42.0, ~> 5.0, < 5.0.0, >=5.1.0, < 6.0.0".
Terraform Configuration
terraform {
required_providers {
google = {
source = "hashicorp/google"
version = ">= 5.0.0"
}
}
required_version = ">= 1.3.5"
}
Terraform Version
Terraform v1.5.7
on darwin_amd64
+ provider registry.terraform.io/hashicorp/external v2.3.1
+ provider registry.terraform.io/hashicorp/google v4.84.0
+ provider registry.terraform.io/hashicorp/google-beta v4.84.0
+ provider registry.terraform.io/hashicorp/kubernetes v2.23.0
+ provider registry.terraform.io/hashicorp/null v3.2.1
+ provider registry.terraform.io/hashicorp/random v3.5.1
Your version of Terraform is out of date! The latest version
is 1.6.0. You can update by downloading from https://www.terraform.io/downloads.html
Steps to reproduce
- Configure the provider.tf (or relevant filename) with the following version constraints for the hashicorp/google provider:
>= 5.0.0
- Run terraform init.
- Observe the error message.
Additional information
I was looking into this error where they report a similar issue: #171.
Hi @fveas - There appears to be something in your terraform configuration which includes a hashicorp/google < 5.0.0
constraint. I'd suggest confirming you are using terraform-google-gcloud
~> 3.3
, and then get the output of terraform providers
(you might need to temporarily remove your version = ">= 5.0.0"
to first run terraform init --upgrade
) .
Hello @apeabody, I've made the changes you requested, but I'm still encountering issues. Here's the output from terraform providers
:
Providers required by configuration:
.
โโโ provider[registry.terraform.io/hashicorp/google] 5.1.0
โโโ module.app
โ โโโ provider[registry.terraform.io/hashicorp/random] ~> 3.1
โ โโโ provider[registry.terraform.io/hashicorp/google] 5.1.0
โ โโโ module.bucket
โ โ โโโ provider[registry.terraform.io/hashicorp/google] >= 4.42.0, < 5.0.0
โ โโโ module.secret-manager
โ โ โโโ provider[registry.terraform.io/hashicorp/google-beta] >= 4.0.0, < 5.0.0
โ โ โโโ provider[registry.terraform.io/hashicorp/google] >= 4.0.0, < 5.0.0
โ โโโ module.workload_identity
โ โโโ provider[registry.terraform.io/hashicorp/kubernetes] ~> 2.13
โ โโโ provider[registry.terraform.io/hashicorp/google] >= 3.39.0, < 5.0.0
โ โโโ module.annotate-sa
โ โโโ provider[registry.terraform.io/hashicorp/google] >= 3.53.0, < 6.0.0
โ โโโ module.gcloud_kubectl
โ โโโ provider[registry.terraform.io/hashicorp/null] >= 2.1.0
โ โโโ provider[registry.terraform.io/hashicorp/google] >= 3.53.0, < 6.0.0
โ โโโ provider[registry.terraform.io/hashicorp/external] >= 2.2.2
โ โโโ provider[registry.terraform.io/hashicorp/random] >= 2.1.0
โโโ module.memorystore
โโโ provider[registry.terraform.io/hashicorp/google] >= 4.38.0, < 5.0.0
โโโ module.enable_apis
โโโ provider[registry.terraform.io/hashicorp/google] >= 3.43.0, < 5.0.0
โโโ provider[registry.terraform.io/hashicorp/google-beta] >= 3.43.0, < 5.0.0
Providers required by state:
provider[registry.terraform.io/hashicorp/google]
provider[registry.terraform.io/hashicorp/random]
Hello @apeabody, I've made the changes you requested, but I'm still encountering issues. Here's the output from
terraform providers
:Providers required by configuration: . โโโ provider[registry.terraform.io/hashicorp/google] 5.1.0 โโโ module.app โ โโโ provider[registry.terraform.io/hashicorp/random] ~> 3.1 โ โโโ provider[registry.terraform.io/hashicorp/google] 5.1.0 โ โโโ module.bucket โ โ โโโ provider[registry.terraform.io/hashicorp/google] >= 4.42.0, < 5.0.0 โ โโโ module.secret-manager โ โ โโโ provider[registry.terraform.io/hashicorp/google-beta] >= 4.0.0, < 5.0.0 โ โ โโโ provider[registry.terraform.io/hashicorp/google] >= 4.0.0, < 5.0.0 โ โโโ module.workload_identity โ โโโ provider[registry.terraform.io/hashicorp/kubernetes] ~> 2.13 โ โโโ provider[registry.terraform.io/hashicorp/google] >= 3.39.0, < 5.0.0 โ โโโ module.annotate-sa โ โโโ provider[registry.terraform.io/hashicorp/google] >= 3.53.0, < 6.0.0 โ โโโ module.gcloud_kubectl โ โโโ provider[registry.terraform.io/hashicorp/null] >= 2.1.0 โ โโโ provider[registry.terraform.io/hashicorp/google] >= 3.53.0, < 6.0.0 โ โโโ provider[registry.terraform.io/hashicorp/external] >= 2.2.2 โ โโโ provider[registry.terraform.io/hashicorp/random] >= 2.1.0 โโโ module.memorystore โโโ provider[registry.terraform.io/hashicorp/google] >= 4.38.0, < 5.0.0 โโโ module.enable_apis โโโ provider[registry.terraform.io/hashicorp/google] >= 3.43.0, < 5.0.0 โโโ provider[registry.terraform.io/hashicorp/google-beta] >= 3.43.0, < 5.0.0 Providers required by state: provider[registry.terraform.io/hashicorp/google] provider[registry.terraform.io/hashicorp/random]
Hi @fveas - This terraform-google-gcloud (gcloud_kubectl
) module appears fine:
module.gcloud_kubectl
โ โโโ provider[registry.terraform.io/hashicorp/google] >= 3.53.0, < 6.0.0
You will need updates for the other modules that include a < 5.0.0
constraint:
module.bucket
module.secret-manager
module.memorystore
module.workload_identity
Cheers
Hello @apeabody! Based on your experience, is there a way to resolve this locally, or do we need to wait for the repositories of those modules to be updated?
Hello @apeabody! Based on your experience, is there a way to resolve this locally, or do we need to wait for the repositories of those modules to be updated?
Hi @fveas - While you could try to fork the modules, TPG v5.0 included breaking changes. So at least a few modules will likely require changes for compatibility beyond just lifting the version constraint. I would check the repository in question, as most should have PRs in progress.