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

Error: Provider produced inconsistent result after apply #10227

Closed
dkirrane opened this issue Jan 18, 2021 · 9 comments
Closed

Error: Provider produced inconsistent result after apply #10227

dkirrane opened this issue Jan 18, 2021 · 9 comments

Comments

@dkirrane
Copy link

dkirrane commented Jan 18, 2021

Community Note

  • Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request
  • Please do not leave "+1" or "me too" comments, they generate extra noise for issue followers and do not help prioritize the request
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment

Terraform (and AzureRM Provider) Version

Affected Resource(s)

azurerm_key_vault_secret

terraform -v
Terraform v0.13.5
+ provider registry.terraform.io/aiven/aiven v2.1.3
+ provider registry.terraform.io/hashicorp/azuread v1.1.1
+ provider registry.terraform.io/hashicorp/azurerm v2.33.0
+ provider registry.terraform.io/hashicorp/random v3.0.0

Terraform Configuration Files

resource "azurerm_key_vault_secret" "cluster_name" {
  name            = "aks-cluster-name"
  value            = module.aks.name
  key_vault_id = data.terraform_remote_state.storage.outputs.key_vault_id
}

Debug Output

Panic Output

none

Expected Behaviour

works

Actual Behaviour

Error: Provider produced inconsistent result after apply

When applying changes to azurerm_key_vault_secret.cluster_name, provider
"registry.terraform.io/hashicorp/azurerm" produced an unexpected new value:
Root resource was present, but now absent.

This is a bug in the provider, which should be reported in the provider's own
issue tracker.

Steps to Reproduce

Running plan from Terraform Cloud workspace.
This is intermittent. Typically we just re-run and the issue goes away.

References

I'm assuming this is an azurerm provider issues based on this hashicorp/terraform#20688

@sshah90
Copy link

sshah90 commented Jan 29, 2021

Facing the same issue with azurerm_key_vault_key.

azurerm Version

$ terraform -v
Terraform v0.13.5
+ provider registry.terraform.io/hashicorp/azurerm v2.45.0
+ provider registry.terraform.io/hashicorp/null v3.0.0

logs

azurerm_key_vault_key.generated: Still creating... [10s elapsed]
azurerm_key_vault_key.generated: Still creating... [20s elapsed]
azurerm_key_vault_key.generated: Still creating... [30s elapsed]
azurerm_key_vault_key.generated: Still creating... [40s elapsed]
azurerm_key_vault_key.generated: Still creating... [50s elapsed]
azurerm_key_vault_key.generated: Still creating... [1m0s elapsed]
azurerm_key_vault_key.generated: Still creating... [1m10s elapsed]
azurerm_key_vault_key.generated: Still creating... [1m20s elapsed]
azurerm_key_vault_key.generated: Still creating... [1m30s elapsed]
azurerm_key_vault_key.generated: Still creating... [1m40s elapsed]
azurerm_key_vault_key.generated: Still creating... [1m50s elapsed]
azurerm_key_vault_key.generated: Still creating... [2m0s elapsed]
Error: Provider produced inconsistent result after apply

When applying changes to azurerm_key_vault_key.generated, provider
"registry.terraform.io/hashicorp/azurerm" produced an unexpected new value:
Root resource was present, but now absent.

This is a bug in the provider, which should be reported in the provider's own
issue tracker.

@brianmoritz
Copy link

brianmoritz commented Feb 3, 2021

I had the same error with azurerm_role_definition, upgrading to the latest version of TF and provider seems to have fixed it for me.

terraform -v
Terraform v0.14.5
+ provider registry.terraform.io/hashicorp/azuread v1.3.0
+ provider registry.terraform.io/hashicorp/azurerm v2.45.1

@tombuildsstuff
Copy link
Contributor

👋

Taking a look through here whilst the issue is slightly different, I believe the root cause is the same issue as in #10371, so rather than having multiple issues open tracking the same thing, I'm going to close this in favour of #10371 - would you mind subscribing to that issue for updates?

Thanks!

@dkirrane
Copy link
Author

dkirrane commented Feb 10, 2021

/reopen still seeing this issue with

    azurerm = {
      source  = "hashicorp/azurerm"
      version = "2.46.1"
    }

@vas6ili
Copy link

vas6ili commented Feb 16, 2021

This issue still happens with 2.46.1 and 2.47.0 providers, I've seen it happen 3 times in a row

Initializing provider plugins...
- Finding hashicorp/azurerm versions matching "2.47.0"...
- Installing hashicorp/azurerm v2.47.0...
- Installed hashicorp/azurerm v2.47.0 (signed by HashiCorp)

....

azurerm_key_vault_secret.subnet-id[1]: Creating...
azurerm_key_vault_secret.subnet-id[0]: Creating...

Error: Provider produced inconsistent result after apply

When applying changes to azurerm_key_vault_secret.tm-fqdn, provider
"registry.terraform.io/hashicorp/azurerm" produced an unexpected new value:
Root resource was present, but now absent.

This is a bug in the provider, which should be reported in the provider's own
issue tracker.


Error: Provider produced inconsistent result after apply

When applying changes to azurerm_key_vault_secret.subnet-id[0], provider
"registry.terraform.io/hashicorp/azurerm" produced an unexpected new value:
Root resource was present, but now absent.

This is a bug in the provider, which should be reported in the provider's own
issue tracker.


Error: Provider produced inconsistent result after apply

When applying changes to azurerm_key_vault_secret.subnet-id[1], provider
"registry.terraform.io/hashicorp/azurerm" produced an unexpected new value:
Root resource was present, but now absent.

This is a bug in the provider, which should be reported in the provider's own
issue tracker.

@dkirrane
Copy link
Author

@tombuildsstuff could you reopen

@alxy
Copy link
Contributor

alxy commented Feb 24, 2021

It seems to me that this happens when multiple terraform scripts write secrets to the same key vault that has not been created by terraform itself (or a different terraform run). Is this not supported?

@dkirrane
Copy link
Author

@alxy yes I see same. In my case first plan creates Key Vault is created by Terraform plan. Then a Run Trigger kicks off another plan that fails when trying to add a secret to Key Vault.

I'm using data.terraform_remote_state.storage.outputs.key_vault_id to lookup the key vault id from first plan

@ghost
Copy link

ghost commented Mar 6, 2021

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 feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. If you feel I made an error 🤖 🙉 , please reach out to my human friends 👉 [email protected]. Thanks!

@ghost ghost locked as resolved and limited conversation to collaborators Mar 6, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

7 participants