Error: Failed to query available provider packages

Having managed to auto generate tf files from my existing auth0 tenant, I now want to try using terraform to update an email template. However, ‘terraform init’ produces an error that indicates the auth0 provider was not referenced properly whereby it thinks it was referenced like so ‘hashicorp/auth0’ when in actuality, it was referenced correctly like ‘auth0/auth0’. Deleting the lock and state files did not resolve this so both were regenerated with another ‘terraform apply’. The exact output I got was ‘$ terraform init
Initializing the backend…
Initializing modules…
Initializing provider plugins…

  • Finding latest version of hashicorp/auth0…
  • Reusing previous version of auth0/auth0 from the dependency lock file
  • Using previously-installed auth0/auth0 v1.41.0

    │ Error: Failed to query available provider packages

    │ Could not retrieve the list of available versions for provider hashicorp/auth0: provider registry registry.terraform.io does not have a provider named
    Terraform Registry

    │ Did you intend to use auth0/auth0? If so, you must specify that source address in each module which requires that provider. To see which modules are currently depending on
    │ hashicorp/auth0, run the following command:
    │ terraform providers
    ╵‘ and I promise I DID reference the source correctly. The opening line of my ‘auth0_main.tf’ file is ‘terraform {
    required_version = “>= 1.5.0”
    required_providers {
    auth0 = {
    source = “auth0/auth0”
    version = “>= 1.0.0”
    }
    }‘

Hi @shayan.bhattacharya

I am sorry for the delayed response to your inquiry!

The reason why Terraform might still looking for hashicorp/auth0 is that Terraform enforces provider requirements on a strictly per-module basis . If your auto-generated .tf files were placed into a subdirectory (, or if there is another module in your project using Auth0 resources, that specific module does not know about the auth0_main.tf file in your root directory. When Terraform sees an auth0_ resource without an explicit auth0/auth0 mapping in that exact module, it defaults to assuming the provider is maintained by hashicorp/auth0.

To resolve this, you can try to track down the rogue module and explicitly declare the Auth0 provider there as well.

  • Run the command terraform providers
  • Look closely at the output; it will show you exactly which module is requesting hashicorp/auth0 .
  • Create a versions.tf (or similar) file inside that specific folder and paste the exact same block you have in your main file:
terraform {
  required_providers {
    auth0 = {
      source  = "auth0/auth0"
      version = ">= 1.0.0" # or your specific version
    }
  }
}
  • Once the child module explicitly knows that auth0 means auth0/auth0 , run your initialization again: terraform init

Let me know if that does the trick for you or if you have any other questions!

Kind Regards,
Nik