pulumi / pulumi-aws

An Amazon Web Services (AWS) Pulumi resource package, providing multi-language access to AWS
Apache License 2.0
459 stars 155 forks source link

Panic on Python AWS LB ListenerRule call #4194

Closed slin-aurascape closed 1 month ago

slin-aurascape commented 3 months ago

Describe what happened

In Python, Calling pulumi_aws.lb.ListenerRule() will cause panic. The pulumi aws version is 6.42.0, pulumi_awsx == 2.12.3 After downgrading the version to pulumi-aws==6.12.3, pulumi_awsx==2.12.3, the problem disappeared

Sample program

rule1 = pulumi_aws.lb.ListenerRule(
    f"{resource_name}-rule",
    listener_arn=wl.arn,
    priority=priority,
    actions=[{"type": "forward", "target_group_arn": tg.arn}],
    conditions=[{"host_header": {"values": [hostname]}}],
)

Log output

panic: value is null
goroutine 222 [running]:
github.com/hashicorp/go-cty/cty.Value.LengthInt({{{0x118b67440?, 0x1400888b1b0?}}, {0x0?, 0x0?}})
    /home/runner/go/pkg/mod/github.com/hashicorp/go-cty@v1.4.1-0.20200723130312-85980079f637/cty/value_ops.go:989 +0x254
github.com/hashicorp/terraform-provider-aws/internal/service/elbv2.flattenLbForwardActionOneOf({{{0x118b67440?, 0x1400888b210?}}, {0x115b51060?, 0x140087207e0?}}, 0x0, {{0x14008937760, 0x7}, 0x0, 0x0, 0x0, ...}, ...)
    /home/runner/work/pulumi-aws/pulumi-aws/upstream/internal/service/elbv2/listener.go:1038 +0x18c
github.com/hashicorp/terraform-provider-aws/internal/service/elbv2.flattenLbForwardAction(0x140083a9c00, {0x113384fa8, 0x6}, 0x0, {{0x14008937760, 0x7}, 0x0, 0x0, 0x0, 0x1400895f020, ...}, ...)
    /home/runner/work/pulumi-aws/pulumi-aws/upstream/internal/service/elbv2/listener.go:1016 +0x188
github.com/hashicorp/terraform-provider-aws/internal/service/elbv2.flattenLbListenerActions(0x140083a9c00, {0x113384fa8, 0x6}, {0x14008894b40?, 0x1, 0x0?})
    /home/runner/work/pulumi-aws/pulumi-aws/upstream/internal/service/elbv2/listener.go:981 +0x240
github.com/hashicorp/terraform-provider-aws/internal/service/elbv2.resourceListenerRuleRead({0x118b66fa8, 0x140088425d0}, 0x140083a9c00, {0x1188cec40?, 0x1400228c340?})
    /home/runner/work/pulumi-aws/pulumi-aws/upstream/internal/service/elbv2/listener_rule.go:620 +0x718
github.com/hashicorp/terraform-provider-aws/internal/service/elbv2.resourceListenerRuleCreate({0x118b66fa8, 0x140088425d0}, 0x140083a9c00, {0x1188cec40, 0x1400228c340})
    /home/runner/work/pulumi-aws/pulumi-aws/upstream/internal/service/elbv2/listener_rule.go:559 +0x898
github.com/hashicorp/terraform-provider-aws/internal/provider.New.(*wrappedResource).Create.interceptedHandler[...].func8(0x140083a9c00?, {0x1188cec40?, 0x1400228c340})
    /home/runner/work/pulumi-aws/pulumi-aws/upstream/internal/provider/intercept.go:113 +0x1d8
github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.(*Resource).create(0x118b66fa8?, {0x118b66fa8?, 0x1400888e7e0?}, 0xd?, {0x1188cec40?, 0x1400228c340?})
    /home/runner/go/pkg/mod/github.com/pulumi/terraform-plugin-sdk/v2@v2.0.0-20240520223432-0c0bf0d65f10/helper/schema/resource.go:773 +0x64
github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.(*Resource).Apply(0x1400237ddc0, {0x118b66fa8, 0x1400888e7e0}, 0x0, 0x140083a9900, {0x1188cec40, 0x1400228c340})
    /home/runner/go/pkg/mod/github.com/pulumi/terraform-plugin-sdk/v2@v2.0.0-20240520223432-0c0bf0d65f10/helper/schema/resource.go:909 +0x884
github.com/pulumi/pulumi-terraform-bridge/v3/pkg/tfshim/sdk-v2.v2Provider.Apply({0x14001d0a2a0?, {0x14000a6d680?, 0x118b66fa8?, 0x118961060?}}, {0x118b66fa8, 0x1400888e7e0}, {0x113420c0a, 0x14}, {0x0, 0x0}, ...)
    /home/runner/go/pkg/mod/github.com/pulumi/pulumi-terraform-bridge/v3@v3.85.0/pkg/tfshim/sdk-v2/provider.go:131 +0x148
github.com/pulumi/pulumi-terraform-bridge/v3/pkg/tfshim/sdk-v2.(*providerWithPlanResourceChangeDispatch).Apply(0x14002369830, {0x118b66fa8, 0x1400888e7e0}, {0x113420c0a, 0x14}, {0x0, 0x0}, {0x118b83400, 0x140083a9900})
    /home/runner/go/pkg/mod/github.com/pulumi/pulumi-terraform-bridge/v3@v3.85.0/pkg/tfshim/sdk-v2/provider2.go:716 +0xc8
github.com/pulumi/pulumi-terraform-bridge/v3/pkg/tfbridge.(*Provider).Create(0x14000195308, {0x118b66fa8?, 0x1400888e3c0?}, 0x140088940f0)
    /home/runner/go/pkg/mod/github.com/pulumi/pulumi-terraform-bridge/v3@v3.85.0/pkg/tfbridge/provider.go:1223 +0x678
github.com/pulumi/pulumi-terraform-bridge/x/muxer.(*muxer).Create.func1({0x118c060a0?, 0x14000195308?})
    /home/runner/go/pkg/mod/github.com/pulumi/pulumi-terraform-bridge/x/muxer@v0.0.8/muxer.go:375 +0x3c
github.com/pulumi/pulumi-terraform-bridge/x/muxer.resourceMethod[...](0x140054309c0?, 0x11833b820, 0x140088ab698?)
    /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).Create(0x1236ec200?, {0x118b66fa8?, 0x1400888e3c0?}, 0x115ff05a0?)
    /home/runner/go/pkg/mod/github.com/pulumi/pulumi-terraform-bridge/x/muxer@v0.0.8/muxer.go:374 +0x58
github.com/pulumi/pulumi/sdk/v3/proto/go._ResourceProvider_Create_Handler.func1({0x118b66fa8?, 0x1400888e3c0?}, {0x1180971a0?, 0x140088940f0?})
    /home/runner/go/pkg/mod/github.com/pulumi/pulumi/sdk/v3@v3.121.0/proto/go/provider_grpc.pb.go:651 +0xd0
github.com/grpc-ecosystem/grpc-opentracing/go/otgrpc.OpenTracingServerInterceptor.func1({0x118b66fa8, 0x1400888e1e0}, {0x1180971a0, 0x140088940f0}, 0x1400889e020, 0x1400888c0f0)
    /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_Create_Handler({0x11873b440, 0x140054309c0}, {0x118b66fa8, 0x1400888e1e0}, 0x140088a0000, 0x14003698c60)
    /home/runner/go/pkg/mod/github.com/pulumi/pulumi/sdk/v3@v3.121.0/proto/go/provider_grpc.pb.go:653 +0x148
google.golang.org/grpc.(*Server).processUnaryRPC(0x14002f51c00, {0x118b66fa8, 0x1400888e150}, {0x118bbec20, 0x14000580f00}, 0x1400889c000, 0x14004e7a030, 0x123cf6f78, 0x0)
    /home/runner/go/pkg/mod/google.golang.org/grpc@v1.63.2/server.go:1369 +0xb58
google.golang.org/grpc.(*Server).handleStream(0x14002f51c00, {0x118bbec20, 0x14000580f00}, 0x1400889c000)
    /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 31
    /home/runner/go/pkg/mod/google.golang.org/grpc@v1.63.2/server.go:1030 +0x13c

aws:lb:ListenerRule (integ-hub-rule): error: error reading from server: EOF

aws:lb:ListenerRule (slackbot-rule): error: error reading from server: EOF

Affected Resource(s)

No response

Output of pulumi about

(venv) (base) xxxx@macbook116 integrations % pulumi about CLI
Version 3.121.0 Go Version go1.22.4 Go Compiler gc

Plugins KIND NAME VERSION resource aws 6.42.0 resource awsx 2.12.3 resource docker 4.5.4 language python unknown

Host
OS darwin Version 13.4 Arch arm64

This project is written in python: executable='/Users/xxxx/Work/GitHub/ai-poc/pulumi/integrations/venv/bin/python' version='3.12.2'

Current Stack: xxxxxxxx/integrations/global

(hiding the URN information since privacy and security concern ...)

Found no pending operations associated with xxxxxxxx/global

Backend
Name pulumi.com URL https://app.pulumi.com/xxxx User xxxx Organizations xxxx, xxxxxxxx Token type personal

Dependencies: NAME VERSION pip 24.1.1 pulumi_awsx 2.12.3 setuptools 70.1.1 wheel 0.43.0

Pulumi locates its logs in /var/folders/13/gfvxw74j0kj8wkmmdn32dt7c0000gq/T/ by default

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).

flostadler commented 3 months ago

Hey @slin-aurascape, sorry you're running into this! We fixed that bug in v6.42.1. Can you try upgrading to the latest version and verify whether the panic is still occurring?

t0yv0 commented 1 month ago

Closing assuming this got fixed. Please open a new issue if there is still any remaining problem!

slin-aurascape commented 1 month ago

Sure. we can close this for now. Sorry, I didn't get a chance to verify the fix.