-
Notifications
You must be signed in to change notification settings - Fork 66
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
Provider produced inconsistent final plan #236
Comments
Hi there @ralvarezmar 👋🏻 , thanks for reporting the issue and sorry you're running into trouble here. To help us narrow down your issue, can you provide a snippet of your terraform configuration? Specifically the |
The local file is kubeconfig file:
And the configuration in terraform is:
|
Thanks for supplying that info 👍🏻 , I don't see it in the docs for (there may be an additional problem in the |
Ok, i will try it changing this resource. So the problem is in azurerm provider and not in hashicorp/local provider? |
I believe we too just had this issue, pipeline had been running fine each day, we upgraded the kubernetes version from 1.26.3 to 1.26.6 and that worked but when we wrote out the kube.config using resource "local_sensitive_file" we received the following error,
We added some debug to the pipeline using null_resource which didn't end up displaying due to sensitive values but on the next run the error disappeared and the resource applied correctly. Our versions in case it helps shed light on the issue,
We have a few more version upgrades to perform will advise if we see it again. |
We have just stepped to the next version and I can confirm we see the bug on the pipeline run with the kubernetes version change, subsequent runs it comes right |
Confirming this happened on every single kubernetes version upgrade 1.26.3 -> 1.26.6 -> 1.26.10 -> 1.27.3 -> 1.27.7 -> 1.28.3 Ran TF_DEBUG this time and got the following which helped locate it,
Looks like the resource is removed and a new one created and padded out in memory with nulls ready for values to come after apply,
However when it makes an http PUT request to write the state file to storage it contains an empty resource -> "instances": [],
And this is what is written to state file,
On subsequent runs its populated and works fine from there until the next upgrade. Is a ".SetID" in the "Create" required around here -> https://github.com/hashicorp/terraform-provider-local/blob/5c130fb2ed401765158856c407ee0684e308972e/internal/provider/resource_local_sensitive_file.go#L214C2-L214C19 eg,
|
I'm not able to offer much information as I had to quickly revert my TF version to get the issue (kinda) resolved/get some work done...but I experienced the same problem. I'd been using TF v1.3.8 with zero problems, ran an upgrade to v1.7.1 this morning and suddenly I couldn't run deploys (apply) using the same code as before. Error message was |
Any chance this might be related to hashicorp/terraform#33234 (in v1.6.0)? Long story but I can tell you that as I've run the same code on a few different systems since my original comment. v.1.6.6 didn't work but v1.4.7, v1.5.5 and v1.5.7 worked as expected. EDIT - installed v.1.6.0 and tried again...blew up in my face. To reiterate I'm OK up to v.1.5.7, then things begin not working in v.1.6.0 (and beyond). |
It is possible (but not yet proven) that an error like this could be caused by a problem in another provider. I'm sharing the following in case it helps with debugging on this issue, but I don't have enough information here to debug this directly myself. The error message described in this issue is one of Terraform's "consistency checks" to try to contain the impact of a buggy provider. Terraform first creates a plan during the planning phase using a partial configuration (because of references to other objects that haven't been fully created/updated yet) and then planned again during the apply phase with full information, thereby creating the "final plan" that the error message mentions. Terraform then checks to make sure that the final plan is consistent with the initial plan. "Consistent" is a shorthand for a number of different rules, but the most important rule (and the one that causes this most often) is if the provider returned a concrete known value in the initial plan but then returned a different known value in the final plan. Providers that cannot reliably predict the values in the final plan are supposed to use unknown value placeholders during planning to represent that. However, some providers are built with a legacy Terraform SDK that was originally made for much older versions of Terraform, and those earlier Terraform versions had fewer of these safety checks. To avoid breaking those older providers, Terraform chooses to tolerate some consistency problems that tend to be caused by bugs and quirks of the old SDK, rather than true provider misbehavior. Unfortunately problems can arise when a provider using the legacy SDK is used in conjunction with one that uses the modern plugin framework: if a result from the old-style provider is used as an argument to a new-style provider then Terraform will tolerate an inconsistent result from the first provider, but then the inconsistent result will propagate to the second provider, making its result appear inconsistent. In that case, Terraform misreports that the problem was with the new-style provider instead of the old-style provider, because the upstream problem wasn't contained sufficiently. The This is a situation that we can typically diagnose when full internal logs are provided, because Terraform Core emits internal warnings when it "tolerates" an inconsistency with a legacy-SDK provider. The warning equivalent of an error like we see in this issue would look something like this:
The message would then include a list of the detected consistency problems, which we could then use to report a bug upstream (in the other provider) if appropriate. If you experience this issue and are able to reproduce it, you can help with getting this resolved by running your reproduction with the environment variable If you share messages that fit this description in subsequent comments -- along with the relevant parts of the configuration they relate to -- then I'd be happy to help with diagnosing whether they might be a cause of this error, and figuring out what bug we might report upstream if so. If there's no such message then that would also be useful information to know, because it would suggest that the bug is likely in the Thanks! |
Terraform CLI and Provider Versions
terraform version 1.2.3 and the version of hashicorp local is 2.4.0
Terraform Configuration
Expected Behavior
This error shouldn't appear and it have to work without problems
Actual Behavior
In first place, terraform plan work it correctly. I do a terraform apply and fail, but if you execute again work without problems
Steps to Reproduce
terraform apply
How much impact is this issue causing?
Medium
Logs
No response
Additional Information
terraform apply -auto-approve tfplan
╷
│ Warning: "use_microsoft_graph": [DEPRECATED] This field now defaults to
true
and will be removed in v1.3 of Terraform Core due to the deprecation of ADAL by Microsoft.│
│
╵
azurerm_kubernetes_cluster.aks: Modifying... [id=/subscriptions//resourceGroups/rg-condorcloud-pre/providers/Microsoft.ContainerService/managedClusters/aks-condor-pre]
azurerm_kubernetes_cluster.aks: Still modifying... [id=/subscriptions/ae3abbb9-1ae5-4775-954c-...Service/managedClusters/aks-condor-pre, 10s elapsed]
azurerm_kubernetes_cluster.aks: Still modifying... [id=/subscriptions/ae3abbb9-1ae5-4775-954c-...Service/managedClusters/aks-condor-pre, 20s elapsed]
azurerm_kubernetes_cluster.aks: Still modifying... [id=/subscriptions/ae3abbb9-1ae5-4775-954c-...Service/managedClusters/aks-condor-pre, 30s elapsed]
azurerm_kubernetes_cluster.aks: Still modifying... [id=/subscriptions/ae3abbb9-1ae5-4775-954c-...Service/managedClusters/aks-condor-pre, 40s elapsed]
azurerm_kubernetes_cluster.aks: Still modifying... [id=/subscriptions/ae3abbb9-1ae5-4775-954c-...Service/managedClusters/aks-condor-pre, 50s elapsed]
azurerm_kubernetes_cluster.aks: Still modifying... [id=/subscriptions/ae3abbb9-1ae5-4775-954c-...Service/managedClusters/aks-condor-pre, 1m0s elapsed]
azurerm_kubernetes_cluster.aks: Still modifying... [id=/subscriptions/ae3abbb9-1ae5-4775-954c-...Service/managedClusters/aks-condor-pre, 1m10s elapsed]
azurerm_kubernetes_cluster.aks: Still modifying... [id=/subscriptions/ae3abbb9-1ae5-4775-954c-...Service/managedClusters/aks-condor-pre, 1m20s elapsed]
azurerm_kubernetes_cluster.aks: Still modifying... [id=/subscriptions/ae3abbb9-1ae5-4775-954c-...Service/managedClusters/aks-condor-pre, 1m30s elapsed]
azurerm_kubernetes_cluster.aks: Still modifying... [id=/subscriptions/ae3abbb9-1ae5-4775-954c-...Service/managedClusters/aks-condor-pre, 1m40s elapsed]
azurerm_kubernetes_cluster.aks: Still modifying... [id=/subscriptions/ae3abbb9-1ae5-4775-954c-...Service/managedClusters/aks-condor-pre, 1m50s elapsed]
azurerm_kubernetes_cluster.aks: Still modifying... [id=/subscriptions/ae3abbb9-1ae5-4775-954c-...Service/managedClusters/aks-condor-pre, 2m0s elapsed]
azurerm_kubernetes_cluster.aks: Still modifying... [id=/subscriptions/ae3abbb9-1ae5-4775-954c-...Service/managedClusters/aks-condor-pre, 2m10s elapsed]
azurerm_kubernetes_cluster.aks: Still modifying... [id=/subscriptions/ae3abbb9-1ae5-4775-954c-...Service/managedClusters/aks-condor-pre, 2m20s elapsed]
azurerm_kubernetes_cluster.aks: Still modifying... [id=/subscriptions/ae3abbb9-1ae5-4775-954c-...Service/managedClusters/aks-condor-pre, 2m30s elapsed]
azurerm_kubernetes_cluster.aks: Still modifying... [id=/subscriptions/ae3abbb9-1ae5-4775-954c-...Service/managedClusters/aks-condor-pre, 2m40s elapsed]
azurerm_kubernetes_cluster.aks: Still modifying... [id=/subscriptions/ae3abbb9-1ae5-4775-954c-...Service/managedClusters/aks-condor-pre, 2m50s elapsed]
azurerm_kubernetes_cluster.aks: Still modifying... [id=/subscriptions/ae3abbb9-1ae5-4775-954c-...Service/managedClusters/aks-condor-pre, 3m0s elapsed]
azurerm_kubernetes_cluster.aks: Still modifying... [id=/subscriptions/ae3abbb9-1ae5-4775-954c-...Service/managedClusters/aks-condor-pre, 3m10s elapsed]
azurerm_kubernetes_cluster.aks: Still modifying... [id=/subscriptions/ae3abbb9-1ae5-4775-954c-...Service/managedClusters/aks-condor-pre, 3m20s elapsed]
azurerm_kubernetes_cluster.aks: Still modifying... [id=/subscriptions/ae3abbb9-1ae5-4775-954c-...Service/managedClusters/aks-condor-pre, 3m30s elapsed]
azurerm_kubernetes_cluster.aks: Still modifying... [id=/subscriptions/ae3abbb9-1ae5-4775-954c-...Service/managedClusters/aks-condor-pre, 3m40s elapsed]
azurerm_kubernetes_cluster.aks: Still modifying... [id=/subscriptions/ae3abbb9-1ae5-4775-954c-...Service/managedClusters/aks-condor-pre, 3m50s elapsed]
azurerm_kubernetes_cluster.aks: Still modifying... [id=/subscriptions/ae3abbb9-1ae5-4775-954c-...Service/managedClusters/aks-condor-pre, 4m0s elapsed]
azurerm_kubernetes_cluster.aks: Still modifying... [id=/subscriptions/ae3abbb9-1ae5-4775-954c-...Service/managedClusters/aks-condor-pre, 4m10s elapsed]
azurerm_kubernetes_cluster.aks: Still modifying... [id=/subscriptions/ae3abbb9-1ae5-4775-954c-...Service/managedClusters/aks-condor-pre, 4m20s elapsed]
azurerm_kubernetes_cluster.aks: Still modifying... [id=/subscriptions/ae3abbb9-1ae5-4775-954c-...Service/managedClusters/aks-condor-pre, 4m30s elapsed]
azurerm_kubernetes_cluster.aks: Still modifying... [id=/subscriptions/ae3abbb9-1ae5-4775-954c-...Service/managedClusters/aks-condor-pre, 4m40s elapsed]
azurerm_kubernetes_cluster.aks: Still modifying... [id=/subscriptions/ae3abbb9-1ae5-4775-954c-...Service/managedClusters/aks-condor-pre, 4m50s elapsed]
azurerm_kubernetes_cluster.aks: Still modifying... [id=/subscriptions/ae3abbb9-1ae5-4775-954c-...Service/managedClusters/aks-condor-pre, 5m0s elapsed]
azurerm_kubernetes_cluster.aks: Still modifying... [id=/subscriptions/ae3abbb9-1ae5-4775-954c-...Service/managedClusters/aks-condor-pre, 5m10s elapsed]
azurerm_kubernetes_cluster.aks: Still modifying... [id=/subscriptions/ae3abbb9-1ae5-4775-954c-...Service/managedClusters/aks-condor-pre, 5m20s elapsed]
azurerm_kubernetes_cluster.aks: Still modifying... [id=/subscriptions/ae3abbb9-1ae5-4775-954c-...Service/managedClusters/aks-condor-pre, 5m30s elapsed]
azurerm_kubernetes_cluster.aks: Still modifying... [id=/subscriptions/ae3abbb9-1ae5-4775-954c-...Service/managedClusters/aks-condor-pre, 5m40s elapsed]
azurerm_kubernetes_cluster.aks: Still modifying... [id=/subscriptions/ae3abbb9-1ae5-4775-954c-...Service/managedClusters/aks-condor-pre, 5m50s elapsed]
azurerm_kubernetes_cluster.aks: Still modifying... [id=/subscriptions/ae3abbb9-1ae5-4775-954c-...Service/managedClusters/aks-condor-pre, 6m0s elapsed]
azurerm_kubernetes_cluster.aks: Still modifying... [id=/subscriptions/ae3abbb9-1ae5-4775-954c-...Service/managedClusters/aks-condor-pre, 6m10s elapsed]
azurerm_kubernetes_cluster.aks: Still modifying... [id=/subscriptions/ae3abbb9-1ae5-4775-954c-...Service/managedClusters/aks-condor-pre, 6m20s elapsed]
azurerm_kubernetes_cluster.aks: Still modifying... [id=/subscriptions/ae3abbb9-1ae5-4775-954c-...Service/managedClusters/aks-condor-pre, 6m30s elapsed]
azurerm_kubernetes_cluster.aks: Still modifying... [id=/subscriptions/ae3abbb9-1ae5-4775-954c-...Service/managedClusters/aks-condor-pre, 6m40s elapsed]
azurerm_kubernetes_cluster.aks: Still modifying... [id=/subscriptions/ae3abbb9-1ae5-4775-954c-...Service/managedClusters/aks-condor-pre, 6m50s elapsed]
azurerm_kubernetes_cluster.aks: Still modifying... [id=/subscriptions/ae3abbb9-1ae5-4775-954c-...Service/managedClusters/aks-condor-pre, 7m0s elapsed]
azurerm_kubernetes_cluster.aks: Still modifying... [id=/subscriptions/ae3abbb9-1ae5-4775-954c-...Service/managedClusters/aks-condor-pre, 7m10s elapsed]
azurerm_kubernetes_cluster.aks: Still modifying... [id=/subscriptions/ae3abbb9-1ae5-4775-954c-...Service/managedClusters/aks-condor-pre, 7m20s elapsed]
azurerm_kubernetes_cluster.aks: Still modifying... [id=/subscriptions/ae3abbb9-1ae5-4775-954c-...Service/managedClusters/aks-condor-pre, 7m30s elapsed]
azurerm_kubernetes_cluster.aks: Still modifying... [id=/subscriptions/ae3abbb9-1ae5-4775-954c-...Service/managedClusters/aks-condor-pre, 7m40s elapsed]
azurerm_kubernetes_cluster.aks: Still modifying... [id=/subscriptions/ae3abbb9-1ae5-4775-954c-...Service/managedClusters/aks-condor-pre, 7m50s elapsed]
azurerm_kubernetes_cluster.aks: Still modifying... [id=/subscriptions/ae3abbb9-1ae5-4775-954c-...Service/managedClusters/aks-condor-pre, 8m0s elapsed]
azurerm_kubernetes_cluster.aks: Still modifying... [id=/subscriptions/ae3abbb9-1ae5-4775-954c-...Service/managedClusters/aks-condor-pre, 8m10s elapsed]
azurerm_kubernetes_cluster.aks: Still modifying... [id=/subscriptions/ae3abbb9-1ae5-4775-954c-...Service/managedClusters/aks-condor-pre, 8m20s elapsed]
azurerm_kubernetes_cluster.aks: Still modifying... [id=/subscriptions/ae3abbb9-1ae5-4775-954c-...Service/managedClusters/aks-condor-pre, 8m30s elapsed]
azurerm_kubernetes_cluster.aks: Still modifying... [id=/subscriptions/ae3abbb9-1ae5-4775-954c-...Service/managedClusters/aks-condor-pre, 8m40s elapsed]
azurerm_kubernetes_cluster.aks: Still modifying... [id=/subscriptions/ae3abbb9-1ae5-4775-954c-...Service/managedClusters/aks-condor-pre, 8m50s elapsed]
azurerm_kubernetes_cluster.aks: Still modifying... [id=/subscriptions/ae3abbb9-1ae5-4775-954c-...Service/managedClusters/aks-condor-pre, 9m0s elapsed]
azurerm_kubernetes_cluster.aks: Still modifying... [id=/subscriptions/ae3abbb9-1ae5-4775-954c-...Service/managedClusters/aks-condor-pre, 9m10s elapsed]
azurerm_kubernetes_cluster.aks: Still modifying... [id=/subscriptions/ae3abbb9-1ae5-4775-954c-...Service/managedClusters/aks-condor-pre, 9m20s elapsed]
azurerm_kubernetes_cluster.aks: Still modifying... [id=/subscriptions/ae3abbb9-1ae5-4775-954c-...Service/managedClusters/aks-condor-pre, 9m30s elapsed]
azurerm_kubernetes_cluster.aks: Still modifying... [id=/subscriptions/ae3abbb9-1ae5-4775-954c-...Service/managedClusters/aks-condor-pre, 9m40s elapsed]
azurerm_kubernetes_cluster.aks: Still modifying... [id=/subscriptions/ae3abbb9-1ae5-4775-954c-...Service/managedClusters/aks-condor-pre, 9m50s elapsed]
azurerm_kubernetes_cluster.aks: Still modifying... [id=/subscriptions/ae3abbb9-1ae5-4775-954c-...Service/managedClusters/aks-condor-pre, 10m0s elapsed]
azurerm_kubernetes_cluster.aks: Still modifying... [id=/subscriptions/ae3abbb9-1ae5-4775-954c-...Service/managedClusters/aks-condor-pre, 10m10s elapsed]
azurerm_kubernetes_cluster.aks: Still modifying... [id=/subscriptions/ae3abbb9-1ae5-4775-954c-...Service/managedClusters/aks-condor-pre, 10m20s elapsed]
azurerm_kubernetes_cluster.aks: Still modifying... [id=/subscriptions/ae3abbb9-1ae5-4775-954c-...Service/managedClusters/aks-condor-pre, 10m30s elapsed]
azurerm_kubernetes_cluster.aks: Still modifying... [id=/subscriptions/ae3abbb9-1ae5-4775-954c-...Service/managedClusters/aks-condor-pre, 10m40s elapsed]
azurerm_kubernetes_cluster.aks: Still modifying... [id=/subscriptions/ae3abbb9-1ae5-4775-954c-...Service/managedClusters/aks-condor-pre, 10m50s elapsed]
azurerm_kubernetes_cluster.aks: Still modifying... [id=/subscriptions/ae3abbb9-1ae5-4775-954c-...Service/managedClusters/aks-condor-pre, 11m0s elapsed]
azurerm_kubernetes_cluster.aks: Still modifying... [id=/subscriptions/ae3abbb9-1ae5-4775-954c-...Service/managedClusters/aks-condor-pre, 11m10s elapsed]
azurerm_kubernetes_cluster.aks: Still modifying... [id=/subscriptions/ae3abbb9-1ae5-4775-954c-...Service/managedClusters/aks-condor-pre, 11m20s elapsed]
azurerm_kubernetes_cluster.aks: Still modifying... [id=/subscriptions/ae3abbb9-1ae5-4775-954c-...Service/managedClusters/aks-condor-pre, 11m30s elapsed]
azurerm_kubernetes_cluster.aks: Still modifying... [id=/subscriptions/ae3abbb9-1ae5-4775-954c-...Service/managedClusters/aks-condor-pre, 11m40s elapsed]
azurerm_kubernetes_cluster.aks: Still modifying... [id=/subscriptions/ae3abbb9-1ae5-4775-954c-...Service/managedClusters/aks-condor-pre, 11m50s elapsed]
azurerm_kubernetes_cluster.aks: Still modifying... [id=/subscriptions/ae3abbb9-1ae5-4775-954c-...Service/managedClusters/aks-condor-pre, 12m0s elapsed]
azurerm_kubernetes_cluster.aks: Still modifying... [id=/subscriptions/ae3abbb9-1ae5-4775-954c-...Service/managedClusters/aks-condor-pre, 12m10s elapsed]
azurerm_kubernetes_cluster.aks: Still modifying... [id=/subscriptions/ae3abbb9-1ae5-4775-954c-...Service/managedClusters/aks-condor-pre, 12m20s elapsed]
azurerm_kubernetes_cluster.aks: Still modifying... [id=/subscriptions/ae3abbb9-1ae5-4775-954c-...Service/managedClusters/aks-condor-pre, 12m30s elapsed]
azurerm_kubernetes_cluster.aks: Still modifying... [id=/subscriptions/ae3abbb9-1ae5-4775-954c-...Service/managedClusters/aks-condor-pre, 12m40s elapsed]
azurerm_kubernetes_cluster.aks: Still modifying... [id=/subscriptions/ae3abbb9-1ae5-4775-954c-...Service/managedClusters/aks-condor-pre, 12m50s elapsed]
azurerm_kubernetes_cluster.aks: Still modifying... [id=/subscriptions/ae3abbb9-1ae5-4775-954c-...Service/managedClusters/aks-condor-pre, 13m0s elapsed]
azurerm_kubernetes_cluster.aks: Still modifying... [id=/subscriptions/ae3abbb9-1ae5-4775-954c-...Service/managedClusters/aks-condor-pre, 13m10s elapsed]
azurerm_kubernetes_cluster.aks: Modifications complete after 13m20s [id=/subscriptions//resourceGroups/rg-condorcloud-pre/providers/Microsoft.ContainerService/managedClusters/aks-condor-pre]
╷
│ Warning: Argument is deprecated
│
│ with azurerm_kubernetes_cluster.aks,
│ on aks.tf line 9, in resource "azurerm_kubernetes_cluster" "aks":
│ 9: api_server_authorized_ip_ranges = var.api_server_authorized_ip_ranges
│
│ This property has been renamed to
authorized_ip_ranges
within the│
api_server_access_profile
block and will be removed in v4.0 of the│ provider
╵
╷
│ Error: Provider produced inconsistent final plan
│
│ When expanding the plan for local_file.aks_kube_config to include new
│ values learned so far during apply, provider
│ "registry.terraform.io/hashicorp/local" produced an invalid new value for
│ .content: inconsistent values for sensitive attribute.
│
│ This is a bug in the provider, which should be reported in the provider's
│ own issue tracker.
╵
Code of Conduct
The text was updated successfully, but these errors were encountered: