Upgrade to 0.13 Fails Looking for Invalid Custom Provider

I have a custom provider called “hush” and it is vendored in the git repo. This repo has several root modules and I’ve successfully migrated most of those to 0.13, but one is not working.

I’ve tried running init both using the existing .terraform data and with a clean slate, both fail with the same error. Here is the relevant output from a clean terraform init:

Initializing provider plugins...
- Finding latest version of hashicorp/tls...
- Finding latest version of terraform-providers/mysql...
- Finding latest version of -/mysql...
- Finding latest version of -/helm...
- Finding latest version of hashicorp/google-beta...
- Finding latest version of -/google-beta...
- Finding terraform.mydomain.com/maven/hush versions matching "1.0.0"...
- Finding latest version of hashicorp/hush...
- Finding latest version of hashicorp/helm...
- Finding latest version of -/postgresql...
- Finding latest version of -/kubernetes...
- Finding latest version of -/local...
- Finding latest version of hashicorp/random...
- Finding latest version of hashicorp/google...
- Finding latest version of -/random...
- Finding latest version of -/google...
- Finding latest version of -/null...
- Finding latest version of -/tls...
- Finding latest version of hashicorp/null...
- Finding latest version of terraform-providers/postgresql...
- Finding latest version of hashicorp/local...
- Finding latest version of hashicorp/kubernetes...
- Installing -/kubernetes v1.13.1...
- Installed -/kubernetes v1.13.1 (signed by HashiCorp)
- Installing -/google v3.37.0...
- Installed -/google v3.37.0 (signed by HashiCorp)
- Installing -/mysql v1.9.0...
- Installed -/mysql v1.9.0 (signed by HashiCorp)
- Installing hashicorp/google-beta v3.37.0...
- Installed hashicorp/google-beta v3.37.0 (signed by HashiCorp)
- Installing hashicorp/random v2.3.0...
- Installed hashicorp/random v2.3.0 (signed by HashiCorp)
- Installing -/random v2.3.0...
- Installed -/random v2.3.0 (signed by HashiCorp)
- Installing -/null v2.1.2...
- Installed -/null v2.1.2 (signed by HashiCorp)
- Installing hashicorp/null v2.1.2...
- Installed hashicorp/null v2.1.2 (signed by HashiCorp)
- Installing -/helm v1.3.0...
- Installed -/helm v1.3.0 (signed by HashiCorp)
- Installing -/google-beta v3.37.0...
- Installed -/google-beta v3.37.0 (signed by HashiCorp)
- Installing terraform.mydomain.com/maven/hush v1.0.0...
- Installed terraform.mydomain.com/maven/hush v1.0.0 (unauthenticated)
- Installing hashicorp/google v3.37.0...
- Installed hashicorp/google v3.37.0 (signed by HashiCorp)
- Installing hashicorp/local v1.4.0...
- Installed hashicorp/local v1.4.0 (signed by HashiCorp)
- Installing terraform-providers/mysql v1.9.0...
- Installed terraform-providers/mysql v1.9.0 (signed by HashiCorp)
- Installing hashicorp/helm v1.3.0...
- Installed hashicorp/helm v1.3.0 (signed by HashiCorp)
- Installing -/postgresql v1.7.1...
- Installed -/postgresql v1.7.1 (signed by HashiCorp)
- Installing -/local v1.4.0...
- Installed -/local v1.4.0 (signed by HashiCorp)
- Installing -/tls v2.2.0...
- Installed -/tls v2.2.0 (signed by HashiCorp)
- Installing terraform-providers/postgresql v1.7.1...
- Installed terraform-providers/postgresql v1.7.1 (signed by HashiCorp)
- Installing hashicorp/kubernetes v1.13.1...
- Installed hashicorp/kubernetes v1.13.1 (signed by HashiCorp)
- Installing hashicorp/tls v2.2.0...
- Installed hashicorp/tls v2.2.0 (signed by HashiCorp)

Error: Failed to install provider

Error while installing hashicorp/hush: provider registry registry.terraform.io
does not have a provider named registry.terraform.io/hashicorp/hush

Obviously there is no plugin hashicorp/hush, I have the following in my root module config:

terraform {
  required_providers {
    hush = {
      source  = "terraform.mydomain.com/maven/hush"
      version = "1.0.0"
    }
  }
}

When running init with TF_LOG=TRACE it shows that the actual provider plugin binary is found in the expected place and that terraform.mydomain.com/maven/hush was installed as expected. Trying to replace this mystery provider fails:

$ terraform state replace-provider registry.terraform.io/hashicorp/hush terraform.mydomain.com/maven/hush
No matching resources found.

So, I have no idea where the hashicorp/hush reference originates. It doesn’t seem to be in the state file (I did a state pull and searched the file), and it’s not in my .tf files.

This topic seems to be similar, but didn’t solve my issue.

Hi @kevinbirch,

If you run terraform providers, does the output tell you which specific module in your configuration is still implicitly depending on registry.terraform.io/hashicorp/hush?

You’ll need to add that required_providers block to each module that uses that provider, so that Terraform knows you intend to use the in-house provider to satisfy that dependency, rather than defaulting to an official provider of that name.

I did actually find the incorrect provider listed in a submodule. Thanks for your help!