Closed gardun0 closed 1 year ago
this is a duplicate of #1359
this issue is still happening in 2.8.0 version, i get this error
Stack trace from the terraform-provider-kubernetes_v2.8.0_x5 plugin:
panic: ElementKeyInt(0): can't use tftypes.Object["authentication":tftypes.Object["enable":tftypes.Bool, "keyAuth":tftypes.Object["header":tftypes.String], "type":tftypes.String], "backends":tftypes.List[tftypes.Object["resolveGranularity":tftypes.String, "serviceName":tftypes.String, "servicePort":tftypes.Number, "subset":tftypes.String, "weight":tftypes.Number]], "match":tftypes.Object["exprs":tftypes.List[tftypes.Object["op":tftypes.String, "set":tftypes.List[tftypes.String], "subject":tftypes.Object["name":tftypes.String, "scope":tftypes.String], "value":tftypes.String]], "hosts":tftypes.List[tftypes.String], "methods":tftypes.List[tftypes.String], "paths":tftypes.List[tftypes.String], "remoteAddrs":tftypes.List[tftypes.String]], "name":tftypes.String, "plugins":tftypes.Tuple[tftypes.Object["config":tftypes.DynamicPseudoType, "enable":tftypes.Bool, "name":tftypes.String], tftypes.Object["config":tftypes.DynamicPseudoType, "enable":tftypes.Bool, "name":tftypes.String]], "priority":tftypes.Number, "timeout":tftypes.Object["connect":tftypes.String, "read":tftypes.String, "send":tftypes.String], "websocket":tftypes.Bool] as tftypes.Object["authentication":tftypes.Object["enable":tftypes.Bool, "keyAuth":tftypes.Object["header":tftypes.String], "type":tftypes.String], "backends":tftypes.List[tftypes.Object["resolveGranularity":tftypes.String, "serviceName":tftypes.String, "servicePort":tftypes.Number, "subset":tftypes.String, "weight":tftypes.Number]], "match":tftypes.Object["exprs":tftypes.List[tftypes.Object["op":tftypes.String, "set":tftypes.List[tftypes.String], "subject":tftypes.Object["name":tftypes.String, "scope":tftypes.String], "value":tftypes.String]], "hosts":tftypes.List[tftypes.String], "methods":tftypes.List[tftypes.String], "paths":tftypes.List[tftypes.String], "remoteAddrs":tftypes.List[tftypes.String]], "name":tftypes.String, "plugins":tftypes.Tuple[tftypes.Object["config":tftypes.DynamicPseudoType, "enable":tftypes.Bool, "name":tftypes.String]], "priority":tftypes.Number, "timeout":tftypes.Object["connect":tftypes.String, "read":tftypes.String, "send":tftypes.String], "websocket":tftypes.Bool]
goroutine 144 [running]:
github.com/hashicorp/terraform-plugin-go/tftypes.NewValue(...)
/opt/teamcity-agent/work/5d79fe75d4460a2f/src/github.com/hashicorp/terraform-provider-kubernetes/vendor/github.com/hashicorp/terraform-plugin-go/tftypes/value.go:277
github.com/hashicorp/terraform-provider-kubernetes/manifest/morph.morphTupleIntoType(0x2fe9888, 0xc001ce5710, 0x2960860, 0xc000f32e88, 0x2fe9888, 0xc007715920, 0xc00217b950, 0x110000000bcbc6d0, 0x203001, 0x203001, ...)
/opt/teamcity-agent/work/5d79fe75d4460a2f/src/github.com/hashicorp/terraform-provider-kubernetes/manifest/morph/morph.go:190 +0x1bb9
github.com/hashicorp/terraform-provider-kubernetes/manifest/morph.ValueToType(0x2fe9888, 0xc001ce5710, 0x2960860, 0xc000f32e88, 0x2fe9888, 0xc007715920, 0xc00217b950, 0x2, 0x0, 0x0, ...)
/opt/teamcity-agent/work/5d79fe75d4460a2f/src/github.com/hashicorp/terraform-provider-kubernetes/manifest/morph/morph.go:30 +0xa09
github.com/hashicorp/terraform-provider-kubernetes/manifest/morph.morphObjectToType(0x2fe97e8, 0xc001ce5ad0, 0x2a60e60, 0xc001cd5770, 0x2fe97e8, 0xc007715950, 0xc00217b938, 0x1100000002fe97e8, 0xc007853dd0, 0x2a60e60, ...)
/opt/teamcity-agent/work/5d79fe75d4460a2f/src/github.com/hashicorp/terraform-provider-kubernetes/manifest/morph/morph.go:314 +0x425
github.com/hashicorp/terraform-provider-kubernetes/manifest/morph.ValueToType(0x2fe97e8, 0xc001ce5ad0, 0x2a60e60, 0xc001cd5770, 0x2fe97e8, 0xc007715950, 0xc00217b938, 0x1, 0xc007853dd0, 0x2a60e60, ...)
/opt/teamcity-agent/work/5d79fe75d4460a2f/src/github.com/hashicorp/terraform-provider-kubernetes/manifest/morph/morph.go:36 +0x709
github.com/hashicorp/terraform-provider-kubernetes/manifest/morph.morphObjectToType(0x2fe97e8, 0xc001ce5ef0, 0x2a60e60, 0xc001cd4ea0, 0x2fe97e8, 0xc007853500, 0xc00217b8a8, 0x1100000000000011, 0xc006491dd0, 0x8, ...)
/opt/teamcity-agent/work/5d79fe75d4460a2f/src/github.com/hashicorp/terraform-provider-kubernetes/manifest/morph/morph.go:314 +0x425
github.com/hashicorp/terraform-provider-kubernetes/manifest/morph.ValueToType(0x2fe97e8, 0xc001ce5ef0, 0x2a60e60, 0xc001cd4ea0, 0x2fe97e8, 0xc007853500, 0xc00217b8a8, 0x2, 0xb, 0x0, ...)
/opt/teamcity-agent/work/5d79fe75d4460a2f/src/github.com/hashicorp/terraform-provider-kubernetes/manifest/morph/morph.go:36 +0x709
github.com/hashicorp/terraform-provider-kubernetes/manifest/provider.(*RawProviderServer).PlanResourceChange(0xc000c40300, 0x2fd6cf8, 0xc0005df080, 0xc000eab540, 0xc00040e548, 0xc000badd01, 0x1)
/opt/teamcity-agent/work/5d79fe75d4460a2f/src/github.com/hashicorp/terraform-provider-kubernetes/manifest/provider/plan.go:315 +0x1cbb
github.com/hashicorp/terraform-plugin-mux.SchemaServer.PlanResourceChange(0xc00111ac30, 0xc00111ac60, 0xc0018d3fc0, 0x2, 0x2, 0xc000c40280, 0x1, 0x2fd6cf8, 0xc0005df080, 0xc000eab540, ...)
/opt/teamcity-agent/work/5d79fe75d4460a2f/src/github.com/hashicorp/terraform-provider-kubernetes/vendor/github.com/hashicorp/terraform-plugin-mux/schema_server.go:276 +0x98
github.com/hashicorp/terraform-plugin-go/tfprotov5/tf5server.(*server).PlanResourceChange(0xc00002e000, 0x2fd6da0, 0xc0009c1530, 0xc0018735e0, 0x0, 0x0, 0x0)
/opt/teamcity-agent/work/5d79fe75d4460a2f/src/github.com/hashicorp/terraform-provider-kubernetes/vendor/github.com/hashicorp/terraform-plugin-go/tfprotov5/tf5server/server.go:777 +0x7f0
github.com/hashicorp/terraform-plugin-go/tfprotov5/internal/tfplugin5._Provider_PlanResourceChange_Handler(0x2c1d160, 0xc00002e000, 0x2fd6da0, 0xc0009c1530, 0xc000ce1c80, 0x0, 0x2fd6da0, 0xc0009c1530, 0xc0001d9b00, 0x839)
/opt/teamcity-agent/work/5d79fe75d4460a2f/src/github.com/hashicorp/terraform-provider-kubernetes/vendor/github.com/hashicorp/terraform-plugin-go/tfprotov5/internal/tfplugin5/tfplugin5_grpc.pb.go:367 +0x214
google.golang.org/grpc.(*Server).processUnaryRPC(0xc0004caa80, 0x2fed818, 0xc000454680, 0xc001386240, 0xc00111ad20, 0x3d93a68, 0x0, 0x0, 0x0)
/opt/teamcity-agent/work/5d79fe75d4460a2f/src/github.com/hashicorp/terraform-provider-kubernetes/vendor/google.golang.org/grpc/server.go:1282 +0x52b
google.golang.org/grpc.(*Server).handleStream(0xc0004caa80, 0x2fed818, 0xc000454680, 0xc001386240, 0x0)
/opt/teamcity-agent/work/5d79fe75d4460a2f/src/github.com/hashicorp/terraform-provider-kubernetes/vendor/google.golang.org/grpc/server.go:1616 +0xd0c
google.golang.org/grpc.(*Server).serveStreams.func1.2(0xc000526830, 0xc0004caa80, 0x2fed818, 0xc000454680, 0xc001386240)
/opt/teamcity-agent/work/5d79fe75d4460a2f/src/github.com/hashicorp/terraform-provider-kubernetes/vendor/google.golang.org/grpc/server.go:921 +0xab
created by google.golang.org/grpc.(*Server).serveStreams.func1
/opt/teamcity-agent/work/5d79fe75d4460a2f/src/github.com/hashicorp/terraform-provider-kubernetes/vendor/google.golang.org/grpc/server.go:919 +0x1fd
This issue is observed on terraform-provider-kubernetes version on 2.9.0 and 2.10.0
Stack trace from the terraform-provider-kubernetes_v2.10.0_x5 plugin:
panic: ElementKeyInt(0): can't use tftypes.Object["filters":tftypes.Tuple[tftypes.Object["arguments":tftypes.DynamicPseudoType, "ifRequestHeader":tftypes.Object["name":tftypes.String, "negate":tftypes.Bool, "value":tftypes.String, "valueRegex":tftypes.String], "name":tftypes.String, "namespace":tftypes.String, "onAllow":tftypes.String, "onDeny":tftypes.String], tftypes.Object["arguments":tftypes.DynamicPseudoType, "ifRequestHeader":tftypes.Object["name":tftypes.String, "negate":tftypes.Bool, "value":tftypes.String, "valueRegex":tftypes.String], "name":tftypes.String, "namespace":tftypes.String, "onAllow":tftypes.String, "onDeny":tftypes.String]], "host":tftypes.String, "path":tftypes.String] as tftypes.Object["filters":tftypes.Tuple[tftypes.Object["arguments":tftypes.DynamicPseudoType, "ifRequestHeader":tftypes.Object["name":tftypes.String, "negate":tftypes.Bool, "value":tftypes.String, "valueRegex":tftypes.String], "name":tftypes.String, "namespace":tftypes.String, "onAllow":tftypes.String, "onDeny":tftypes.String]], "host":tftypes.String, "path":tftypes.String]
goroutine 310 [running]: github.com/hashicorp/terraform-plugin-go/tftypes.NewValue(...) github.com/hashicorp/terraform-plugin-go@v0.7.1/tftypes/value.go:277 github.com/hashicorp/terraform-provider-kubernetes/manifest/morph.morphTupleIntoType(0x2401348, 0xc000d0d5c0, 0x1d74f00, 0xc001103c38, 0x2401348, 0xc009534c30, 0xc01566a0d8, 0x110000c001d0e4e0, 0x203002, 0x203002, ...) github.com/hashicorp/terraform-provider-kubernetes/manifest/morph/morph.go:190 +0x1bb9 github.com/hashicorp/terraform-provider-kubernetes/manifest/morph.ValueToType(0x2401348, 0xc000d0d5c0, 0x1d74f00, 0xc001103c38, 0x2401348, 0xc009534c30, 0xc01566a0d8, 0x2, 0x0, 0x0, ...) github.com/hashicorp/terraform-provider-kubernetes/manifest/morph/morph.go:30 +0xa09 github.com/hashicorp/terraform-provider-kubernetes/manifest/morph.morphObjectToType(0x24012a8, 0xc0008fe240, 0x1e74f40, 0xc0008e1cb0, 0x24012a8, 0xc009534c60, 0xc01566a0c0, 0x24012a8, 0xc00a66c150, 0x1e74f40, ...) github.com/hashicorp/terraform-provider-kubernetes/manifest/morph/morph.go:314 +0x425 github.com/hashicorp/terraform-provider-kubernetes/manifest/morph.ValueToType(0x24012a8, 0xc0008fe240, 0x1e74f40, 0xc0008e1cb0, 0x24012a8, 0xc009534c60, 0xc01566a0c0, 0x1, 0xc00a66c150, 0x1e74f40, ...) github.com/hashicorp/terraform-provider-kubernetes/manifest/morph/morph.go:36 +0x709 github.com/hashicorp/terraform-provider-kubernetes/manifest/morph.morphObjectToType(0x24012a8, 0xc0008fe510, 0x1e74f40, 0xc0008e12f0, 0x24012a8, 0xc00a681380, 0xc01566a030, 0x1100000000000038, 0xc000e56360, 0x8, ...) github.com/hashicorp/terraform-provider-kubernetes/manifest/morph/morph.go:314 +0x425 github.com/hashicorp/terraform-provider-kubernetes/manifest/morph.ValueToType(0x24012a8, 0xc0008fe510, 0x1e74f40, 0xc0008e12f0, 0x24012a8, 0xc00a681380, 0xc01566a030, 0x2, 0xc, 0x0, ...) github.com/hashicorp/terraform-provider-kubernetes/manifest/morph/morph.go:36 +0x709 github.com/hashicorp/terraform-provider-kubernetes/manifest/provider.(RawProviderServer).PlanResourceChange(0xc000fb2180, 0x23ee938, 0xc001773b00, 0xc000c354f0, 0xc0003283b8, 0xc000c16401, 0x1) github.com/hashicorp/terraform-provider-kubernetes/manifest/provider/plan.go:326 +0x265b github.com/hashicorp/terraform-plugin-mux.SchemaServer.PlanResourceChange(0xc00111e450, 0xc00111e480, 0xc00063d4e0, 0x2, 0x2, 0xc000fb2100, 0x1, 0x23ee938, 0xc001773b00, 0xc000c354f0, ...) github.com/hashicorp/terraform-plugin-mux@v0.2.0/schema_server.go:276 +0x98 github.com/hashicorp/terraform-plugin-go/tfprotov5/tf5server.(server).PlanResourceChange(0xc0001da000, 0x23ee9e0, 0xc001c75830, 0xc00174f810, 0x0, 0x0, 0x0) github.com/hashicorp/terraform-plugin-go@v0.7.1/tfprotov5/tf5server/server.go:779 +0x7f0 github.com/hashicorp/terraform-plugin-go/tfprotov5/internal/tfplugin5._Provider_PlanResourceChange_Handler(0x2031080, 0xc0001da000, 0x23ee9e0, 0xc001c75830, 0xc00176ff20, 0x0, 0x23ee9e0, 0xc001c75830, 0xc001374000, 0x4e3) github.com/hashicorp/terraform-plugin-go@v0.7.1/tfprotov5/internal/tfplugin5/tfplugin5_grpc.pb.go:367 +0x214 google.golang.org/grpc.(Server).processUnaryRPC(0xc00027f340, 0x24052d8, 0xc000d524e0, 0xc000c03200, 0xc00111e5d0, 0x3171968, 0x0, 0x0, 0x0) google.golang.org/grpc@v1.44.0/server.go:1282 +0x52b google.golang.org/grpc.(Server).handleStream(0xc00027f340, 0x24052d8, 0xc000d524e0, 0xc000c03200, 0x0) google.golang.org/grpc@v1.44.0/server.go:1616 +0xd0c google.golang.org/grpc.(Server).serveStreams.func1.2(0xc00111cb30, 0xc00027f340, 0x24052d8, 0xc000d524e0, 0xc000c03200) google.golang.org/grpc@v1.44.0/server.go:921 +0xab created by google.golang.org/grpc.(Server).serveStreams.func1 google.golang.org/grpc@v1.44.0/server.go:919 +0x1fd
Error: The terraform-provider-kubernetes_v2.10.0_x5 plugin crashed!
This is always indicative of a bug within the plugin. It would be immensely helpful if you could report the crash with the plugin's maintainers so that it can be fixed. The output above should help diagnose the issue.
I've upgraded from
terraform {
required_providers {
kubernetes = {
source = "kubernetes"
version = "<= 2.7.1"
}
to
terraform {
required_providers {
kubernetes = {
source = "kubernetes"
version = "<= 2.11"
}
and it helped
Thank you for opening this issue @gardun0, I looked into this and the fix would be to use a more recent release as mentioned by @Tarasovych.
Terraform Version, Provider Version and Kubernetes Version
Affected Resource(s)
Terraform Configuration Files
Debug Output
Panic Output
Steps to Reproduce
Expected Behavior
Apply correctly
Actual Behavior
Crash on planning
Important Factoids
Community Note