-
Notifications
You must be signed in to change notification settings - Fork 157
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
LB Listener panics during creation if targetGroupArn with a forward defaultAction is specified #3421
Comments
We too are getting the same on
|
Also confirmed separately
|
For those affected by the issue, please try downgrading the AWS provider to |
@aureq seems like we both found out about the same time ;-) #3423 (comment) |
Here's a minimal repro in typescript: 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: "us-east-1a"
});
const subnet2 = new aws.ec2.Subnet("subnet2", {
vpcId: vpc.id,
cidrBlock: "10.0.5.0/24",
availabilityZone: "us-east-1b"
});
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,
});
new aws.lb.Listener("payload-lb-listner-http", {
loadBalancerArn: loadbalancer.arn,
port: 80,
protocol: "HTTP",
defaultActions: [
{
type: "forward",
targetGroupArn: targetGroup.arn,
},
],
}); Running Commenting out the I've edited the title of the issue to clarify the issue. Looking at the AWS console it looks like the listener is actually created even though the creation panics. This upstream commit seems highly relevant: hashicorp/terraform-provider-aws#35671 EDIT: The issue does not reproduce in TF: provider "aws" {
region = "us-east-1"
}
resource "aws_lb" "test" {
name = "test-lb-tf"
load_balancer_type = "application"
subnets = ["subnet-024ee9ae807005167", "subnet-032845d3bdd2ee7c7"]
internal = true
}
resource "aws_lb_target_group" "test" {
name = "tf-example-lb-tg"
port = 80
protocol = "HTTP"
vpc_id = "vpc-09331da3db2535e57"
}
resource "aws_lb_listener" "front_end" {
load_balancer_arn = aws_lb.test.arn
port = "80"
protocol = "HTTP"
default_action {
type = "forward"
target_group_arn = aws_lb_target_group.test.arn
}
} This means this is likely an issue in our handling of nulls/empty in the bridge. |
Still investigating the issue, to anyone who needs a workaround - looks like specifying the target groups via the new aws.lb.Listener("payload-lb-listner-http", {
loadBalancerArn: loadbalancer.arn,
port: 80,
protocol: "HTTP",
defaultActions: [
{
type: "forward",
forward: {
targetGroups: [{arn: targetGroup.arn}],
}
},
],
}); instead of: new aws.lb.Listener("payload-lb-listner-http", {
loadBalancerArn: loadbalancer.arn,
port: 80,
protocol: "HTTP",
defaultActions: [
{
type: "forward",
targetGroupArn: targetGroup.arn,
},
],
}); |
We're deploying a fix for the issue in #3426 which should get released a bit later today. |
This reverts the following upstream PRs: hashicorp/terraform-provider-aws#35671 hashicorp/terraform-provider-aws#35678 as a quick fix to mitigate #3421 until we root-cause it. Details on my findings so far: #3421 (comment) It looks to me like the issue originates somewhere in our handling of nulls/empty in the bridge, so seems unlikely to get fixed today. It also adds a test for LB listeners. I've verified that the test triggers the panic without the patches and that the patches resolve it.
We've released https://github.com/pulumi/pulumi-aws/releases/tag/v6.22.1 and I've confirmed the issue no longer replicates on that version. |
Edit: the issue was coming from the fact that the pulumi state file was referencing
I'm facing this issue and I tried 6.22.1, 6.22.2 and 6.23.0 but I always get the same error. terminal output with error for pip install and pulumi preview(env) $ python3 -m pip install -U -r requirements.txt pip && pulumi plugin rm --all --yes
Requirement already satisfied: pip in /Users/user1/aam/env/lib/python3.11/site-packages (24.0)
Requirement already satisfied: pulumi<4.0.0,>=3.65.0 in /Users/user1/aam/env/lib/python3.11/site-packages (from -r requirements.txt (line 1)) (3.107.0)
Requirement already satisfied: pulumi-aws==6.22.1 in /Users/user1/aam/env/lib/python3.11/site-packages (from -r requirements.txt (line 2)) (6.22.1)
Requirement already satisfied: pulumi-docker<5.0.0,>=4.1.2 in /Users/user1/aam/env/lib/python3.11/site-packages (from -r requirements.txt (line 3)) (4.5.1)
Requirement already satisfied: parver>=0.2.1 in /Users/user1/aam/env/lib/python3.11/site-packages (from pulumi-aws==6.22.1->-r requirements.txt (line 2)) (0.5)
Requirement already satisfied: semver>=2.8.1 in /Users/user1/aam/env/lib/python3.11/site-packages (from pulumi-aws==6.22.1->-r requirements.txt (line 2)) (2.13.0)
Requirement already satisfied: protobuf~=4.21 in /Users/user1/aam/env/lib/python3.11/site-packages (from pulumi<4.0.0,>=3.65.0->-r requirements.txt (line 1)) (4.25.3)
Requirement already satisfied: grpcio~=1.60.1 in /Users/user1/aam/env/lib/python3.11/site-packages (from pulumi<4.0.0,>=3.65.0->-r requirements.txt (line 1)) (1.60.1)
Requirement already satisfied: dill~=0.3 in /Users/user1/aam/env/lib/python3.11/site-packages (from pulumi<4.0.0,>=3.65.0->-r requirements.txt (line 1)) (0.3.8)
Requirement already satisfied: six~=1.12 in /Users/user1/aam/env/lib/python3.11/site-packages (from pulumi<4.0.0,>=3.65.0->-r requirements.txt (line 1)) (1.16.0)
Requirement already satisfied: pyyaml~=6.0 in /Users/user1/aam/env/lib/python3.11/site-packages (from pulumi<4.0.0,>=3.65.0->-r requirements.txt (line 1)) (6.0.1)
Requirement already satisfied: arpeggio>=1.7 in /Users/user1/aam/env/lib/python3.11/site-packages (from parver>=0.2.1->pulumi-aws==6.22.1->-r requirements.txt (line 2)) (2.0.2)
Requirement already satisfied: attrs>=19.2 in /Users/user1/aam/env/lib/python3.11/site-packages (from parver>=0.2.1->pulumi-aws==6.22.1->-r requirements.txt (line 2)) (23.2.0)
removed: resource aws-6.22.0
removed: resource aws-6.22.1
removed: resource docker-4.5.0
removed: resource docker-4.5.1
(env) $ pulumi preview --diff
Previewing update (main):
Downloading plugin: 21.42 MiB / 21.42 MiB [=========================] 100.00% 5s
Downloading plugin: 21.64 MiB / 212.59 MiB [==>-----------------] 10.18% 00m49s[resource plugin docker-4.5.1] installing
Downloading plugin: 21.55 MiB / 21.55 MiB [=========================] 100.00% 5s
[resource plugin docker-4.5.0] installing
Downloading plugin: 212.59 MiB / 212.59 MiB [======================] 100.00% 31s
[resource plugin aws-6.22.0] installing
Downloading plugin: 212.59 MiB / 212.59 MiB [======================] 100.00% 31s
[resource plugin aws-6.22.1] installing
~ pulumi:pulumi:Stack: (refresh)
[urn=urn:pulumi:main::aam::pulumi:pulumi:Stack::aam-main]
panic: value is null
goroutine 129 [running]:
github.com/hashicorp/go-cty/cty.Value.LengthInt({{{0x13074e68?, 0xc002a50e90?}}, {0x0?, 0x0?}})
/home/runner/go/pkg/mod/github.com/hashicorp/go-cty@v1.4.1-0.20200723130312-85980079f637/cty/value_ops.go:989 +0x24f
github.com/hashicorp/terraform-provider-aws/internal/service/elbv2.flattenLbForwardActionOneOf({{{0x13074e68?, 0xc002a50eb0?}}, {0xea82420?, 0xc005612f60?}}, 0x7600000000000010?, {{0xc003431b70, 0x7}, 0x0, 0x0, 0x0, ...}, ...)
/home/runner/work/pulumi-aws/pulumi-aws/upstream/internal/service/elbv2/listener.go:1036 +0x1d0
github.com/hashicorp/terraform-provider-aws/internal/service/elbv2.flattenLbForwardAction(0xc0034d8078?, {0x1168203b, 0xe}, 0xc0034d8030?, {{0xc003431b70, 0x7}, 0x0, 0x0, 0x0, 0xc00345f800, ...}, ...)
/home/runner/work/pulumi-aws/pulumi-aws/upstream/internal/service/elbv2/listener.go:1014 +0x22b
[...] |
Adds another regression test for #3421 The issue is not only present in Create but in Update - almost shipped a half-fix in pulumi/pulumi-terraform-bridge#1725. This test should ensure we don't ship a half-fix.
What happened?
Running
pulumi preview
orup
with the--refresh
flag is causing a panic. The same code ran successfully on 2024-02-09. Other projects are using ELBs that do not have this problem.Example
Output of
pulumi about
CLI
Version 3.104.2
Go Version go1.21.6
Go Compiler gc
Plugins
NAME VERSION
aws 6.22.0
python unknown
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).
The text was updated successfully, but these errors were encountered: