# Error: Failed to query available provider packages

**URL:** <https://community.auth0.com/t/error-failed-to-query-available-provider-packages/198332>\
**Category:** Get Help\
**Tags:** configuration, application\
**Created:** [March 25, 2026, 3:37pm UTC](https://community.auth0.com/t/error-failed-to-query-available-provider-packages/198332 "2026-03-25T15:37:06Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![shayan.bhattacharya](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/shayan.bhattacharya/32/72644_2.png) [@shayan.bhattacharya](https://community.auth0.com/u/shayan.bhattacharya)\
**Post date:** [March 25, 2026, 3:37pm UTC](https://community.auth0.com/t/error-failed-to-query-available-provider-packages/198332/1 "2026-03-25T15:37:06Z")

</div>

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](http://registry.terraform.io) does not have a provider named  
│ [Terraform Registry](http://registry.terraform.io/hashicorp/auth0)  
│  
│ 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”  
}  
}‘

---

<div class="post-metadata">

**Author:** ![nik.baleca](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/nik.baleca/32/68749_2.png) [@nik.baleca](https://community.auth0.com/u/nik.baleca)\
**Post date:** [March 27, 2026, 6:45pm UTC](https://community.auth0.com/t/error-failed-to-query-available-provider-packages/198332/3 "2026-03-27T18:45:18Z")

</div>

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:

```auto
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

---

<div class="post-metadata">

**Author:** ![shayan.bhattacharya](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/shayan.bhattacharya/32/72644_2.png) [@shayan.bhattacharya](https://community.auth0.com/u/shayan.bhattacharya)\
**Post date:** [March 30, 2026, 8:44am UTC](https://community.auth0.com/t/error-failed-to-query-available-provider-packages/198332/4 "2026-03-30T08:44:59Z")

</div>

Thanks, it’s all sorted now. I now realise I got the error because I was not mentioning the providers outside of the root main.tf file. As you correctly point out, I didn’t cite the provider in the module files.

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/auth0/original/3X/b/5/b560f266932fcce5d57f09a6595bd50518cae3f3.jpeg) [@system](https://community.auth0.com/u/system)\
**Post date:** [April 13, 2026, 8:45am UTC](https://community.auth0.com/t/error-failed-to-query-available-provider-packages/198332/5 "2026-04-13T08:45:39Z")

</div>

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.
