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

[BUG] provider falsely believes provider configuration has been removed when trying to "destroy" a resource #11

Open
risicle opened this issue Jul 26, 2021 · 0 comments
Assignees
Labels
bug Something isn't working

Comments

@risicle
Copy link

risicle commented Jul 26, 2021

Describe the bug

After removing an errorcheck resource from the terraform source (but leaving its provider configuration in place), initialization complains that the configuration has been removed:

Initializing provider plugins...

- terraform.io/builtin/terraform is built in to Terraform

- Finding camptocamp/pass versions matching "1.4.0"...

- Finding hashicorp/template versions matching "2.2.0"...

- Finding rhythmictech/errorcheck versions matching "3.0.0"...

- Finding hashicorp/aws versions matching "3.15.*"...

- Installing camptocamp/pass v1.4.0...

- Installed camptocamp/pass v1.4.0 (self-signed, key ID 163053567AE86934)

- Installing hashicorp/template v2.2.0...

- Installed hashicorp/template v2.2.0 (self-signed, key ID 34365D9472D7468F)

- Installing rhythmictech/errorcheck v3.0.0...

- Installed rhythmictech/errorcheck v3.0.0 (self-signed, key ID 7F8B4494D2DCE450)

- Installing hashicorp/aws v3.15.0...

- Installed hashicorp/aws v3.15.0 (self-signed, key ID 34365D9472D7468F)


Partner and community providers are signed by their developers.

If you'd like to know more about provider signing, you can read about it here:

https://www.terraform.io/docs/plugins/signing.html


Terraform has been successfully initialized!


You may now begin working with Terraform. Try running "terraform plan" to see

any changes that are required for your infrastructure. All Terraform commands

should now work.


If you ever set or change modules or backend configuration for Terraform,

rerun this command to reinitialize your working directory. If you forget, other

commands will detect it and remind you to do so if necessary.


Error: Provider configuration not present


To work with

module.alertmanager.errorcheck_is_valid.alertmanager_config_file_valid_yaml

its original provider configuration at

provider["registry.terraform.io/rhythmictech/errorcheck"] is required, but it

has been removed. This occurs when a provider configuration is removed while

objects created by that provider still exist in the state. Re-add the provider

configuration to destroy

module.alertmanager.errorcheck_is_valid.alertmanager_config_file_valid_yaml,

after which you can remove the provider configuration again.

☝️ It even lists the provider being found here. The required_providers = { block is still present in both the sub-module (unversioned) and the deployment's top-level module (versioned).

This of course leaves you in a tricky situation unable to get rid of your old resource - to resolve this I had to manually terraform state rm ....

terraform v0.13.3, terraform-provider-errorcheck v3.0.0, linux.

This isn't the biggest deal in the world because it looks like I should probably be preferring the new module anyway, just thought I should document this in case anyone else runs into it.

@risicle risicle added the bug Something isn't working label Jul 26, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants