Skip to content

google_container_cluster notification_config filters causes provider panic #3367

@lianatech-teemu-hemmila

Description

@lianatech-teemu-hemmila

Affected components

  • Fabric modules
  • FAST
  • Blueprints
  • Other

The problem

Change here: bc61828 seems to cause provider panic while leaving event_types to default (empty list).

Without providing event_types:

~ notification_config {
    ~ pubsub {
        ~ enabled = false -> true
        + topic   = "<redacted>"

        + filter {
            + event_type = []
          }
      }
 }

Causes:

╷
│ Error: Request cancelled
│ 
│   with module.gke-cluster.google_container_cluster.cluster,
│   on .terraform/modules/gke-cluster/gke-cluster-standard/main.tf line 7, in resource "google_container_cluster" "cluster":
│    7: resource "google_container_cluster" "cluster" {
│ 
│ The plugin.(*GRPCProvider).ApplyResourceChange request was cancelled.
╵

Stack trace from the terraform-provider-google-beta plugin:

panic: interface conversion: interface {} is nil, not map[string]interface {}

goroutine 107 [running]:
github.com/hashicorp/terraform-provider-google-beta/google-beta/services/container.expandNotificationConfig({0x4764e80?, 0xc002ab3380?})
	/home/runner/work/terraform-provider-google-beta/terraform-provider-google-beta/provider/google-beta/services/container/resource_container_cluster.go:6016 +0x3d4
github.com/hashicorp/terraform-provider-google-beta/google-beta/services/container.resourceContainerClusterUpdate(0xc0018887e0, {0x52044c0, 0xc0018eb908})
	/home/runner/work/terraform-provider-google-beta/terraform-provider-google-beta/provider/google-beta/services/container/resource_container_cluster.go:4438 +0x7c2d
github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.(*Resource).update(0x5c69c58?, {0x5c69c58?, 0xc0027cec90?}, 0xd?, {0x52044c0?, 0xc0018eb908?})
	/home/runner/go/pkg/mod/github.com/hashicorp/terraform-plugin-sdk/[email protected]/helper/schema/resource.go:871 +0x15f
github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.(*Resource).Apply(0xc0016b9e00, {0x5c69c58, 0xc0027cec90}, 0xc0022d8820, 0xc00182ba70, {0x52044c0, 0xc0018eb908})
	/home/runner/go/pkg/mod/github.com/hashicorp/terraform-plugin-sdk/[email protected]/helper/schema/resource.go:990 +0x8a8
github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.(*GRPCProviderServer).ApplyResourceChange(0xc001930cf0, {0x5c69c58?, 0xc0027cebd0?}, 0xc0025ccaf0)
	/home/runner/go/pkg/mod/github.com/hashicorp/terraform-plugin-sdk/[email protected]/helper/schema/grpc_provider.go:1484 +0x10b1
github.com/hashicorp/terraform-plugin-mux/tf5muxserver.(*muxServer).ApplyResourceChange(0xc000489300, {0x5c69c58?, 0xc0027ce900?}, 0xc0025ccaf0)
	/home/runner/go/pkg/mod/github.com/hashicorp/[email protected]/tf5muxserver/mux_server_ApplyResourceChange.go:36 +0x193
github.com/hashicorp/terraform-plugin-go/tfprotov5/tf5server.(*server).ApplyResourceChange(0xc0004932c0, {0x5c69c58?, 0xc0027abd70?}, 0xc001cc3400)
	/home/runner/go/pkg/mod/github.com/hashicorp/[email protected]/tfprotov5/tf5server/server.go:941 +0x3bc
github.com/hashicorp/terraform-plugin-go/tfprotov5/internal/tfplugin5._Provider_ApplyResourceChange_Handler({0x51c4c80, 0xc0004932c0}, {0x5c69c58, 0xc0027abd70}, 0xc001cc3380, 0x0)
	/home/runner/go/pkg/mod/github.com/hashicorp/[email protected]/tfprotov5/internal/tfplugin5/tfplugin5_grpc.pb.go:687 +0x1a6
google.golang.org/grpc.(*Server).processUnaryRPC(0xc000185a00, {0x5c69c58, 0xc0027abce0}, 0xc001886060, 0xc0009c7c50, 0x80e61a8, 0x0)
	/home/runner/go/pkg/mod/google.golang.org/[email protected]/server.go:1431 +0x103b
google.golang.org/grpc.(*Server).handleStream(0xc000185a00, {0x5c6a568, 0xc00111fba0}, 0xc001886060)
	/home/runner/go/pkg/mod/google.golang.org/[email protected]/server.go:1841 +0xbaa
google.golang.org/grpc.(*Server).serveStreams.func2.1()
	/home/runner/go/pkg/mod/google.golang.org/[email protected]/server.go:1061 +0x7f
created by google.golang.org/grpc.(*Server).serveStreams.func2 in goroutine 38
	/home/runner/go/pkg/mod/google.golang.org/[email protected]/server.go:1072 +0x125

Error: The terraform-provider-google-beta 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.

Release version

505ee02

Terraform version

OpenTofu v1.10.6

Steps to reproduce

Try to create gke-standard cluster with empty event_types list in notification settings.

Expected behavior

Cluster get's created.

Actual behavior

Google terraform provider panics.

Additional context

This probably could also be fixed in google provider.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions