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

Provider panics when the token provided in the code block below does not have access to the organization #224

Closed
chomey opened this issue Feb 23, 2023 · 1 comment · Fixed by #249

Comments

@chomey
Copy link

chomey commented Feb 23, 2023

	return buildkite.NewProvider(ctx, name, &buildkite.ProviderArgs{
		ApiToken:     apiToken,
		Organization: pulumi.String(org),

When this is run with incompatible values (i.e. token does not have access to the organization), it panics which messes with the Pulumi state. This should error gracefully and still allow Pulumi to update values

  pulumi:pulumi:Stack (my-stack):
    panic: interface conversion: graphql.ID is nil, not string
    goroutine 120 [running]:
    github.com/buildkite/terraform-provider-buildkite/buildkite.GetOrganizationID({0xc000798050, 0xf}, 0xc0002f8ee8?)
        /go/pkg/mod/github.com/buildkite/[email protected]/buildkite/util.go:27 +0x126
    github.com/buildkite/terraform-provider-buildkite/buildkite.CreatePipeline({0x1d16560, 0xc0000a0540}, 0x1999d60?, {0x1981c40?, 0xc000510ea0})
        /go/pkg/mod/github.com/buildkite/[email protected]/buildkite/resource_pipeline.go:301 +0x91
    github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.(*Resource).create(0xc0001b27e0, {0x1d16528, 0xc00012a098}, 0xd?, {0x1981c40, 0xc000510ea0})
        /go/pkg/mod/github.com/pulumi/terraform-plugin-sdk/[email protected]/helper/schema/resource.go:712 +0x12e
    github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.(*Resource).Apply(0xc0001b27e0, {0x1d16528, 0xc00012a098}, 0x0, 0xc0001afe00, {0x1981c40, 0xc000510ea0})
        /go/pkg/mod/github.com/pulumi/terraform-plugin-sdk/[email protected]/helper/schema/resource.go:842 +0xa7a
    github.com/pulumi/pulumi-terraform-bridge/v3/pkg/tfshim/sdk-v2.v2Provider.Apply({0x1b089f9?}, {0x1b16404, 0x12}, {0x0?, 0x0}, {0x1d1b830?, 0xc0001afe00})
        /go/pkg/mod/github.com/pulumi/pulumi-terraform-bridge/[email protected]/pkg/tfshim/sdk-v2/provider.go:122 +0x19b
    github.com/pulumi/pulumi-terraform-bridge/v3/pkg/tfbridge.(*Provider).Create(0xc00042c000, {0x1d16598?, 0xc000046ff0?}, 0xc0006a9630)
        /go/pkg/mod/github.com/pulumi/pulumi-terraform-bridge/[email protected]/pkg/tfbridge/provider.go:873 +0x643
    github.com/pulumi/pulumi/sdk/v3/proto/go._ResourceProvider_Create_Handler.func1({0x1d16598, 0xc000046ff0}, {0x1a74380?, 0xc0006a9630})
        /go/pkg/mod/github.com/pulumi/pulumi/sdk/[email protected]/proto/go/provider.pb.go:3746 +0x78
    github.com/grpc-ecosystem/grpc-opentracing/go/otgrpc.OpenTracingServerInterceptor.func1({0x1d16598, 0xc000046f30}, {0x1a74380, 0xc0006a9630}, 0xc00027ae00, 0xc0007b94a0)
        /go/pkg/mod/github.com/grpc-ecosystem/[email protected]/go/otgrpc/server.go:57 +0x3f9
    github.com/pulumi/pulumi/sdk/v3/proto/go._ResourceProvider_Create_Handler({0x1ad85a0?, 0xc00042c000}, {0x1d16598, 0xc000046f30}, 0xc00022b2d0, 0xc000447940)
        /go/pkg/mod/github.com/pulumi/pulumi/sdk/[email protected]/proto/go/provider.pb.go:3748 +0x138
    google.golang.org/grpc.(*Server).processUnaryRPC(0xc0000001e0, {0x1d1b9a8, 0xc0007041a0}, 0xc00014c360, 0xc0002cf200, 0x246ce00, 0x0)
        /go/pkg/mod/google.golang.org/[email protected]/server.go:1301 +0xb0b
    google.golang.org/grpc.(*Server).handleStream(0xc0000001e0, {0x1d1b9a8, 0xc0007041a0}, 0xc00014c360, 0x0)
        /go/pkg/mod/google.golang.org/[email protected]/server.go:1642 +0xa1b
    google.golang.org/grpc.(*Server).serveStreams.func1.2()
        /go/pkg/mod/google.golang.org/[email protected]/server.go:938 +0x98
    created by google.golang.org/grpc.(*Server).serveStreams.func1
        /go/pkg/mod/google.golang.org/[email protected]/server.go:936 +0x28a
    error: update failed
@jradtilbrook
Copy link
Contributor

Hi @chomey thanks for raising this. We'll be looking at a fix for this in April

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants