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 creating an aws.lb.ListenerRule resource #4128

Closed
aureq opened this issue Jun 28, 2024 · 7 comments · Fixed by #4131
Closed

Panic when creating an aws.lb.ListenerRule resource #4128

aureq opened this issue Jun 28, 2024 · 7 comments · Fixed by #4131
Assignees
Labels
impact/panic This bug represents a panic or unexpected crash impact/regression Something that used to work, but is now broken kind/bug Some behavior is incorrect or out of spec p1 A bug severe enough to be the next item assigned to an engineer resolution/fixed This issue was fixed
Milestone

Comments

@aureq
Copy link
Member

aureq commented Jun 28, 2024

Describe what happened

This may be related to #3427

I'm creating a simple ALB with a listener rule and the CLI panics with the error shown below.

Sample program

import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";

const vpc = new aws.ec2.Vpc("main", {cidrBlock: "10.0.0.0/16"});

const subnet = new aws.ec2.Subnet("main", {
    vpcId: vpc.id,
    cidrBlock: "10.0.12.0/24",
    availabilityZone: "ap-southeast-2a"
});

const subnet2 = new aws.ec2.Subnet("subnet2", {
    vpcId: vpc.id,
    cidrBlock: "10.0.5.0/24",
    availabilityZone: "ap-southeast-2b"
});

const secGroup = new aws.ec2.SecurityGroup("allowTls", {
    description: "Allow TLS inbound traffic and all outbound traffic",
    vpcId: vpc.id,
    tags: {
        Name: "allow_tls",
    },
});

const loadbalancer = new aws.lb.LoadBalancer("payload-lb", {
    loadBalancerType: "application",
    securityGroups: [secGroup.id],
    subnets: [subnet.id, subnet2.id],
    internal: true,
});

const targetGroup = new aws.lb.TargetGroup("payload-tg", {
    port: 80,
    protocol: "HTTP",
    targetType: "ip",
    vpcId: vpc.id,
});

const listener = new aws.lb.Listener("my-listener", {
    loadBalancerArn: loadbalancer.arn,
    port: 80,
    defaultActions: [{
        type: "forward",
        targetGroupArn: targetGroup.arn,
    }],
});

const listenerRule = new aws.lb.ListenerRule("my-listener-rule", {
    listenerArn: listener.arn,
    priority: 100,
    actions: [{
        type: "forward",
        targetGroupArn: targetGroup.arn,
    }],
    conditions: [{
        pathPattern: {
            values: ["/path/*"],
        },
    }],
});

Log output

  pulumi:pulumi:Stack (zendesk-5430):
    panic: value is null
    goroutine 433 [running]:
    github.com/hashicorp/go-cty/cty.Value.LengthInt({{{0x16692380?, 0xc0035faf80?}}, {0x0?, 0x0?}})
        /home/runner/go/pkg/mod/github.com/hashicorp/go-cty@v1.4.1-0.20200723130312-85980079f637/cty/value_ops.go:989 +0x258
    github.com/hashicorp/terraform-provider-aws/internal/service/elbv2.flattenLbForwardActionOneOf({{{0x16692380?, 0xc0035faff0?}}, {0x117b0cc0?, 0xc005216600?}}, 0x0, {{0xc0076b1970, 0x7}, 0x0, 0x0, 0x0, ...}, ...)
        /home/runner/work/pulumi-aws/pulumi-aws/upstream/internal/service/elbv2/listener.go:1038 +0x1de
    github.com/hashicorp/terraform-provider-aws/internal/service/elbv2.flattenLbForwardAction(0xc0056e3400, {0x1457a054, 0x6}, 0x0, {{0xc0076b1970, 0x7}, 0x0, 0x0, 0x0, 0xc007149c80, ...}, ...)
        /home/runner/work/pulumi-aws/pulumi-aws/upstream/internal/service/elbv2/listener.go:1016 +0x22b
    github.com/hashicorp/terraform-provider-aws/internal/service/elbv2.flattenLbListenerActions(0xc0056e3400, {0x1457a054, 0x6}, {0xc002b05900?, 0x1, 0x0?})
        /home/runner/work/pulumi-aws/pulumi-aws/upstream/internal/service/elbv2/listener.go:981 +0x2c5
    github.com/hashicorp/terraform-provider-aws/internal/service/elbv2.resourceListenerRuleRead({0x16691ee8, 0xc007136ed0}, 0xc0056e3400, {0x1452b520?, 0xc00229c8f0?})
        /home/runner/work/pulumi-aws/pulumi-aws/upstream/internal/service/elbv2/listener_rule.go:620 +0x85b
    github.com/hashicorp/terraform-provider-aws/internal/service/elbv2.resourceListenerRuleCreate({0x16691ee8, 0xc007136ed0}, 0xc0056e3400, {0x1452b520, 0xc00229c8f0})
        /home/runner/work/pulumi-aws/pulumi-aws/upstream/internal/service/elbv2/listener_rule.go:559 +0xb59
    github.com/hashicorp/terraform-provider-aws/internal/provider.New.(*wrappedResource).Create.interceptedHandler[...].func8(0xc0056e3400?, {0x1452b520?, 0xc00229c8f0})
        /home/runner/work/pulumi-aws/pulumi-aws/upstream/internal/provider/intercept.go:113 +0x283
    github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.(*Resource).create(0x16691ee8?, {0x16691ee8?, 0xc006f62ba0?}, 0xd?, {0x1452b520?, 0xc00229c8f0?})
        /home/runner/go/pkg/mod/github.com/pulumi/terraform-plugin-sdk/v2@v2.0.0-20240520223432-0c0bf0d65f10/helper/schema/resource.go:773 +0x7a
    github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.(*Resource).Apply(0xc0022cefc0, {0x16691ee8, 0xc006f62ba0}, 0x0, 0xc0056e2a80, {0x1452b520, 0xc00229c8f0})
        /home/runner/go/pkg/mod/github.com/pulumi/terraform-plugin-sdk/v2@v2.0.0-20240520223432-0c0bf0d65f10/helper/schema/resource.go:909 +0xa89
    github.com/pulumi/pulumi-terraform-bridge/v3/pkg/tfshim/sdk-v2.v2Provider.Apply({0xc001b785a0?, {0xc000fb1660?, 0xc000243720?, 0xc0039754b8?}}, {0x16691ee8, 0xc006f62ba0}, {0x1461581e, 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 +0x185
    github.com/pulumi/pulumi-terraform-bridge/v3/pkg/tfshim/sdk-v2.(*providerWithPlanResourceChangeDispatch).Apply(0xc002377ce0, {0x16691ee8, 0xc006f62ba0}, {0x1461581e, 0x14}, {0x0, 0x0}, {0x166ae3c0, 0xc0056e2a80})
        /home/runner/go/pkg/mod/github.com/pulumi/pulumi-terraform-bridge/v3@v3.85.0/pkg/tfshim/sdk-v2/provider2.go:716 +0xf3
    github.com/pulumi/pulumi-terraform-bridge/v3/pkg/tfbridge.(*Provider).Create(0xc000723308, {0x16691ee8?, 0xc006f19cb0?}, 0xc001ee06e0)
        /home/runner/go/pkg/mod/github.com/pulumi/pulumi-terraform-bridge/v3@v3.85.0/pkg/tfbridge/provider.go:1223 +0x8ae
    github.com/pulumi/pulumi-terraform-bridge/x/muxer.(*muxer).Create.func1({0x16732540?, 0xc000723308?})
        /home/runner/go/pkg/mod/github.com/pulumi/pulumi-terraform-bridge/x/muxer@v0.0.8/muxer.go:375 +0x30
    github.com/pulumi/pulumi-terraform-bridge/x/muxer.resourceMethod[...](0xc00744b800?, 0x13f980c0, 0xc0066816c0?)
        /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).Create(0x21374da0?, {0x16691ee8?, 0xc006f19cb0?}, 0x11c4fac0?)
        /home/runner/go/pkg/mod/github.com/pulumi/pulumi-terraform-bridge/x/muxer@v0.0.8/muxer.go:374 +0x56
    github.com/pulumi/pulumi/sdk/v3/proto/go._ResourceProvider_Create_Handler.func1({0x16691ee8?, 0xc006f19cb0?}, {0x13cf39a0?, 0xc001ee06e0?})
        /home/runner/go/pkg/mod/github.com/pulumi/pulumi/sdk/v3@v3.121.0/proto/go/provider_grpc.pb.go:651 +0xcb
    github.com/grpc-ecosystem/grpc-opentracing/go/otgrpc.OpenTracingServerInterceptor.func1({0x16691ee8, 0xc006f19a10}, {0x13cf39a0, 0xc001ee06e0}, 0xc0073489c0, 0xc0052ad0c8)
        /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_Create_Handler({0x14397600, 0xc00744b800}, {0x16691ee8, 0xc006f19a10}, 0xc001b4d080, 0xc005206820)
        /home/runner/go/pkg/mod/github.com/pulumi/pulumi/sdk/v3@v3.121.0/proto/go/provider_grpc.pb.go:653 +0x143
    google.golang.org/grpc.(*Server).processUnaryRPC(0xc00524c000, {0x16691ee8, 0xc006f19740}, {0x166e9d20, 0xc000300000}, 0xc0070c0480, 0xc0074c0540, 0x2197ffd8, 0x0)
        /home/runner/go/pkg/mod/google.golang.org/grpc@v1.63.2/server.go:1369 +0xdf8
    google.golang.org/grpc.(*Server).handleStream(0xc00524c000, {0x166e9d20, 0xc000300000}, 0xc0070c0480)
        /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 24
        /home/runner/go/pkg/mod/google.golang.org/grpc@v1.63.2/server.go:1030 +0x125

Affected Resource(s)

  • aws.lb.ListenerRule

Output of 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
resource  docker  3.6.1
language  nodejs  unknown

Host     
OS       debian
Version  12.5
Arch     x86_64

This project is written in nodejs: executable='/usr/local/bin/node' version='v20.14.0'

Current Stack: xxx/zendesk/5430

TYPE                                 URN
pulumi:pulumi:Stack                  urn:pulumi:5430::zendesk::pulumi:pulumi:Stack::zendesk-5430
pulumi:providers:aws                 urn:pulumi:5430::zendesk::pulumi:providers:aws::default_6_42_0
aws:ec2/vpc:Vpc                      urn:pulumi:5430::zendesk::aws:ec2/vpc:Vpc::main
aws:ec2/securityGroup:SecurityGroup  urn:pulumi:5430::zendesk::aws:ec2/securityGroup:SecurityGroup::allowTls
aws:lb/targetGroup:TargetGroup       urn:pulumi:5430::zendesk::aws:lb/targetGroup:TargetGroup::payload-tg
aws:ec2/subnet:Subnet                urn:pulumi:5430::zendesk::aws:ec2/subnet:Subnet::subnet2
aws:ec2/subnet:Subnet                urn:pulumi:5430::zendesk::aws:ec2/subnet:Subnet::main
aws:lb/loadBalancer:LoadBalancer     urn:pulumi:5430::zendesk::aws:lb/loadBalancer:LoadBalancer::payload-lb
aws:lb/listener:Listener             urn:pulumi:5430::zendesk::aws:lb/listener:Listener::my-listener


Found no pending operations associated with 5430

Backend        
Name           pulumi.com
URL            https://app.pulumi.com/aureq
User           aureq
Organizations  aureq, team-ce, demo, pulumi
Token type     personal

Dependencies:
NAME            VERSION
@types/node     18.19.39
typescript      5.5.2
@pulumi/aws     6.42.0
@pulumi/awsx    2.12.3
@pulumi/pulumi  3.121.0

Pulumi locates its logs in /tmp 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).

@aureq aureq added kind/bug Some behavior is incorrect or out of spec impact/panic This bug represents a panic or unexpected crash p0 A bug severe enough to interrupt existing work needs-triage Needs attention from the triage team labels Jun 28, 2024
@aureq
Copy link
Member Author

aureq commented Jun 28, 2024

Adding more context, only the latest version 6.42.0 is affected by the panic. So #3427 is probably a good candidate.

@aureq aureq added the p1 A bug severe enough to be the next item assigned to an engineer label Jun 28, 2024
@flostadler flostadler self-assigned this Jun 28, 2024
@flostadler
Copy link
Contributor

flostadler commented Jun 28, 2024

In #4083 lb.Listener and alb.Listener were enrolled in PlanResourceChange.
The panic here is seems to be for lb.ListenerRule. My hunch is that this resource (and alb.ListenerRule) needs to be enrolled in PlanResourceChange too.

@flostadler flostadler removed the p0 A bug severe enough to interrupt existing work label Jun 28, 2024
@flostadler flostadler added impact/regression Something that used to work, but is now broken and removed needs-triage Needs attention from the triage team labels Jun 28, 2024
@Vojtrex
Copy link

Vojtrex commented Jun 28, 2024

I've experienced this exact issue. Had to temporarily downgrade the pulumi_aws back to 6.41.0, which does not introduce the panic as @aureq has mentioned.

@flostadler
Copy link
Contributor

@Vojtrex Sorry you're running into this. We're already working on a fix and will try to release it as soon as possible

@pulumi-bot pulumi-bot added the resolution/fixed This issue was fixed label Jun 28, 2024
@flostadler
Copy link
Contributor

We fixed this in #4131. Will kick off a release asap

@aureq
Copy link
Member Author

aureq commented Jun 28, 2024

@Vojtrex we just released 6.42.1. Could you please give it a whirl and confirm it's all good on your end? I'll do the same soon as well.

@aureq
Copy link
Member Author

aureq commented Jun 29, 2024

@Vojtrex Confirmed it's working fine for me, and expect that you shouldn't have any issues either.

@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
impact/panic This bug represents a panic or unexpected crash impact/regression Something that used to work, but is now broken kind/bug Some behavior is incorrect or out of spec p1 A bug severe enough to be the next item assigned to an engineer resolution/fixed This issue was fixed
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants