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

Panic when modifying customerEventData of a flex match config object #4239

Closed
stooj opened this issue Jul 17, 2024 · 1 comment · Fixed by #4256
Closed

Panic when modifying customerEventData of a flex match config object #4239

stooj opened this issue Jul 17, 2024 · 1 comment · Fixed by #4256
Assignees
Labels
area/patch An issue describing an existing patch on upstream and the criteria to close it. customer/feedback Feedback from customers impact/panic This bug represents a panic or unexpected crash kind/bug Some behavior is incorrect or out of spec p1 A bug severe enough to be the next item assigned to an engineer
Milestone

Comments

@stooj
Copy link

stooj commented Jul 17, 2024

Describe what happened

Getting a panic when trying to modify the customEventData of a flex match config object in aws PulumiAws v6.44.0 (latest)

Sample program

new MatchmakingConfiguration($"{cfg.Region.RegionShortName}-{serviceNamePrefix}-{name}FlexMatchConfig", new MatchmakingConfigurationArgs
            {
                AcceptanceRequired = false,
                FlexMatchMode = "STANDALONE",
                Name = GetAwsResourceName(cfg, $"CubeMatchmaker-{name}-v{ApplicationVersion.Current}-{DataVersion.Current}"),
                RuleSetName = ruleSetName,
                RequestTimeoutSeconds = timeout,
                GameSessionData = string.Empty,
                CustomEventData = $"{CompleteVersion.Current.ToPlusFormat()}+{cfg.Environment}{(cfg.EphemeralKey != null ? "." + cfg.EphemeralKey : "")}",
                BackfillMode = "MANUAL",
                Tags = cfg.DefaultTags,
            }, new CustomResourceOptions
            {
                Parent = this,
                // we don't use this value, but it's returned by the flexmatch API and shows as a diff
                // which just causes extra writes/noise in the pulumi update
                IgnoreChanges = new List<string> { "gameSessionQueueArns"}
            });

Log output

pulumi:pulumi:Stack (ephemeral-mkhan-31.3.0):
    panic: interface conversion: interface {} is *schema.Set, not []interface {}
    goroutine 203 [running]:
    github.com/hashicorp/terraform-provider-aws/internal/service/gamelift.resourceMatchmakingConfigurationUpdate({0x118e5b088, 0x140084cac60}, 0x1400823f200, {0x118bcc060, 0x1400220fa00})
    	/home/runner/work/pulumi-aws/pulumi-aws/upstream/internal/service/gamelift/matchmaking_configuration.go:312 +0xecc
    github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.(*Resource).update(0x118e5b088?, {0x118e5b088?, 0x140084cac60?}, 0xd?, {0x118bcc060?, 0x1400220fa00?})
    	/home/runner/go/pkg/mod/github.com/pulumi/terraform-plugin-sdk/v2@v2.0.0-20240520223432-0c0bf0d65f10/helper/schema/resource.go:807 +0x64
    github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.(*Resource).Apply(0x1400229a540, {0x118e5b088, 0x140084cac60}, 0x140084eba00, 0x14008049c00, {0x118bcc060, 0x1400220fa00})
    	/home/runner/go/pkg/mod/github.com/pulumi/terraform-plugin-sdk/v2@v2.0.0-20240520223432-0c0bf0d65f10/helper/schema/resource.go:919 +0x670
    github.com/pulumi/pulumi-terraform-bridge/v3/pkg/tfshim/sdk-v2.v2Provider.Apply({0x140011a49c0?, {0x14002137c30?, 0x14007cb5130?, 0x140084cadb0?}}, {0x118e5b088, 0x140084cac60}, {0x1138f119b, 0x26}, {0x118e5b3d0, 0x140086795f0}, ...)
    	/home/runner/go/pkg/mod/github.com/pulumi/pulumi-terraform-bridge/v3@v3.84.0/pkg/tfshim/sdk-v2/provider.go:131 +0x148
    github.com/pulumi/pulumi-terraform-bridge/v3/pkg/tfshim/sdk-v2.(*providerWithPlanResourceChangeDispatch).Apply(0x14002324810, {0x118e5b088, 0x140084cac60}, {0x1138f119b, 0x26}, {0x118e5b3d0, 0x140086795f0}, {0x118e76ac0, 0x14008049c00})
    	/home/runner/go/pkg/mod/github.com/pulumi/pulumi-terraform-bridge/v3@v3.84.0/pkg/tfshim/sdk-v2/provider2.go:695 +0xc8
    github.com/pulumi/pulumi-terraform-bridge/v3/pkg/tfbridge.(*Provider).Update(0x14000f29308, {0x118e5b088?, 0x140084ca840?}, 0x1400439f0e0)
    	/home/runner/go/pkg/mod/github.com/pulumi/pulumi-terraform-bridge/v3@v3.84.0/pkg/tfbridge/provider.go:1401 +0x9b8
    github.com/pulumi/pulumi-terraform-bridge/x/muxer.(*muxer).Update.func1({0x118ef7ce0?, 0x14000f29308?})
    	/home/runner/go/pkg/mod/github.com/pulumi/pulumi-terraform-bridge/x/muxer@v0.0.8/muxer.go:387 +0x3c
    github.com/pulumi/pulumi-terraform-bridge/x/muxer.resourceMethod[...](0x140071f4360?, 0x118639200, 0x1400739d698?)
    	/home/runner/go/pkg/mod/github.com/pulumi/pulumi-terraform-bridge/x/muxer@v0.0.8/muxer.go:334 +0xc4
    github.com/pulumi/pulumi-terraform-bridge/x/muxer.(*muxer).Update(0x123842f10?, {0x118e5b088?, 0x140084ca840?}, 0x116312ee0?)
    	/home/runner/go/pkg/mod/github.com/pulumi/pulumi-terraform-bridge/x/muxer@v0.0.8/muxer.go:386 +0x58
    github.com/pulumi/pulumi/sdk/v3/proto/go._ResourceProvider_Update_Handler.func1({0x118e5b088?, 0x140084ca840?}, {0x1186ce140?, 0x1400439f0e0?})
    	/home/runner/go/pkg/mod/github.com/pulumi/pulumi/sdk/v3@v3.118.0/proto/go/provider_grpc.pb.go:687 +0xd0
    github.com/grpc-ecosystem/grpc-opentracing/go/otgrpc.OpenTracingServerInterceptor.func1({0x118e5b088, 0x140084ca210}, {0x1186ce140, 0x1400439f0e0}, 0x140084e00a0, 0x140084dc1f8)
    	/home/runner/go/pkg/mod/github.com/grpc-ecosystem/grpc-opentracing@v0.0.0-20180507213350-8e809c8a8645/go/otgrpc/server.go:57 +0x2e4
    github.com/pulumi/pulumi/sdk/v3/proto/go._ResourceProvider_Update_Handler({0x118a39d60, 0x140071f4360}, {0x118e5b088, 0x140084ca210}, 0x1400823e980, 0x1400511cb40)
    	/home/runner/go/pkg/mod/github.com/pulumi/pulumi/sdk/v3@v3.118.0/proto/go/provider_grpc.pb.go:689 +0x148
    google.golang.org/grpc.(*Server).processUnaryRPC(0x14004c25c00, {0x118e5b088, 0x140084ca180}, {0x118eb1860, 0x14000329b00}, 0x140084de000, 0x14007280030, 0x123e290e8, 0x0)
    	/home/runner/go/pkg/mod/google.golang.org/grpc@v1.63.2/server.go:1369 +0xb58
    google.golang.org/grpc.(*Server).handleStream(0x14004c25c00, {0x118eb1860, 0x14000329b00}, 0x140084de000)
    	/home/runner/go/pkg/mod/google.golang.org/grpc@v1.63.2/server.go:1780 +0xb20
    google.golang.org/grpc.(*Server).serveStreams.func2.1()
    	/home/runner/go/pkg/mod/google.golang.org/grpc@v1.63.2/server.go:1019 +0x8c
    created by google.golang.org/grpc.(*Server).serveStreams.func2 in goroutine 42
    	/home/runner/go/pkg/mod/google.golang.org/grpc@v1.63.2/server.go:1030 +0x13c

  aws:sqs:Queue (usw2-mkhan-CubeGame-Api-v31-3-0-CreateGame):
    error: error reading from server: read tcp 127.0.0.1:60923->127.0.0.1:60920: read: connection reset by peer

Affected Resource(s)

No response

Output of pulumi about

we're using the automation api so there's no yaml

  • the cli version ive tried is 3.124.0
  • the Pulumi nuget package version is 3.64.0
  • Pulumi.Automation is 3.64.0
  • Pulumi.Aws is 6.44.0

Additional context

No response

Contributing

Vote on this issue by adding a 👍 reaction.
To contribute a fix for this issue, leave a comment (and link to your pull request, if you've opened one already).

@stooj stooj added kind/bug Some behavior is incorrect or out of spec needs-triage Needs attention from the triage team labels Jul 17, 2024
@corymhall
Copy link
Contributor

@stooj do you know if this ever worked? I've tried testing this going back to pretty old aws versions and I couldn't get this to work.

It looks like this issue is entirely created through a patch.

+ input.GameSessionQueueArns = expandStringList(v.([]interface{}))

We need to change

	if v, ok := d.GetOk("game_session_queue_arns"); ok {
		input.GameSessionQueueArns = expandStringList(v.([]interface{}))
	}

to

	if v, ok := d.GetOk("game_session_queue_arns"); ok {
		input.GameSessionQueueArns = expandStringList(v.(*schema.Set))
	}

@corymhall corymhall added impact/panic This bug represents a panic or unexpected crash area/patch An issue describing an existing patch on upstream and the criteria to close it. and removed needs-triage Needs attention from the triage team labels Jul 17, 2024
@mikhailshilkov mikhailshilkov added customer/feedback Feedback from customers p1 A bug severe enough to be the next item assigned to an engineer labels Jul 18, 2024
@t0yv0 t0yv0 self-assigned this Jul 18, 2024
t0yv0 added a commit that referenced this issue Jul 19, 2024
Fixes #4239

For some reason the create and update codepaths diverged, and update
codepath had a bug. This is now fixed.
@mjeffryes mjeffryes added this to the 0.107 milestone Jul 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/patch An issue describing an existing patch on upstream and the criteria to close it. customer/feedback Feedback from customers impact/panic This bug represents a panic or unexpected crash kind/bug Some behavior is incorrect or out of spec p1 A bug severe enough to be the next item assigned to an engineer
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants