-
Notifications
You must be signed in to change notification settings - Fork 988
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 result after apply #2185
Comments
I am facing the exact same issue with a different manifest. I am using ECK CRDs to setup elastic, kibana etc. First apply goes smoothly and resources get created but following terraform apply gives me similar error even if I don't make any changes to manifest. Is there anything missing in my configuration or is it really a bug? Terraform resource "kubernetes_manifest" "eck-kibana" {
manifest = yamldecode(templatefile("../scripts/eck/eck-kibana.yaml", {
namespace = kubernetes_namespace.observability.metadata[0].name
}))
} Manifest apiVersion: kibana.k8s.elastic.co/v1
kind: Kibana
metadata:
name: kibana
namespace: ${namespace}
spec:
version: 8.8.2
count: 1
elasticsearchRef:
name: elasticsearch
namespace: ${namespace}
enterpriseSearchRef:
name: enterprise-search
namespace: ${namespace}
config:
server:
publicBaseUrl: http://kibana.ai.internal
podTemplate:
spec:
nodeSelector:
workload-type: observability Command terraform apply -target=kubernetes_manifest.eck-kibana First apply output kubernetes_manifest.eck-kibana: Creating...
kubernetes_manifest.eck-kibana: Creation complete after 1s Second apply output with no changes anywhere Terraform used the selected providers to generate the following execution plan. Resource actions are indicated with the following symbols:
~ update in-place
Terraform will perform the following actions:
# kubernetes_manifest.eck-kibana will be updated in-place
~ resource "kubernetes_manifest" "eck-kibana" {
~ object = {
~ spec = {
~ podTemplate = {
- metadata = {
- creationTimestamp = null
}
~ spec = {
- containers = null
# (1 unchanged attribute hidden)
}
}
# (11 unchanged attributes hidden)
}
# (3 unchanged attributes hidden)
}
# (1 unchanged attribute hidden)
}
Plan: 0 to add, 1 to change, 0 to destroy.
kubernetes_manifest.eck-kibana: Modifying...
╷
│ Error: Provider produced inconsistent result after apply
│
│ When applying changes to kubernetes_manifest.eck-kibana, provider "provider[\"registry.terraform.io/hashicorp/kubernetes\"]" produced an unexpected new value:
│ .object: wrong final value type: incorrect object attributes.
│
│ This is a bug in the provider, which should be reported in the provider's own issue tracker.
╵ |
Hello, thanks for you help. I think the urgent question is.. since I saw the updates went through, and also the new state file looks plausible to me (long shot, I know), how scared should I be? It is a PRODUCTION environment. Thank you very much. |
+1 - there has been a regression |
Is it positive there was a regression. |
pinned to previous version as a workaround and issue was avoided |
@mcallaghan-geotab i am using version = "2.21.1" and still gives the same error, all computed fields are explicitly defined |
Confirm. Have just faced this. v2.21.0 is affected as well. |
We provided all computed_fields with default values part of the manifest key and that resolved the error, this can be a workaround as long as provider isnt fixed |
Hi, We are using hashicorp/kubernetes v2.16.1 and wanted to apply this manifest: │ │ When applying changes to │ module.eks-fs-cluster.kubectl_manifest.ingress_controller_secret["/api/v1/namespaces/ingress-nginx/secrets/ingress-nginx"], │ provider │ "module.eks-fs-cluster.provider["registry.terraform.io/gavinbunney/kubectl"]" │ 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. Please look into this issue |
Hi, having the same issue here. My configuration to apply
Error getting:
|
FWIW I was encountering this error on 2.23.0, rolling back to 2.21.1 resolved it for me. I am not explicitly defining the computed fields. |
I wouldn't hold your breath. This issue (the inconsistent final result after apply) has been around an extremely long time and the only response I've seen really are dismissive comments from maintainers about how this type of thing isn't a bug and/or something you need fixed. Sometimes adding the problematic field to computed_fields fixes it, often not. The gavinbunny/kubectl provider works as you'd expect it to. No idea why this repository doesn't do a similar thing. |
I encountered the same problem while trying to update: The problem was while i was trying to remove Apply was returning:
Apply was unsuccessful, I'm sure that there was nothing modifing that field of label outside of Terraform, confirmed that doing manual This seems to me like a bug either with applying the only label change in that resource or some problem with the state refresh and the change is getting rolled back after the inconsistent result of the current state. I tried rolling down the provider version to 2.20 and exerienced the same issue. |
Hello, we had an issue updating a resource.
The resource was actually updated, but we got several error messages and I am not sure of the terraform state we have now.
Thanks a lot.
Terraform Version, Provider Version and Kubernetes Version
Affected Resource(s)
resource "kubernetes_manifest" (argocd Application)
Terraform Configuration Files
Debug Output
Panic Output
Steps to Reproduce
We have the resource
apiVersion: argoproj.io/v1alpha1
kind: Application
and we want to update just one field:
spec.source.targetRevision
Expected Behavior
Resource updated
TF state updated
Actual Behavior
Resource updated
Error messages
TF state.. we do not know
Run terraform apply -input=false 9ef16c8acdfa418eff36bd96026dc74481b6ff2c.tfplan
kubernetes_manifest.buildbuddy: Modifying...
╷
│ Error: Provider produced inconsistent result after apply
│
│ When applying changes to kubernetes_manifest.buildbuddy, provider
│ "provider["registry.terraform.io/hashicorp/kubernetes"]" produced an
│ unexpected new value: .object.operation.initiatedBy.automated: was null,
│ but now cty.True.
│
│ 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 kubernetes_manifest.buildbuddy, provider
│ "provider["registry.terraform.io/hashicorp/kubernetes"]" produced an
│ unexpected new value: .object.operation.retry.limit: was null, but now
│ cty.NumberIntVal(5).
│
│ 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 kubernetes_manifest.buildbuddy, provider
│ "provider["registry.terraform.io/hashicorp/kubernetes"]" produced an
│ unexpected new value: .object.operation.sync.resources: was null, but now
│ cty.ListVal([]cty.Valuecty.ObjectVal(map[string]cty.Value"group":cty.StringVal("argoproj.io"),
│ "kind":cty.StringVal("Application"), "name":cty.StringVal("zuul-ci"),
│ "namespace":cty.NullVal(cty.String)),
│ cty.ObjectVal(map[string]cty.Value"group":cty.StringVal("argoproj.io"),
│ "kind":cty.StringVal("AppProject"), "name":cty.StringVal("jenkins"),
│ "namespace":cty.NullVal(cty.String))).
│
│ 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 kubernetes_manifest.buildbuddy, provider
│ "provider["registry.terraform.io/hashicorp/kubernetes"]" produced an
│ unexpected new value: .object.operation.sync.revision: was null, but now
│ cty.StringVal("d7207271230f926f89aa02f8000ccd9c92827135").
│
│ 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 kubernetes_manifest.buildbuddy, provider
│ "provider["registry.terraform.io/hashicorp/kubernetes"]" produced an
│ unexpected new value: .object.operation.sync.syncOptions: was null, but now
│ cty.ListVal([]cty.Valuecty.StringVal("ApplyOutOfSyncOnly=true"),
│ cty.StringVal("PruneLast=true"), cty.StringVal("CreateNamespace=true")).
│
│ 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 kubernetes_manifest.buildbuddy, provider
│ "provider["registry.terraform.io/hashicorp/kubernetes"]" produced an
│ unexpected new value: .object.metadata.annotations: new element
│ "kubectl.kubernetes.io/last-applied-configuration" has appeared.
│
│ This is a bug in the provider, which should be reported in the provider's
│ own issue tracker.
╵
Error: Process completed with exit code 1.
Important Factoids
References
Community Note
The text was updated successfully, but these errors were encountered: