pulumiverse / pulumi-scaleway

Pulumi provider for Scaleway
Apache License 2.0
35 stars 11 forks source link

panic: interface conversion: interface {} is nil, not string #258

Closed benjick closed 11 months ago

benjick commented 11 months ago

Thanks for the update! 🙏

Seems to be another problem now, on @lbrlabs/pulumi-scaleway@1.11.0:

Diagnostics:
  pulumi:pulumi:Stack (app-prod):
    panic: interface conversion: interface {} is nil, not string
    goroutine 123 [running]:
    github.com/scaleway/terraform-provider-scaleway/v2/scaleway.rdbPrivilegeV1SchemaUpgradeFunc({0x0?, 0x103cefc68?}, 0x0?, {0x10399bee0?, 0x140006ce050})
        /home/runner/go/pkg/mod/github.com/scaleway/terraform-provider-scaleway/v2@v2.31.0/scaleway/helpers_rdb.go:311 +0x348
    github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.UpgradeJSONState({0x103cef938, 0x104b10780}, 0x0?, 0x1400085dc20?, 0x140006d55e0?, {0x10399bee0, 0x140006ce050})
        /home/runner/go/pkg/mod/github.com/pulumi/terraform-plugin-sdk/v2@v2.0.0-20230912190043-e6d96b3b8f7e/helper/schema/grpc_provider.go:485 +0x7c
    github.com/pulumi/pulumi-terraform-bridge/v3/pkg/tfshim/sdk-v2.upgradeResourceState(0x140007899e0, 0x14000619ec0?, 0x14000d52340)
        /home/runner/go/pkg/mod/github.com/pulumi/pulumi-terraform-bridge/v3@v3.63.2/pkg/tfshim/sdk-v2/upgrade_state.go:45 +0x1b4
    github.com/pulumi/pulumi-terraform-bridge/v3/pkg/tfshim/sdk-v2.v2Provider.Diff({0x140007899e0?, {0x0?, 0x0?, 0x0?}}, {0x1033f4d00, 0x16}, {0x103cf00f0?, 0x14000d4c3d8}, {0x103cddb00, 0x1400085dd70})
        /home/runner/go/pkg/mod/github.com/pulumi/pulumi-terraform-bridge/v3@v3.63.2/pkg/tfshim/sdk-v2/provider_diff.go:57 +0x118
    github.com/pulumi/pulumi-terraform-bridge/v3/pkg/tfbridge.(*Provider).Diff(0x140000c6dc0, {0x103cefa38?, 0x1400085da70?}, 0x14000ac2180)
        /home/runner/go/pkg/mod/github.com/pulumi/pulumi-terraform-bridge/v3@v3.63.2/pkg/tfbridge/provider.go:656 +0x4a0
    github.com/pulumi/pulumi/sdk/v3/proto/go._ResourceProvider_Diff_Handler.func1({0x103cefa38, 0x1400085da70}, {0x103c08420?, 0x14000ac2180})
        /home/runner/go/pkg/mod/github.com/pulumi/pulumi/sdk/v3@v3.91.1/proto/go/provider_grpc.pb.go:575 +0x74
    github.com/grpc-ecosystem/grpc-opentracing/go/otgrpc.OpenTracingServerInterceptor.func1({0x103cefa38, 0x1400085d8f0}, {0x103c08420, 0x14000ac2180}, 0x14000d44580, 0x14000d4c390)
        /home/runner/go/pkg/mod/github.com/grpc-ecosystem/grpc-opentracing@v0.0.0-20180507213350-8e809c8a8645/go/otgrpc/server.go:57 +0x2e8
    github.com/pulumi/pulumi/sdk/v3/proto/go._ResourceProvider_Diff_Handler({0x103c8d740?, 0x140000c6dc0}, {0x103cefa38, 0x1400085d8f0}, 0x14000d42a10, 0x140008b4ae0)
        /home/runner/go/pkg/mod/github.com/pulumi/pulumi/sdk/v3@v3.91.1/proto/go/provider_grpc.pb.go:577 +0x12c
    google.golang.org/grpc.(*Server).processUnaryRPC(0x140003a81e0, {0x103cf92c0, 0x14000682b60}, 0x14000d32d80, 0x140008f30e0, 0x104ac7e88, 0x0)
        /home/runner/go/pkg/mod/google.golang.org/grpc@v1.57.0/server.go:1360 +0xc04
    google.golang.org/grpc.(*Server).handleStream(0x140003a81e0, {0x103cf92c0, 0x14000682b60}, 0x14000d32d80, 0x0)
        /home/runner/go/pkg/mod/google.golang.org/grpc@v1.57.0/server.go:1737 +0x7c4
    google.golang.org/grpc.(*Server).serveStreams.func1.1()
        /home/runner/go/pkg/mod/google.golang.org/grpc@v1.57.0/server.go:982 +0x84
    created by google.golang.org/grpc.(*Server).serveStreams.func1 in goroutine 71
        /home/runner/go/pkg/mod/google.golang.org/grpc@v1.57.0/server.go:980 +0x154
jaxxstorm commented 11 months ago

I need a repro to be able to fix this, what code do you have?

benjick commented 11 months ago

Of course, sorry!

Here's a reproduction: https://github.com/benjick/scaleway-panic-repro

  1. run pulumi up
  2. Install latest version of plugin npm install @lbrlabs/pulumi-scaleway@1.11.0
  3. run pulumi up again

Results in the above error for me

benjick commented 11 months ago

A solution for me was to remove the DatabasePrivilege, upgrade the library and then re-instate the DatabasePrivilege. Interesting that I only had to do it for one of the two I had