terraform-provider-kubernetes icon indicating copy to clipboard operation
terraform-provider-kubernetes copied to clipboard

Kubernetes Plugin crashed while creating the service account

Open pranavkevadiya opened this issue 2 years ago • 3 comments

Provider version: 1.13.4

Code

resource "kubernetes_service_account" "service_account" {
  metadata {
    annotations = {
      "azure.workload.identity/client-id"   = "some value",
      "azure.workload.identity/tenant-id" = some value",
    }
    labels = {
      "azure.workload.identity/use": "true"
    }
    name = "some value",
    namespace = "some value"
  }
}

Stacktrace

Stack trace from the terraform-provider-kubernetes_v1.13.4_x4 plugin:

panic: runtime error: invalid memory address or nil pointer dereference [signal SIGSEGV: segmentation violation code=0x1 addr=0x20 pc=0x1978b9a]

goroutine 16 [running]: github.com/hashicorp/terraform-provider-kubernetes/kubernetes.resourceKubernetesServiceAccountCreate(0xc0012b55e0, 0x1c92b60, 0xc00092c978, 0x2, 0x2d13ce0) /opt/teamcity-agent/work/5d79fe75d4460a2f/src/github.com/hashicorp/terraform-provider-kubernetes/kubernetes/resource_kubernetes_service_account.go:100 +0x6fa github.com/hashicorp/terraform-plugin-sdk/helper/schema.(*Resource).Apply(0xc0002ca1b0, 0xc0010ac780, 0xc00109f200, 0x1c92b60, 0xc00092c978, 0x1b7eb01, 0xc00127eb68, 0xc000f6a2d0) /opt/teamcity-agent/work/5d79fe75d4460a2f/src/github.com/hashicorp/terraform-provider-kubernetes/vendor/github.com/hashicorp/terraform-plugin-sdk/helper/schema/resource.go:310 +0x375 github.com/hashicorp/terraform-plugin-sdk/helper/schema.(*Provider).Apply(0xc000190300, 0xc001271a38, 0xc0010ac780, 0xc00109f200, 0xc000faa3e8, 0xc000fafa80, 0x1b81500) /opt/teamcity-agent/work/5d79fe75d4460a2f/src/github.com/hashicorp/terraform-provider-kubernetes/vendor/github.com/hashicorp/terraform-plugin-sdk/helper/schema/provider.go:294 +0x99 github.com/hashicorp/terraform-plugin-sdk/internal/helper/plugin.(*GRPCProviderServer).ApplyResourceChange(0xc00028a070, 0x20e42f0, 0xc00102fe00, 0xc0012b50a0, 0xc00028a070, 0xc00102fe00, 0xc0009a5ba0) /opt/teamcity-agent/work/5d79fe75d4460a2f/src/github.com/hashicorp/terraform-provider-kubernetes/vendor/github.com/hashicorp/terraform-plugin-sdk/internal/helper/plugin/grpc_provider.go:885 +0x8a5 github.com/hashicorp/terraform-plugin-sdk/internal/tfplugin5._Provider_ApplyResourceChange_Handler(0x1d2fd00, 0xc00028a070, 0x20e42f0, 0xc00102fe00, 0xc001295620, 0x0, 0x20e42f0, 0xc00102fe00, 0xc00127a000, 0x3d1) /opt/teamcity-agent/work/5d79fe75d4460a2f/src/github.com/hashicorp/terraform-provider-kubernetes/vendor/github.com/hashicorp/terraform-plugin-sdk/internal/tfplugin5/tfplugin5.pb.go:3305 +0x214 google.golang.org/grpc.(*Server).processUnaryRPC(0xc0001c7340, 0x20f8bf8, 0xc000682a80, 0xc001438400, 0xc000a1a5d0, 0x2cc7f20, 0x0, 0x0, 0x0) /opt/teamcity-agent/work/5d79fe75d4460a2f/src/github.com/hashicorp/terraform-provider-kubernetes/vendor/google.golang.org/grpc/server.go:1194 +0x52b google.golang.org/grpc.(*Server).handleStream(0xc0001c7340, 0x20f8bf8, 0xc000682a80, 0xc001438400, 0x0) /opt/teamcity-agent/work/5d79fe75d4460a2f/src/github.com/hashicorp/terraform-provider-kubernetes/vendor/google.golang.org/grpc/server.go:1517 +0xd0c google.golang.org/grpc.(*Server).serveStreams.func1.2(0xc00082c340, 0xc0001c7340, 0x20f8bf8, 0xc000682a80, 0xc001438400) /opt/teamcity-agent/work/5d79fe75d4460a2f/src/github.com/hashicorp/terraform-provider-kubernetes/vendor/google.golang.org/grpc/server.go:859 +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:857 +0x1fd

Error: The terraform-provider-kubernetes_v1.13.4_x4 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.

Output

The service accounts were still created

pranavkevadiya avatar May 10 '23 10:05 pranavkevadiya

Thanks for opening this @pranavkevadiya – it seems you are using quite an old version of the provider. Can you try your config with the latest version of the provider? I just tried it and it does not crash for me.

jrhouston avatar May 24 '23 02:05 jrhouston

same issue here

resource "kubernetes_service_account" "eks-lb-controller-sa" {
  metadata {
    name        = "eks-lb-controller-sa"
    namespace   = "kube-system"
    annotations = { "eks.amazonaws.com/role-arn" : aws_iam_role.eks-lb-controller-role.arn }
  }
  automount_service_account_token = true
}

94wogus-quantit avatar Aug 25 '23 05:08 94wogus-quantit

Marking this issue as stale due to inactivity. If this issue receives no comments in the next 30 days it will automatically be closed. If this issue was automatically closed and you feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. This helps our maintainers find and focus on the active issues. Maintainers may also remove the stale label at their discretion. Thank you!

github-actions[bot] avatar Aug 25 '24 00:08 github-actions[bot]