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

Provider crashes when item deleted after plan but before apply #250

Open
alex-treebeard opened this issue Feb 28, 2024 · 1 comment
Open
Assignees

Comments

@alex-treebeard
Copy link

This plugin is really helpful thanks -- just want to report an edge case.

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:

  # module.treebeardkf.module.kubeflow_istio_resources[0].kustomization_resource.p1["networking.istio.io/Gateway/kubeflow/kubeflow-gateway"] will be updated in-place
  ~ resource "kustomization_resource" "p1" {
        id       = "c72a141a-e0d2-4a1d-853c-2591300e0184"
      ~ manifest = jsonencode(
          ~ {
              ~ spec       = {
                  ~ servers  = [
                      ~ {
                          ~ hosts = [
                              - "*",
                              + "eks1.dev.treebeard.io",
                            ]
                            # (2 unchanged attributes hidden)
                        },
                    ]
                    # (1 unchanged attribute hidden)
                }
                # (3 unchanged attributes hidden)
            }
        )
        # (1 unchanged attribute hidden)

        # (1 unchanged block hidden)
    }

Plan: 0 to add, 1 to change, 0 to destroy.

Do you want to perform these actions?
  Terraform will perform the actions described above.
  Only 'yes' will be accepted to approve.

  Enter a value: yes

╷
│ Error: Plugin did not respond
│ 
│   with module.treebeardkf.module.kubeflow_istio_resources[0].kustomization_resource.p1["networking.istio.io/Gateway/kubeflow/kubeflow-gateway"],
│   on ../../modules/kust/main.tf line 34, in resource "kustomization_resource" "p1":
│   34: resource "kustomization_resource" "p1" {
│ 
│ The plugin encountered an error, and failed to respond to the plugin.(*GRPCProvider).PlanResourceChange call. The
│ plugin logs may contain more details.
╵

Stack trace from the terraform-provider-kustomization_v0.9.5 plugin:

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

goroutine 33 [running]:
k8s.io/apimachinery/pkg/apis/meta/v1/unstructured.unstructuredJSONScheme.doEncode({}, {0x1dfa410?, 0x0?}, {0x1df2200?, 0xc0005cc900?})
        k8s.io/[email protected]/pkg/apis/meta/v1/unstructured/helpers.go:358 +0x90
k8s.io/apimachinery/pkg/apis/meta/v1/unstructured.unstructuredJSONScheme.Encode({}, {0x1dfa410, 0x0}, {0x1df2200, 0xc0005cc900})
        k8s.io/[email protected]/pkg/apis/meta/v1/unstructured/helpers.go:352 +0xb0
k8s.io/apimachinery/pkg/apis/meta/v1/unstructured.(*Unstructured).MarshalJSON(0x1df2d80?)
        k8s.io/[email protected]/pkg/apis/meta/v1/unstructured/unstructured.go:119 +0x5a
github.com/kbst/terraform-provider-kustomize/kustomize.(*kManifest).apiPreparePatch(0xc0005b4b88, 0xc000576001?, 0x1)
        github.com/kbst/terraform-provider-kustomize/kustomize/manifest.go:217 +0x185
github.com/kbst/terraform-provider-kustomize/kustomize.kustomizationResourceDiff({0x1e0d790?, 0xc00058d560?}, 0x1b3f0a4?, {0x1831460?, 0xc000459290})
        github.com/kbst/terraform-provider-kustomize/kustomize/resource_kustomization.go:252 +0x9fb
github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.schemaMap.Diff(0xc00040cbd0, {0x1e0d790, 0xc00058d560}, 0xc000560c30, 0xc0005a4030, 0x1c45eb0, {0x1831460, 0xc000459290}, 0x0)
        github.com/hashicorp/terraform-plugin-sdk/[email protected]/helper/schema/schema.go:699 +0x4b4
github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.(*Resource).SimpleDiff(0x1e0d9c0?, {0x1e0d790?, 0xc00058d560?}, 0xc000560c30, 0x18f6540?, {0x1831460?, 0xc000459290?})
        github.com/hashicorp/terraform-plugin-sdk/[email protected]/helper/schema/resource.go:890 +0x65
github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.(*GRPCProviderServer).PlanResourceChange(0xc0003abb30, {0x1e0d790?, 0xc00058d470?}, 0xc0003ae0f0)
        github.com/hashicorp/terraform-plugin-sdk/[email protected]/helper/schema/grpc_provider.go:741 +0x976
github.com/hashicorp/terraform-plugin-go/tfprotov5/tf5server.(*server).PlanResourceChange(0xc0004486e0, {0x1e0d790?, 0xc00058ca80?}, 0xc000194cb0)
        github.com/hashicorp/[email protected]/tfprotov5/tf5server/server.go:783 +0x56a
github.com/hashicorp/terraform-plugin-go/tfprotov5/internal/tfplugin5._Provider_PlanResourceChange_Handler({0x1a6aac0?, 0xc0004486e0}, {0x1e0d790, 0xc00058ca80}, 0xc000194c40, 0x0)
        github.com/hashicorp/[email protected]/tfprotov5/internal/tfplugin5/tfplugin5_grpc.pb.go:401 +0x169
google.golang.org/grpc.(*Server).processUnaryRPC(0xc000236000, {0x1e14840, 0xc000374d00}, 0xc00058e5a0, 0xc000508360, 0x2b8dea8, 0x0)
        google.golang.org/[email protected]/server.go:1337 +0xde7
google.golang.org/grpc.(*Server).handleStream(0xc000236000, {0x1e14840, 0xc000374d00}, 0xc00058e5a0, 0x0)
        google.golang.org/[email protected]/server.go:1714 +0x9e7
google.golang.org/grpc.(*Server).serveStreams.func1.1()
        google.golang.org/[email protected]/server.go:959 +0x8d
created by google.golang.org/grpc.(*Server).serveStreams.func1 in goroutine 24
        google.golang.org/[email protected]/server.go:957 +0x165

Error: The terraform-provider-kustomization_v0.9.5 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.
@pst pst self-assigned this Mar 2, 2024
@pst
Copy link
Member

pst commented Mar 2, 2024

Thanks for reporting this!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants