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

google-beta v3.87 crashes with monitoring_config on google_container_cluster #10280

Closed
hazcod opened this issue Oct 7, 2021 · 5 comments · Fixed by GoogleCloudPlatform/magic-modules#5295, hashicorp/terraform-provider-google-beta#3717 or #10290
Assignees

Comments

@hazcod
Copy link

hazcod commented Oct 7, 2021

When doing an apply, terraform crashes.

Terraform Version

terraform v1.0.8
google-beta v3.87.0

Affected Resource(s)

  • google_container_cluster

Terraform Configuration Files

resource "google_container_cluster" "main_cluster" {

  project  = var.project_id
  name     = var.cluster_name
  location = var.cluster_location

  # use stackdriver GKE for system and workload logs
  logging_service = "logging.googleapis.com/kubernetes"
  logging_config {
    enable_components = ["SYSTEM_COMPONENTS", "WORKLOADS"]
  }

  # use stackdriver GKE for system monitoring
  monitoring_service = "monitoring.googleapis.com/kubernetes"
  monitoring_config {
    enable_components = ["SYSTEM_COMPONENTS"]
  }

}

Logs:

Stack trace from the terraform-provider-google-beta_v3.87.0_x5 plugin:

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

goroutine 57 [running]:
github.com/hashicorp/terraform-provider-google-beta/google-beta.expandMonitoringConfig(...)
        /opt/teamcity-agent/work/5d79fe75d4460a2f/src/github.com/hashicorp/terraform-provider-google-beta/google-beta/resource_container_cluster.go:3554
github.com/hashicorp/terraform-provider-google-beta/google-beta.resourceContainerClusterCreate(0x14001363180, 0x103b4f800, 0x140006f3800, 0x0, 0x0)
        /opt/teamcity-agent/work/5d79fe75d4460a2f/src/github.com/hashicorp/terraform-provider-google-beta/google-beta/resource_container_cluster.go:1548 +0x3cdc
github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.(*Resource).create(0x14000532c40, 0x103bfd0e0, 0x14000376100, 0x14001363180, 0x103b4f800, 0x140006f3800, 0x0, 0x0, 0x0)
        /opt/teamcity-agent/work/5d79fe75d4460a2f/pkg/mod/github.com/hashicorp/terraform-plugin-sdk/[email protected]/helper/schema/resource.go:318 +0x170
github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.(*Resource).Apply(0x14000532c40, 0x103bfd0e0, 0x14000376100, 0x14001010150, 0x1400079bde0, 0x103b4f800, 0x140006f3800, 0x0, 0x0, 0x0, ...)
        /opt/teamcity-agent/work/5d79fe75d4460a2f/pkg/mod/github.com/hashicorp/terraform-plugin-sdk/[email protected]/helper/schema/resource.go:456 +0x4ec
github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.(*GRPCProviderServer).ApplyResourceChange(0x140007beff0, 0x103bfd0e0, 0x14000376100, 0x14000dfc0a0, 0x14000376100, 0x103a96080, 0x0)
        /opt/teamcity-agent/work/5d79fe75d4460a2f/pkg/mod/github.com/hashicorp/terraform-plugin-sdk/[email protected]/helper/schema/grpc_provider.go:955 +0x6f8
github.com/hashicorp/terraform-plugin-go/tfprotov5/server.(*server).ApplyResourceChange(0x14000be9b40, 0x103bfd188, 0x14000376100, 0x14001010000, 0x14000be9b40, 0x1012b02d0, 0x1038e86a0)
        /opt/teamcity-agent/work/5d79fe75d4460a2f/pkg/mod/github.com/hashicorp/[email protected]/tfprotov5/server/server.go:332 +0x94
github.com/hashicorp/terraform-plugin-go/tfprotov5/internal/tfplugin5._Provider_ApplyResourceChange_Handler(0x103a96080, 0x14000be9b40, 0x103bfd188, 0x14000e0e570, 0x140003002a0, 0x0, 0x103bfd188, 0x14000e0e570, 0x1400100b500, 0x148e)
        /opt/teamcity-agent/work/5d79fe75d4460a2f/pkg/mod/github.com/hashicorp/[email protected]/tfprotov5/internal/tfplugin5/tfplugin5_grpc.pb.go:380 +0x1c8
google.golang.org/grpc.(*Server).processUnaryRPC(0x140004a96c0, 0x103c3eb98, 0x140001ab080, 0x14001008000, 0x140000a6a50, 0x104b99b00, 0x0, 0x0, 0x0)
        /opt/teamcity-agent/work/5d79fe75d4460a2f/pkg/mod/google.golang.org/[email protected]/server.go:1297 +0x3e8
google.golang.org/grpc.(*Server).handleStream(0x140004a96c0, 0x103c3eb98, 0x140001ab080, 0x14001008000, 0x0)
        /opt/teamcity-agent/work/5d79fe75d4460a2f/pkg/mod/google.golang.org/[email protected]/server.go:1626 +0xa50
google.golang.org/grpc.(*Server).serveStreams.func1.2(0x1400018e6b0, 0x140004a96c0, 0x103c3eb98, 0x140001ab080, 0x14001008000)
        /opt/teamcity-agent/work/5d79fe75d4460a2f/pkg/mod/google.golang.org/[email protected]/server.go:941 +0x94
created by google.golang.org/grpc.(*Server).serveStreams.func1
        /opt/teamcity-agent/work/5d79fe75d4460a2f/pkg/mod/google.golang.org/[email protected]/server.go:939 +0x1f8

Error: The terraform-provider-google-beta_v3.87.0_x5 plugin crashed!
@hazcod
Copy link
Author

hazcod commented Oct 12, 2021

FYI @toumorokoshi @edwardmedia

│ Error: Plugin did not respond
│ 
│   with module.google.module.dev_cluster.google_container_cluster.main_cluster,
│   on google/gke/gke.tf line 1, in resource "google_container_cluster" "main_cluster":
│    1: resource "google_container_cluster" "main_cluster" {
│ 
│ The plugin encountered an error, and failed to respond to the plugin.(*GRPCProvider).ApplyResourceChange call. The plugin logs may contain more details.
╵

Stack trace from the terraform-provider-google-beta_v3.88.0_x5 plugin:

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

goroutine 27 [running]:
github.com/hashicorp/terraform-provider-google-beta/google-beta.expandMonitoringConfig(...)
        /opt/teamcity-agent/work/5d79fe75d4460a2f/src/github.com/hashicorp/terraform-provider-google-beta/google-beta/resource_container_cluster.go:3554
github.com/hashicorp/terraform-provider-google-beta/google-beta.resourceContainerClusterCreate(0x14000f67e80, 0x107593fc0, 0x14001037800, 0x0, 0x0)
        /opt/teamcity-agent/work/5d79fe75d4460a2f/src/github.com/hashicorp/terraform-provider-google-beta/google-beta/resource_container_cluster.go:1548 +0x3cdc
github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.(*Resource).create(0x140000e80e0, 0x107641180, 0x14000642280, 0x14000f67e80, 0x107593fc0, 0x14001037800, 0x0, 0x0, 0x0)
        /opt/teamcity-agent/work/5d79fe75d4460a2f/pkg/mod/github.com/hashicorp/terraform-plugin-sdk/[email protected]/helper/schema/resource.go:318 +0x170
github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.(*Resource).Apply(0x140000e80e0, 0x107641180, 0x14000642280, 0x14000e443f0, 0x140005e5f40, 0x107593fc0, 0x14001037800, 0x0, 0x0, 0x0, ...)
        /opt/teamcity-agent/work/5d79fe75d4460a2f/pkg/mod/github.com/hashicorp/terraform-plugin-sdk/[email protected]/helper/schema/resource.go:456 +0x4ec
github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.(*GRPCProviderServer).ApplyResourceChange(0x140002859b0, 0x107641180, 0x14000642280, 0x140007e7090, 0x14000642280, 0x1074d8f40, 0x0)
        /opt/teamcity-agent/work/5d79fe75d4460a2f/pkg/mod/github.com/hashicorp/terraform-plugin-sdk/[email protected]/helper/schema/grpc_provider.go:955 +0x6f8
github.com/hashicorp/terraform-plugin-go/tfprotov5/server.(*server).ApplyResourceChange(0x14000cf7620, 0x107641228, 0x14000642280, 0x14000e442a0, 0x14000cf7620, 0x104cc82d0, 0x10732b440)
        /opt/teamcity-agent/work/5d79fe75d4460a2f/pkg/mod/github.com/hashicorp/[email protected]/tfprotov5/server/server.go:332 +0x94
github.com/hashicorp/terraform-plugin-go/tfprotov5/internal/tfplugin5._Provider_ApplyResourceChange_Handler(0x1074d8f40, 0x14000cf7620, 0x107641228, 0x14000e4c1b0, 0x14000fd8ba0, 0x0, 0x107641228, 0x14000e4c1b0, 0x14000e7d500, 0x148e)
        /opt/teamcity-agent/work/5d79fe75d4460a2f/pkg/mod/github.com/hashicorp/[email protected]/tfprotov5/internal/tfplugin5/tfplugin5_grpc.pb.go:380 +0x1c8
google.golang.org/grpc.(*Server).processUnaryRPC(0x140004ff340, 0x107683118, 0x14000602600, 0x14000e4be60, 0x14000716420, 0x1085edc20, 0x0, 0x0, 0x0)
        /opt/teamcity-agent/work/5d79fe75d4460a2f/pkg/mod/google.golang.org/[email protected]/server.go:1297 +0x3e8
google.golang.org/grpc.(*Server).handleStream(0x140004ff340, 0x107683118, 0x14000602600, 0x14000e4be60, 0x0)
        /opt/teamcity-agent/work/5d79fe75d4460a2f/pkg/mod/google.golang.org/[email protected]/server.go:1626 +0xa50
google.golang.org/grpc.(*Server).serveStreams.func1.2(0x1400028a900, 0x140004ff340, 0x107683118, 0x14000602600, 0x14000e4be60)
        /opt/teamcity-agent/work/5d79fe75d4460a2f/pkg/mod/google.golang.org/[email protected]/server.go:941 +0x94
created by google.golang.org/grpc.(*Server).serveStreams.func1
        /opt/teamcity-agent/work/5d79fe75d4460a2f/pkg/mod/google.golang.org/[email protected]/server.go:939 +0x1f8

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

make: *** [apply] Error 1

@hazcod
Copy link
Author

hazcod commented Oct 20, 2021

Seems to be fixed in v3.89.0! However running this undocumented error:

googleapi: Error 400: Cannot specify logging_config or monitoring_config together with logging_service or monitoring_service., badRequest
resource "google_container_cluster" "main_cluster" {

  # use stackdriver GKE for system and workload logs
  logging_service = "logging.googleapis.com/kubernetes"
  logging_config {
    enable_components = ["SYSTEM_COMPONENTS", "WORKLOADS"]
  }

  # use stackdriver GKE for system monitoring
  monitoring_service = "monitoring.googleapis.com/kubernetes"
  monitoring_config {
    enable_components = ["SYSTEM_COMPONENTS"]
  }

...
}

@bobleujr
Copy link

I've als got this error updating to 3.89

@rileykarson
Copy link
Collaborator

That issue comes from the API. We don't seem to run into it in our tests where we've set logging_config and logging_service together- I'm not sure why.

You may be able to set logging_service and monitoring_service to "", potentially?

@github-actions
Copy link

github-actions bot commented Dec 3, 2021

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.
If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Dec 3, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.