pulumiverse / pulumi-grafana

Pulumi provider for Grafana
Apache License 2.0
21 stars 12 forks source link

Go panic with terraform-provider-grafana v3.2.1 #192

Closed lennartack closed 19 hours ago

lennartack commented 3 months ago

When trying to import some synthetic monitoring checks, I get the following go panic:

Diagnostics:
  pulumi:pulumi:Stack (portal-pulumi-prod):
    2024/08/08 18:11:45 [DEBUG] GET https://synthetic-monitoring-api-eu-west.grafana.net/api/v1/probe/list
    2024/08/08 18:11:45 [DEBUG] GET https://synthetic-monitoring-api-eu-west.grafana.net/api/v1/check/21229
    panic: interface conversion: interface {} is nil, not map[string]interface {}
    goroutine 81 [running]:
    github.com/grafana/terraform-provider-grafana/v2/internal/resources/syntheticmonitoring.resourceCheckCustomizeDiff({0x1fd7ac8?, 0xc000765dd0?}, 0x1c69ff8?, {0xd?, 0x1c734ff?})
        /home/runner/go/pkg/mod/github.com/grafana/terraform-provider-grafana/v2@v2.19.1/internal/resources/syntheticmonitoring/resource_check.go:1513 +0x1a5
    github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.schemaMap.Diff(0xc000542930, {0x1fd7ac8, 0xc000765dd0}, 0xc000aae4e0, 0xc000a8bd10, 0x1dbc0c8, {0x18f6020, 0xc0007f8060}, 0x0)
        /home/runner/go/pkg/mod/github.com/pulumi/terraform-plugin-sdk/v2@v2.0.0-20240229143312-4f60ee4e2975/helper/schema/schema.go:698 +0x4b4
    github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.(*Resource).SimpleDiff(0x0?, {0x1fd7ac8?, 0xc000765dd0?}, 0xc000aae4e0, 0xc000aae1a0?, {0x18f6020?, 0xc0007f8060?})
        /home/runner/go/pkg/mod/github.com/pulumi/terraform-plugin-sdk/v2@v2.0.0-20240229143312-4f60ee4e2975/helper/schema/resource.go:967 +0xdb
    github.com/pulumi/pulumi-terraform-bridge/v3/pkg/tfshim/sdk-v2.v2Provider.simpleDiff({0xc000a8bd10?, {0xc000a9e0a0?, 0x1906b80?, 0xc000a9e020?}}, {0x1fd7ac8, 0xc000765dd0}, 0xc00010f1e0?, 0xc000546ee0, 0xc00010f198?, 0xc000a8bd10, ...)
        /home/runner/go/pkg/mod/github.com/pulumi/pulumi-terraform-bridge/v3@v3.80.0/pkg/tfshim/sdk-v2/provider_diff.go:123 +0x8fc
    github.com/pulumi/pulumi-terraform-bridge/v3/pkg/tfshim/sdk-v2.v2Provider.Diff({0xc0004003c0?, {0x0?, 0xc00072b9e0?, 0xc00010f278?}}, {0x1fd7ac8, 0xc000765dd0}, {0x1c93149, 0x22}, {0x1fd8210, 0xc000011758}, ...)
        /home/runner/go/pkg/mod/github.com/pulumi/pulumi-terraform-bridge/v3@v3.80.0/pkg/tfshim/sdk-v2/provider_diff.go:75 +0x406
    github.com/pulumi/pulumi-terraform-bridge/v3/pkg/tfbridge.(*Provider).Diff(0xc0005a9988, {0x1fd7ac8?, 0xc0007659e0?}, 0xc000426a00)
        /home/runner/go/pkg/mod/github.com/pulumi/pulumi-terraform-bridge/v3@v3.80.0/pkg/tfbridge/provider.go:904 +0x917
    github.com/pulumi/pulumi-terraform-bridge/x/muxer.(*muxer).Diff.func1({0x1feda60?, 0xc0005a9988?})
        /home/runner/go/pkg/mod/github.com/pulumi/pulumi-terraform-bridge/x/muxer@v0.0.8/muxer.go:369 +0x30
    github.com/pulumi/pulumi-terraform-bridge/x/muxer.resourceMethod[...](0xc0008c89c0?, 0x1b7e7c0, 0xc00010f6c0?)
        /home/runner/go/pkg/mod/github.com/pulumi/pulumi-terraform-bridge/x/muxer@v0.0.8/muxer.go:334 +0xb5
    github.com/pulumi/pulumi-terraform-bridge/x/muxer.(*muxer).Diff(0x3165af0?, {0x1fd7ac8?, 0xc0007659e0?}, 0x186c720?)
        /home/runner/go/pkg/mod/github.com/pulumi/pulumi-terraform-bridge/x/muxer@v0.0.8/muxer.go:368 +0x56
    github.com/pulumi/pulumi/sdk/v3/proto/go._ResourceProvider_Diff_Handler.func1({0x1fd7ac8?, 0xc0007659e0?}, {0x1b6bec0?, 0xc000426a00?})
        /home/runner/go/pkg/mod/github.com/pulumi/pulumi/sdk/v3@v3.112.0/proto/go/provider_grpc.pb.go:575 +0xcb
    github.com/grpc-ecosystem/grpc-opentracing/go/otgrpc.OpenTracingServerInterceptor.func1({0x1fd7ac8, 0xc000765680}, {0x1b6bec0, 0xc000426a00}, 0xc000782740, 0xc000402cd8)
        /home/runner/go/pkg/mod/github.com/grpc-ecosystem/grpc-opentracing@v0.0.0-20180507213350-8e809c8a8645/go/otgrpc/server.go:57 +0x3db
    github.com/pulumi/pulumi/sdk/v3/proto/go._ResourceProvider_Diff_Handler({0x1c0edc0, 0xc0008c89c0}, {0x1fd7ac8, 0xc000765680}, 0xc000426980, 0xc000808760)
        /home/runner/go/pkg/mod/github.com/pulumi/pulumi/sdk/v3@v3.112.0/proto/go/provider_grpc.pb.go:577 +0x143
    google.golang.org/grpc.(*Server).processUnaryRPC(0xc000896200, {0x1fd7ac8, 0xc0007655f0}, {0x1fe4440, 0xc00058ac00}, 0xc0009cd560, 0xc0008f4210, 0x3194de8, 0x0)
        /home/runner/go/pkg/mod/google.golang.org/grpc@v1.63.2/server.go:1369 +0xdf8
    google.golang.org/grpc.(*Server).handleStream(0xc000896200, {0x1fe4440, 0xc00058ac00}, 0xc0009cd560)
        /home/runner/go/pkg/mod/google.golang.org/grpc@v1.63.2/server.go:1780 +0xe8b
    google.golang.org/grpc.(*Server).serveStreams.func2.1()
        /home/runner/go/pkg/mod/google.golang.org/grpc@v1.63.2/server.go:1019 +0x8b
    created by google.golang.org/grpc.(*Server).serveStreams.func2 in goroutine 52
        /home/runner/go/pkg/mod/google.golang.org/grpc@v1.63.2/server.go:1030 +0x125

This does not happen when I'm using native terraform with the Grafana provider version 3.7.0. It did happen when I was using an older version. So please update the Grafana provider.

ringods commented 3 weeks ago

@lennartack sorry for the delay. I tried upgrading immediately to the latest versions but got stuck in a mix of version dependencies between Go, the upstream TF provider and our TF-bridge.

For now, I created a new release with upstream TF provider v3.3.0. I will continue upgrading this provider to newer versions of our TF-bridge and upstream provider in the coming days.

https://github.com/pulumiverse/pulumi-grafana/releases/tag/v0.6.0

If you would still have the time to test, can you let me know if this new release fixes it for you?