appoptics / terraform-provider-appoptics

Apache License 2.0
4 stars 2 forks source link

[alert] Can't update runbook #59

Closed poleszcz closed 1 year ago

poleszcz commented 1 year ago
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:

  # appoptics_alert.example_alert will be updated in-place
  ~ resource "appoptics_alert" "example_alert" {
      ~ attributes    = {
          + "runbook_url" = "https://www.youtube.com/watch?v=oHg5SJYRHA0"
        }
        id            = "109955884"
        name          = "example-alert"
        # (3 unchanged attributes 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

appoptics_alert.example_alert: Modifying... [id=109955884]
╷
│ Error: Plugin did not respond
│
│   with appoptics_alert.example_alert,
│   on alerts.tf line 1, in resource "appoptics_alert" "example_alert":
│    1: resource appoptics_alert example_alert {
│
│ 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-appoptics plugin:

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

goroutine 28 [running]:
github.com/appoptics/terraform-provider-appoptics/appoptics.resourceAppOpticsAlertUpdate(0xc0000f2540, {0x55b50a21ad80?, 0xc0002a6700})
        github.com/appoptics/terraform-provider-appoptics/appoptics/resource_appoptics_alert.go:477 +0xbbf
github.com/hashicorp/terraform-plugin-sdk/helper/schema.(*Resource).Apply(0xc00010ed80, 0xc0004675e0, 0xc000322320, {0x55b50a21ad80, 0xc0002a6700})
        github.com/hashicorp/terraform-plugin-sdk@v1.7.0/helper/schema/resource.go:311 +0x3e3
github.com/hashicorp/terraform-plugin-sdk/helper/schema.(*Provider).Apply(0xc00010ee80, 0xc0000b5990, 0x55b509d28dc1?, 0xf?)
        github.com/hashicorp/terraform-plugin-sdk@v1.7.0/helper/schema/provider.go:294 +0x70
github.com/hashicorp/terraform-plugin-sdk/internal/helper/plugin.(*GRPCProviderServer).ApplyResourceChange(0xc000534098, {0xc00057e780?, 0x55b5095d1586?}, 0xc00057e780)
        github.com/hashicorp/terraform-plugin-sdk@v1.7.0/internal/helper/plugin/grpc_provider.go:885 +0x7c5
github.com/hashicorp/terraform-plugin-sdk/internal/tfplugin5._Provider_ApplyResourceChange_Handler({0x55b50a227400?, 0xc000534098}, {0x55b50a25fa00, 0xc00012cc60}, 0xc00057e720, 0x0)
        github.com/hashicorp/terraform-plugin-sdk@v1.7.0/internal/tfplugin5/tfplugin5.pb.go:3189 +0x170
google.golang.org/grpc.(*Server).processUnaryRPC(0xc000382c40, {0x55b50a262ef0, 0xc000118a80}, 0xc00053a600, 0xc0004616e0, 0x55b50a799d40, 0x0)
        google.golang.org/grpc@v1.31.0/server.go:1180 +0xc8f
google.golang.org/grpc.(*Server).handleStream(0xc000382c40, {0x55b50a262ef0, 0xc000118a80}, 0xc00053a600, 0x0)
        google.golang.org/grpc@v1.31.0/server.go:1503 +0xa1b
google.golang.org/grpc.(*Server).serveStreams.func1.2()
        google.golang.org/grpc@v1.31.0/server.go:843 +0x98
created by google.golang.org/grpc.(*Server).serveStreams.func1
        google.golang.org/grpc@v1.31.0/server.go:841 +0x28a

Error: The terraform-provider-appoptics 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.
poleszcz commented 1 year ago

Fix candidate: https://github.com/poleszcz/terraform-provider-appoptics/commit/57cc3bf77c8c1a01c9fdcdc0710b2e0a3caf38ef

poleszcz commented 1 year ago

Fixed with v0.5.2