Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

0.13-beta2 in-house providers required by tfstate fails in 0.13 #25374

Closed
mildred opened this issue Jun 24, 2020 · 3 comments
Closed

0.13-beta2 in-house providers required by tfstate fails in 0.13 #25374

mildred opened this issue Jun 24, 2020 · 3 comments
Labels
v0.13 Issues (primarily bugs) reported against v0.13 releases

Comments

@mildred
Copy link
Contributor

mildred commented Jun 24, 2020

Terraform Version

Terraform v0.13.0-beta2
+ provider registry.terraform.io/hashicorp/random v2.2.1

Description of the problem

When using in-house providers (sys provider in my example) with terraform 0.12, the provider gets registered in the tfstate. When using terraform 0.13, the hcl files can be updated to refer to the correct provider source (using the guide), but the tfstate still refers to the legacy provider source.

Given a terraform module which was upgraded to specify a source for the in-house provider sys, I get the following error when running terraform init in 0.13

Actual Behavior

+ terraform init
Initializing modules...

Initializing the backend...

Initializing provider plugins...
- Using previously-installed localhost/local/sys v1.0.0
- Using previously-installed hashicorp/random v2.2.1
- Using previously-installed hashicorp/template v2.1.2
- Using previously-installed -/random v2.2.1
- Using previously-installed -/template v2.1.2
- Finding latest version of -/sys...

Error: Failed to query available provider packages

Could not retrieve the list of available versions for provider -/sys: provider
registry registry.terraform.io does not have a provider named
registry.terraform.io/-/sys

Expected Behavior

Specifying the provider in the terraform files should be enough for terraform to understand the provider source in 0.12

Steps to Reproduce

I guess applying a module with in-house provider in 0.12, configure the module to work with 0.13 and run terraform init with 0.13

Additional Context

+ terraform providers

Providers required by configuration:
.
├── provider[registry.terraform.io/hashicorp/random]
├── provider[localhost/local/sys]
└── module.mailu
    ├── provider[localhost/local/sys]
    ├── provider[registry.terraform.io/hashicorp/random]
    ├── provider[registry.terraform.io/hashicorp/template]
    ├── module.mailu_addr
    │   ├── provider[registry.terraform.io/hashicorp/random]
    │   └── provider[localhost/local/sys]
    ├── module.nginx_proxy_service
    │   ├── provider[localhost/local/sys]
    │   └── provider[registry.terraform.io/hashicorp/template]
    ├── module.redis_proxy_service
    │   ├── provider[localhost/local/sys]
    │   └── provider[registry.terraform.io/hashicorp/template]
    └── module.admin_proxy_service
        ├── provider[localhost/local/sys]
        └── provider[registry.terraform.io/hashicorp/template]

Providers required by state:

    provider[registry.terraform.io/-/sys]

    provider[registry.terraform.io/-/random]

    provider[registry.terraform.io/-/template]

References

@apparentlymart
Copy link
Contributor

Hi @mildred! Thanks for reporting this.

We're currently iterating on that upgrade guide over in #25113, and there's some extra content in the latest version about the situation you're describing; look for the additional paragraphs at the end of the "In-house Providers" section.

With that said, because this requires changes to state I would not suggest following those instructions unless you are working in a temporary testing environment, because once the state is upgrade to use the new syntax it will no longer be readable by Terraform 0.12.

@apparentlymart apparentlymart added the v0.13 Issues (primarily bugs) reported against v0.13 releases label Jun 24, 2020
@apparentlymart
Copy link
Contributor

Hi again @mildred!

I just noticed that the existing issue #25346 is reporting the same problem, so I'm going to close this issue to consolidate the discussion over there. Thanks again!

@ghost
Copy link

ghost commented Jul 25, 2020

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.

If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@ghost ghost locked and limited conversation to collaborators Jul 25, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
v0.13 Issues (primarily bugs) reported against v0.13 releases
Projects
None yet
Development

No branches or pull requests

2 participants