I’ve followed the 0.13 upgrade guide but I seem to be hitting some issues with local provider discovery.
The plugin exists in a dir on the plugin lookup paths:
$ ls /home/shw/.terraform.d/plugins/mycorp.io/mycorp/gotemplate/1.0.0/linux_amd64/
terraform-provider-gotemplate_v1.0.0
And it is configured correctly in versions.tf
:
terraform {
required_providers {
gotemplate = {
source = "mycorp.io/mycorp/gotemplate"
version = "1.0.0"
}
}
required_version = ">= 0.13"
}
However, when I try and init
the root module, I can see from the trace logs that Terraform finds my provider, but then attempts to find it on registry.terraform.io, even though it is configured correctly with an FQDN in my config.
terraform init
will fail with the following:
Error: Failed to query available provider packages
Could not retrieve the list of available versions for provider -/gotemplate:
provider registry registry.terraform.io does not have a provider named
registry.terraform.io/-/gotemplate
These are the relevant lines from the trace output log:
2020/08/24 16:31:28 [TRACE] getproviders.SearchLocalDirectory: found mycorp.io/mycorp/gotemplate v1.0.0 for linux_amd64 at /home/shw/.terraform.d/plugins/mycorp.io/mycorp/gotemplate/1.0.0/linux_amd64
2020/08/24 16:31:29 [TRACE] getproviders.SearchLocalDirectory: found mycorp.io/mycorp/gotemplate v1.0.0 for linux_amd64 at .terraform/plugins/mycorp.io/mycorp/gotemplate/1.0.0/linux_amd64
2020/08/24 16:31:29 [TRACE] providercache.fillMetaCache: including .terraform/plugins/mycorp.io/mycorp/gotemplate/1.0.0/linux_amd64 as a candidate package for mycorp.io/mycorp/gotemplate 1.0.0
2020/08/24 16:31:33 [TRACE] getproviders.SearchLocalDirectory: found mycorp.io/mycorp/gotemplate v1.0.0 for linux_amd64 at .terraform/plugins/mycorp.io/mycorp/gotemplate/1.0.0/linux_amd64
2020/08/24 16:31:33 [TRACE] providercache.fillMetaCache: including .terraform/plugins/mycorp.io/mycorp/gotemplate/1.0.0/linux_amd64 as a candidate package for mycorp.io/mycorp/gotemplate 1.0.0
2020/08/24 16:31:33 [DEBUG] GET https://registry.terraform.io/v1/providers/-/gotemplate/versions
2020/08/24 16:31:33 [TRACE] HTTP client GET request to https://registry.terraform.io/v1/providers/-/gotemplate/versions
Can anyone enlighten me as to what is going on here? Where does this mysterious -/gotemplate
provider come from?