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

[Bug]: ELBv2 Provider v1.5.0+ LBListener 'panic' #1352

Closed
1 task done
lajchon opened this issue Jun 10, 2024 · 24 comments · Fixed by #1528
Closed
1 task done

[Bug]: ELBv2 Provider v1.5.0+ LBListener 'panic' #1352

lajchon opened this issue Jun 10, 2024 · 24 comments · Fixed by #1528
Labels
bug Something isn't working impact:high is:triaged Indicates that an issue has been reviewed.

Comments

@lajchon
Copy link

lajchon commented Jun 10, 2024

Is there an existing issue for this?

  • I have searched the existing issues

Affected Resource(s)

elbv2.aws.upbound.io/v1beta1, Kind=LBListener

Resource MRs required to reproduce the bug

---
apiVersion: elbv2.aws.upbound.io/v1beta1
kind: LBListener
metadata:
  name: https
spec:
  deletionPolicy: Delete
  forProvider:
    region: us-east-1
    protocol: TCP
    port: 443
    defaultAction:
      - type: forward
        targetGroupArn: validTargetGroupArn
    loadBalancerArn: validLoadBalancerArn

Steps to Reproduce

Deploy elbv2.aws.upbound.io/v1beta1 LB, LBTargetGroup and LBListener with v1.4.0 is successful.
Bump elbv2 Provider version to v1.5.0 or v1.6.0, an Observed a panic: value is null is logged

What happened?

After bumping version from v1.4.0 to v1.5.0+, the following is logged for existing LBListener:

2024-06-10T18:41:57Z	DEBUG	provider-aws	Observing the external resource	{"uid": "838a6eb0-7742-4b8c-ab9f-2163e6a7290b", "name": "use1-sandbox-primary-internal-j6h86-6xnx2", "gvk": "elbv2.aws.upbound.io/v1beta1, Kind=LBListener"}
E0610 18:41:57.677193       1 runtime.go:77] Observed a panic: value is null
goroutine 3841 [running]:
k8s.io/apimachinery/pkg/util/runtime.logPanic({0x134f03a0, 0x1936c980})
	k8s.io/apimachinery@v0.29.4/pkg/util/runtime/runtime.go:75 +0x85
sigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).Reconcile.func1()
	sigs.k8s.io/controller-runtime@v0.17.3/pkg/internal/controller/controller.go:108 +0xb2
panic({0x134f03a0?, 0x1936c980?})
	runtime/panic.go:770 +0x132
github.com/hashicorp/go-cty/cty.Value.LengthInt({{{0x195976d8?, 0xc00bdb2290?}}, {0x0?, 0x0?}})
	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({{{0x195976d8?, 0xc00bdb22e0?}}, {0x130d90a0?, 0xc00bce7d10?}}, 0x0, {{0xc00c7f38e0, 0x7}, 0x0, 0x0, 0x0, ...}, ...)
	github.com/hashicorp/terraform-provider-aws@v0.0.0-00010101000000-000000000000/internal/service/elbv2/listener.go:1036 +0x1de
github.com/hashicorp/terraform-provider-aws/internal/service/elbv2.flattenLbForwardAction(0xc00d1e8400, {0x16800240, 0xe}, 0x0, {{0xc00c7f38e0, 0x7}, 0x0, 0x0, 0x0, 0xc0052f3b30, ...}, ...)
	github.com/hashicorp/terraform-provider-aws@v0.0.0-00010101000000-000000000000/internal/service/elbv2/listener.go:1014 +0x22b
github.com/hashicorp/terraform-provider-aws/internal/service/elbv2.flattenLbListenerActions(0xc00d1e8400, {0x16800240, 0xe}, {0xc00cce80f0?, 0x1, 0x41a085?})
	github.com/hashicorp/terraform-provider-aws@v0.0.0-00010101000000-000000000000/internal/service/elbv2/listener.go:979 +0x2c5
github.com/hashicorp/terraform-provider-aws/internal/service/elbv2.resourceListenerRead({0x19596cf8, 0xc005270d20}, 0xc00d1e8400, {0x167734a0?, 0xc00271c000?})
	github.com/hashicorp/terraform-provider-aws@v0.0.0-00010101000000-000000000000/internal/service/elbv2/listener.go:535 +0x5db
github.com/hashicorp/terraform-provider-aws/internal/provider.New.(*wrappedResource).Read.interceptedHandler[...].func9(0xc00d1e8400?, {0x167734a0?, 0xc00271c000})
	github.com/hashicorp/terraform-provider-aws@v0.0.0-00010101000000-000000000000/internal/provider/intercept.go:113 +0x283
github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.(*Resource).read(0x19596da0?, {0x19596da0?, 0xc00ce11490?}, 0xd?, {0x167734a0?, 0xc00271c000?})
	github.com/hashicorp/terraform-plugin-sdk/v2@v2.33.0/helper/schema/resource.go:790 +0x7a
github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.(*Resource).RefreshWithoutUpgrade(0xc001e25b20, {0x19596da0, 0xc00ce11490}, 0xc00198c820, {0x167734a0, 0xc00271c000})
	github.com/hashicorp/terraform-plugin-sdk/v2@v2.33.0/helper/schema/resource.go:1089 +0x529
github.com/crossplane/upjet/pkg/controller.(*terraformPluginSDKExternal).Observe(0xc00ba9ddc0, {0x19596da0, 0xc00ce11490}, {0x1969ab10, 0xc00cd0d508})
	github.com/crossplane/upjet@v1.4.0/pkg/controller/external_tfpluginsdk.go:472 +0x173
github.com/crossplane/upjet/pkg/controller.(*terraformPluginSDKAsyncExternal).Observe(0xc00d23c1e0, {0x19596da0, 0xc00ce11490}, {0x1969ab10, 0xc00cd0d508})
	github.com/crossplane/upjet@v1.4.0/pkg/controller/external_async_tfpluginsdk.go:127 +0xc5
github.com/crossplane/crossplane-runtime/pkg/reconciler/managed.(*Reconciler).Reconcile(0xc00a9b2f00, {0x19596cf8, 0xc005085440}, {{{0x0, 0x0}, {0xc0070bc690, 0x29}}})
	github.com/crossplane/crossplane-runtime@v1.16.0-rc.2.0.20240510094504-3f697876fa57/pkg/reconciler/managed/reconciler.go:914 +0x2150
github.com/crossplane/crossplane-runtime/pkg/ratelimiter.(*Reconciler).Reconcile(0xc006636640, {0x19596cf8, 0xc005085440}, {{{0x0?, 0x5?}, {0xc0070bc690?, 0xc00cb99d10?}}})
	github.com/crossplane/crossplane-runtime@v1.16.0-rc.2.0.20240510094504-3f697876fa57/pkg/ratelimiter/reconciler.go:54 +0x151
sigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).Reconcile(0x195b60d8?, {0x19596cf8?, 0xc005085440?}, {{{0x0?, 0xb?}, {0xc0070bc690?, 0x0?}}})
	sigs.k8s.io/controller-runtime@v0.17.3/pkg/internal/controller/controller.go:119 +0xb7
sigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).reconcileHandler(0xc0065aee60, {0x19596d30, 0xc0013d3b80}, {0x15172980, 0xc00ce0f2e0})
	sigs.k8s.io/controller-runtime@v0.17.3/pkg/internal/controller/controller.go:316 +0x3bc
sigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).processNextWorkItem(0xc0065aee60, {0x19596d30, 0xc0013d3b80})
	sigs.k8s.io/controller-runtime@v0.17.3/pkg/internal/controller/controller.go:266 +0x1be
sigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).Start.func2.2()
	sigs.k8s.io/controller-runtime@v0.17.3/pkg/internal/controller/controller.go:227 +0x79
created by sigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).Start.func2 in goroutine 3650
	sigs.k8s.io/controller-runtime@v0.17.3/pkg/internal/controller/controller.go:223 +0x50c

When attempting to create a new Listener with elbv2 v1.5.0, Listeners are created correctly and associated with Load-Balancer, but the following status is eventually returned:

status:
  atProvider: {}
  conditions:
    - lastTransitionTime: '2024-06-10T18:52:32Z'
      reason: Creating
      status: 'False'
      type: Ready
    - lastTransitionTime: '2024-06-10T18:54:30Z'
      message: >-
        cannot patch the managed resource via server-side apply:
        LBListener.elbv2.aws.upbound.io
        "use1-sandbox-primary-internal-j6h86-nv9z8" is invalid: spec: Invalid
        value: "object": spec.forProvider.defaultAction is a required parameter
      reason: ReconcileError
      status: 'False'
      type: Synced
    - lastTransitionTime: '2024-06-10T18:54:30Z'
      message: >-
        async create failed: failed to create the resource: [{0 creating ELBv2
        Listener (): operation error Elastic Load Balancing v2: CreateListener,
        https response error StatusCode: 400, RequestID:
        677dd570-2c5f-4a16-9644-44ce704005f7, api error ValidationError: The
        input parameters provided are not supported  []}]
      reason: AsyncCreateFailure
      status: 'False'
      type: LastAsyncOperation

Relevant Error Output Snippet

No response

Crossplane Version

1.16.0

Provider Version

1.5.0

Kubernetes Version

No response

Kubernetes Distribution

No response

Additional Info

No response

@lajchon lajchon added bug Something isn't working needs:triage labels Jun 10, 2024
@turkenf
Copy link
Collaborator

turkenf commented Jun 14, 2024

Hi @lajchon,

Thank you for the report, is the issue also reproducible in provider v1.7.0?

@lajchon
Copy link
Author

lajchon commented Jun 14, 2024

@turkenf , it appears to still be an issue after updating the provider to v1.7.0.

@Justin-DynamicD
Copy link

Justin-DynamicD commented Jun 20, 2024

Adding voice to this issue. It also occurs in 1.6.0 and 1.6.1 as well.

In our scenario, the LBListener can cause it to crash within 5sec or so.

@towithyou
Copy link

Yes, I have also encountered this problem and don't know what to do,Looking forward to the next version resolving this issue.
version:
xpkg.upbound.io/upbound/provider-aws-elbv2:v1.9.0
xpkg.upbound.io/crossplane/crossplane:v1.16.0

@turkenf
Copy link
Collaborator

turkenf commented Jul 17, 2024

Hello folks,

Thank you for your comments on this issue. It can be reproduced with provider version v1.9.0. I will take a deeper look as soon as possible.

@turkenf turkenf added is:triaged Indicates that an issue has been reviewed. and removed needs:triage labels Jul 17, 2024
@jetersen
Copy link

jetersen commented Aug 1, 2024

@turkenf maybe this helps: pulumi/pulumi-aws#3429

@josegonzalez
Copy link

I'm seeing the same thing with the following setup:

% kubectl get providers
NAME                          INSTALLED   HEALTHY   PACKAGE                                                    AGE
provider-aws-autoscaling      True        True      xpkg.upbound.io/upbound/provider-aws-autoscaling:v1.10.0   57d
provider-aws-ec2              True        True      xpkg.upbound.io/upbound/provider-aws-ec2:v1.10.0           58d
provider-aws-ecr              True        True      xpkg.upbound.io/upbound/provider-aws-ecr:v1.10.0           22d
provider-aws-elbv2            True        True      xpkg.upbound.io/upbound/provider-aws-elbv2:v1.10.0         44h
provider-aws-iam              True        True      xpkg.upbound.io/upbound/provider-aws-iam:v1.10.0           63d
provider-aws-kms              True        True      xpkg.upbound.io/upbound/provider-aws-kms:v1.10.0           22d
provider-aws-s3               True        True      xpkg.upbound.io/upbound/provider-aws-s3:v1.10.0            64d
upbound-provider-family-aws   True        True      xpkg.upbound.io/upbound/provider-family-aws:v1.10.0        64d

Here is the resource I create:

apiVersion: elbv2.aws.upbound.io/v1beta2
kind: LBListener
metadata:
  labels:
    environment: dev
    name: dev-us-east-1-private-consul-nlb-tcp-8500
    region: us-east-1
    subnet-type: private
    vpc-name: dev-us-east-1
  name: dev-us-east-1-private-consul-nlb-tcp-8500
spec:
  forProvider:
    defaultAction:
    - targetGroupArnSelector:
        matchLabels:
          environment: dev
          name: dev-us-east-1-private-consul-nlb-tcp-8500
          region: us-east-1
          subnet-type: private
          vpc-name: dev-us-east-1
      type: forward
    loadBalancerArnSelector:
      matchLabels:
        environment: dev
        name: dev-us-east-1-private-consul-nlb
        region: us-east-1
        subnet-type: private
        vpc-name: dev-us-east-1
    port: 8500
    protocol: TCP
    region: us-east-1

As soon as that resource is applied, the elbv2 provider panics:

{"level":"info","ts":"2024-08-02T16:20:10Z","logger":"provider-aws","msg":"Beta feature enabled","flag":"EnableBetaManagementPolicies"}
panic: value is null

goroutine 31497 [running]:
github.com/hashicorp/go-cty/cty.Value.LengthInt({{{0x1c4c14b8?, 0xc0036bc0f0?}}, {0x0?, 0x0?}})
	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({{{0x1c4c14b8?, 0xc0036bc110?}}, {0x15724ee0?, 0xc003583848?}}, 0x0, {{0xc0047809c0, 0x7}, 0x0, 0x0, 0x0, ...}, ...)
	github.com/hashicorp/terraform-provider-aws@v0.0.0-00010101000000-000000000000/internal/service/elbv2/listener.go:1038 +0x1de
github.com/hashicorp/terraform-provider-aws/internal/service/elbv2.flattenLbForwardAction(0xc003c39600, {0x1944aa1c, 0xe}, 0x0, {{0xc0047809c0, 0x7}, 0x0, 0x0, 0x0, 0xc004c855c0, ...}, ...)
	github.com/hashicorp/terraform-provider-aws@v0.0.0-00010101000000-000000000000/internal/service/elbv2/listener.go:1016 +0x22b
github.com/hashicorp/terraform-provider-aws/internal/service/elbv2.flattenLbListenerActions(0xc003c39600, {0x1944aa1c, 0xe}, {0xc0011a66e0?, 0x1, 0xc00abb58ad?})
	github.com/hashicorp/terraform-provider-aws@v0.0.0-00010101000000-000000000000/internal/service/elbv2/listener.go:981 +0x2c5
github.com/hashicorp/terraform-provider-aws/internal/service/elbv2.resourceListenerRead({0x1c4c0ad8, 0xc007773b60}, 0xc003c39600, {0x193bb340?, 0xc00411d6c0?})
	github.com/hashicorp/terraform-provider-aws@v0.0.0-00010101000000-000000000000/internal/service/elbv2/listener.go:537 +0x5db
github.com/hashicorp/terraform-provider-aws/internal/service/elbv2.resourceListenerCreate({0x1c4c0ad8, 0xc007773b60}, 0xc003c39600, {0x193bb340, 0xc00411d6c0})
	github.com/hashicorp/terraform-provider-aws@v0.0.0-00010101000000-000000000000/internal/service/elbv2/listener.go:508 +0x11f3
github.com/hashicorp/terraform-provider-aws/internal/provider.New.(*wrappedResource).Create.interceptedHandler[...].func8(0xc003c39600?, {0x193bb340?, 0xc00411d6c0})
	github.com/hashicorp/terraform-provider-aws@v0.0.0-00010101000000-000000000000/internal/provider/intercept.go:113 +0x283
github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.(*Resource).create(0x1c4c0b80?, {0x1c4c0b80?, 0xc00380b650?}, 0xd?, {0x193bb340?, 0xc00411d6c0?})
	github.com/hashicorp/terraform-plugin-sdk/v2@v2.34.0/helper/schema/resource.go:801 +0x7a
github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.(*Resource).Apply(0xc00207e460, {0x1c4c0b80, 0xc00380b650}, 0x0, 0xc000311900, {0x193bb340, 0xc00411d6c0})
	github.com/hashicorp/terraform-plugin-sdk/v2@v2.34.0/helper/schema/resource.go:937 +0xa89
github.com/crossplane/upjet/pkg/controller.(*terraformPluginSDKExternal).Create(0xc0045c0c40, {0x1c4c0b80, 0xc00380b650}, {0x1c5f4a60, 0xc002d82f08})
	github.com/crossplane/upjet@v1.4.1-0.20240612123927-37c7f4e91d57/pkg/controller/external_tfpluginsdk.go:592 +0xdd
github.com/crossplane/upjet/pkg/controller.(*terraformPluginSDKAsyncExternal).Create.func1()
	github.com/crossplane/upjet@v1.4.1-0.20240612123927-37c7f4e91d57/pkg/controller/external_async_tfpluginsdk.go:149 +0x145
created by github.com/crossplane/upjet/pkg/controller.(*terraformPluginSDKAsyncExternal).Create in goroutine 3779
	github.com/crossplane/upjet@v1.4.1-0.20240612123927-37c7f4e91d57/pkg/controller/external_async_tfpluginsdk.go:145 +0x14c

Once it panics, I can't actually describe the resource because the webhook isn't running anymore. The listener does get created on the AWS side though, so I think this isn't a bug on terraform but on whatever is processing the response from terraform - maybe not understanding that a field is nullable if the action is a forward action?

Note that the first example on the docs here is also broken - if you omit the protocol, crossplane won't apply the resource - but then adding the protocol (as shown in the last example) fails with the aforementioned panic.

@josegonzalez
Copy link

This issue seems related - I wonder if this maybe has to do with block handling somehow?

@josegonzalez
Copy link

Based on the documentation, I tried changing the defaultAction to this and don't get an error but it also doesn't apply:

apiVersion: elbv2.aws.upbound.io/v1beta2
kind: LBListener
metadata:
  labels:
    environment: dev
    name: dev-us-east-1-private-consul-nlb-tcp-8500
    region: us-east-1
    subnet-type: private
    vpc-name: dev-us-east-1
  name: dev-us-east-1-private-consul-nlb-tcp-8500
spec:
  forProvider:
    defaultAction:
    - forward:
        stickiness:
          duration: 1
          enabled: false
        targetGroup:
        - arnSelector:
            matchLabels:
              environment: dev
              name: dev-us-east-1-private-consul-nlb-tcp-8500
              region: us-east-1
              subnet-type: private
              vpc-name: dev-us-east-1
          weight: 0
      type: forward
    loadBalancerArnSelector:
      matchLabels:
        environment: dev
        name: dev-us-east-1-private-consul-nlb
        region: us-east-1
        subnet-type: private
        vpc-name: dev-us-east-1
    port: 8500
    protocol: TCP
    region: us-east-1

The error is the following:

    Message:               async create failed: failed to create the resource: [{0 creating ELBv2 Listener (arn:aws:elasticloadbalancing:us-east-1:ACCOUNT_ID:loadbalancer/net/dev-us-east-1-private-consul-nlb/SOME_ID): operation error Elastic Load Balancing v2: CreateListener, https response error StatusCode: 400, RequestID: SOME_REQUEST_ID, api error ValidationError: You cannot specify a target group weight on load balancers of type 'network'  []}]

If anyone knows of a good way to disable sending a weight parameter when the load balancer type is network, I can test that out and see if this workaround works.

@josegonzalez
Copy link

Digging into the weight issue, I believe thats an upstream bug due to how it handles the forward property, so likely the workaround of using the forward property isn't viable until that is fixed upstream.

@turkenf
Copy link
Collaborator

turkenf commented Aug 5, 2024

Hello folks, thank you for your interest. I dug into this issue a bit:

The problem seems to be caused by spec.forProvider.defaultAction.forward being null, as you stated. We started to encounter this problem after bumping the terraform provider from 5.31.0 to 5.50.0. Terraform released this change with 5.36.0. Adding a null check here might solve the problem, but when I create the resource with the same configuration with terraform, I don't encounter any problems. And in the tfstate file, the forward field is "forward": [],. I think we are somehow setting the empty list fields to null or nil values. I will meet with the team to determine how we can proceed in resolving this issue and update you.

Also, as @jetersen mentioned, Pulumi has faced the same issue, and they have fixed it in the bridge provider.

@ayanevbg
Copy link

ayanevbg commented Aug 5, 2024

I downgraded the provider to v1.3.0 to avoid this error until the issue is resolved.

@josegonzalez
Copy link

@ayanevbg why not v1.4.0? The change was introduced in #1315, which came in v1.5.0.

@josegonzalez
Copy link

Note: downgrading may not be useful if you are using other providers to interact with the elbv2 provider. In my case, I need the Attachment kind from provider-aws-autoscaling, and that requires elbv2.aws.upbound.io/v1beta2, but the v1.4.0 release of provider-aws-elbv2 only supports elbv2.aws.upbound.io/v1beta1.

@mergenci
Copy link
Collaborator

Just FYI, panics no longer crash the pod as of latest release, v1.12.0, thanks to crossplane/upjet#428.

@josegonzalez
Copy link

Does it apply the resource and hold it's state though?

@Justin-DynamicD
Copy link

No, it does not. As of v1.13.0, while the panic no longer crashes the pod, the resources do not apply. In stead you get a simple little warning in the logs:

crossplane elbv2.aws.upbound.io/v1beta1 LBlistener error create failed: async create failed: recovered from panic: value is null

I'm assuming the null value is from the "forward" variable as mentioned.

@mzameer777
Copy link

We are also experiencing this issue with v1.13.1. In our case, the pod no longer goes into a CrashLoopBackOff state. However, we observe that while the load balancer listener is created, it fails to reconcile properly.

Status:
  At Provider:
  Conditions:
    Last Transition Time:  2024-09-19T06:14:28Z
    Reason:                Creating
    Status:                False
    Type:                  Ready
    Last Transition Time:  2024-09-19T06:14:28Z
    Message:               create failed: async create failed: recovered from panic: value is null
    Reason:                ReconcileError
    Status:                False
    Type:                  Synced
    Last Transition Time:  2024-09-19T06:14:28Z
    Message:               async create failed: recovered from panic: value is null
    Reason:                AsyncCreateFailure
    Status:                False
    Type:                  LastAsyncOperation
Events:
  Type     Reason                        Age                 From                                                   Message
  ----     ------                        ----                ----                                                   -------
  Normal   CreatedExternalResource       12m                 managed/elbv2.aws.upbound.io/v1beta1, kind=lblistener  Successfully requested creation of external resource
  Normal   PendingExternalResource       12m (x5 over 12m)   managed/elbv2.aws.upbound.io/v1beta1, kind=lblistener  Waiting for external resource existence to be confirmed
  Warning  CannotCreateExternalResource  30s (x13 over 12m)  managed/elbv2.aws.upbound.io/v1beta1, kind=lblistener  async create failed: recovered from panic: value is null

@mzameer777
Copy link

Yes that also doesn't work, it throws an error saying invalid value,

Spec:
  Deletion Policy:  Delete
  For Provider:
    Default Action:
      Forward:
        Target Group:
          Arn Ref:
            Name:  lb-target-group
    Load Balancer Arn Ref:
      Name:    control-plane-lb
    Port:      6443
    Protocol:  TCP
    Region:    us-west-2
    Tags:
      Crossplane - Kind:            lblistener.elbv2.aws.upbound.io
      Crossplane - Name:            control-plane-lb-listener
      Crossplane - Providerconfig:  dev
  Init Provider:
  Management Policies:
    *
  Provider Config Ref:
    Name:  dev
Status:
  At Provider:
  Conditions:
    Last Transition Time:  2024-10-03T23:53:31Z
    Message:               cannot patch the managed resource via server-side apply: LBListener.elbv2.aws.upbound.io "control-plane-lb-listener" is invalid: [spec.forProvider.defaultAction[0].type: Invalid value: "null": spec.forProvider.defaultAction[0].type in body must be of type string: "null", <nil>: Invalid value: "null": some validation rules were not checked because the object was invalid; correct the existing errors to complete validation]
    Reason:                ReconcileError
    Status:                False
    Type:                  Synced
Events:
  Type     Reason                           Age               From                                                   Message
  ----     ------                           ----              ----                                                   -------
  Warning  CannotResolveResourceReferences  5s (x6 over 34s)  managed/elbv2.aws.upbound.io/v1beta1, kind=lblistener  cannot patch the managed resource via server-side apply: LBListener.elbv2.aws.upbound.io "control-plane-lb-listener" is invalid: [spec.forProvider.defaultAction[0].type: Invalid value: "null": spec.forProvider.defaultAction[0].type in body must be of type string: "null", <nil>: Invalid value: "null": some validation rules were not checked because the object was invalid; correct the existing errors to complete validation]

The invalid value error suggests to add type key in the first element, so I did try that

Spec:
  Deletion Policy:  Delete
  For Provider:
    Default Action:
      Forward:
        Target Group:
          Arn:  arn:aws:elasticloadbalancing:us-west-2:xxx:targetgroup/lb-target-group/xxx
          Arn Ref:
            Name:  lb-target-group
      Type:        forward

managed/elbv2.aws.upbound.io/v1beta1, kind=lblistener  async create failed: failed to create the resource: [{0 creating ELBv2 Listener (arn:aws:elasticloadbalancing:us-west-2:xxx:loadbalancer/net/control-plane-lb/xxx): operation error Elastic Load Balancing v2: CreateListener, https response error StatusCode: 400, RequestID: 9073c8f5-21ff-4d14-afd2-25108550ed13, api error ValidationError: You cannot specify a target group weight on load balancers of type 'network'  []}]

@Justin-DynamicD
Copy link

The most recent merge looks to have resulted in 1.15 ... has anyone tested that yet?

@jeanduplessis
Copy link
Collaborator

This issue is under active development. There were changes upstream in Terraform that is causing this behavior and we've identified the root cause. We'll likely have a fix ready for this in next week's release.

@Justin-DynamicD
Copy link

1.16 has now been released and this issue closed. Anyone else test this yet? I guess Ill do it ...

@ahmedb24
Copy link

1.16 has now been released and this issue closed. Anyone else test this yet? I guess Ill do it ...

I did test this out. 1.16 works.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working impact:high is:triaged Indicates that an issue has been reviewed.
Projects
None yet
Development

Successfully merging a pull request may close this issue.