{"record":{"id":"87b4e014584f5a42","repo":"kubernetes/kops","slug":"load-balancer-not-yet-created-arn-not-set","errorCode":null,"errorMessage":"load balancer not yet created (arn not set)","messagePattern":"load balancer not yet created \\(arn not set\\)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"upup/pkg/fi/cloudup/awstasks/networkloadbalancerlistener.go","lineNumber":155,"sourceCode":"}\n\nfunc (e *NetworkLoadBalancerListener) Normalize(c *fi.CloudupContext) error {\n\treturn nil\n}\n\nfunc (*NetworkLoadBalancerListener) CheckChanges(a, e, changes *NetworkLoadBalancerListener) error {\n\treturn nil\n}\n\nfunc (*NetworkLoadBalancerListener) RenderAWS(t *awsup.AWSAPITarget, a, e, changes *NetworkLoadBalancerListener) error {\n\tctx := context.TODO()\n\n\tif e.NetworkLoadBalancer == nil {\n\t\treturn fi.RequiredField(\"NetworkLoadBalancer\")\n\t}\n\tloadBalancerArn := e.NetworkLoadBalancer.loadBalancerArn\n\tif loadBalancerArn == \"\" {\n\t\treturn fmt.Errorf(\"load balancer not yet created (arn not set)\")\n\t}\n\n\tif a != nil {\n\t\t// TODO: Can we do better here?\n\t\tklog.Warningf(\"deleting ELB listener %q for required changes (%+v)\", a.listenerArn, changes)\n\n\t\t// delete the listener before recreating it\n\t\t_, err := t.Cloud.ELBV2().DeleteListener(ctx, &elbv2.DeleteListenerInput{\n\t\t\tListenerArn: &a.listenerArn,\n\t\t})\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"error deleting load balancer listener with arn=%q: %w\", e.listenerArn, err)\n\t\t}\n\t\ta = nil\n\t}\n\n\tif a == nil {\n\t\tif e.TargetGroup == nil {","sourceCodeStart":137,"sourceCodeEnd":173,"githubUrl":"https://github.com/kubernetes/kops/blob/4c8573c808a73d578c5eadc86d410646ea0b0d73/upup/pkg/fi/cloudup/awstasks/networkloadbalancerlistener.go#L137-L173","documentation":"During RenderAWS, the listener task reads e.NetworkLoadBalancer.loadBalancerArn; if the referenced NLB task has not been applied yet (its ARN is still empty), this error is returned. Listener creation depends on the NLB existing first in the same apply.","triggerScenarios":"RenderAWS ordering where the NetworkLoadBalancerListener runs before the NetworkLoadBalancer task has executed and populated loadBalancerArn; a failed NLB create earlier in the apply leaving the ARN empty.","commonSituations":"First-time cluster bring-up where NLB creation failed silently or was skipped; task dependency wiring broken so ordering isn't enforced; dry-run state reuse with incomplete NLB state.","solutions":["Ensure the NetworkLoadBalancer task ran successfully before the listener task (check earlier errors in the apply log)","Verify the listener task declares its dependency via e.NetworkLoadBalancer so fi ordering is enforced","Re-run kops update cluster once the NLB exists","If NLB creation failed, fix that root cause first — this error is secondary"],"exampleFix":"// before: listener missing dependency\n// (no NetworkLoadBalancer linked)\n// after\nlistener := &NetworkLoadBalancerListener{\n  NetworkLoadBalancer: nlbTask,\n  TargetGroup: tgTask,\n  Port: 443,\n}","handlingStrategy":"validation","validationCode":"if e.NetworkLoadBalancer == nil { return fi.RequiredField(\"NetworkLoadBalancer\") }\nif e.NetworkLoadBalancer.loadBalancerArn == \"\" {\n  return fmt.Errorf(\"run the NetworkLoadBalancer task first; arn not set\")\n}","typeGuard":null,"tryCatchPattern":"loadBalancerArn := e.NetworkLoadBalancer.loadBalancerArn\nif loadBalancerArn == \"\" {\n  return fmt.Errorf(\"load balancer not yet created (arn not set)\")\n}\n// fix the earlier NLB failure, then re-run apply","preventionTips":["Declare the NetworkLoadBalancer dependency on the listener task","Fix NLB creation errors before diagnosing listener errors","Avoid reusing partial dry-run state for real applies","Check apply logs top-down; this error is usually secondary"],"tags":["aws","elbv2","listener","task-ordering"],"backgroundTag":"load-balancer-arn-not-set","analyzedSha":"4c8573c808a73d578c5eadc86d410646ea0b0d73","analyzedAt":"2026-09-05T04:13:19.212Z","contentChangedAt":"2026-09-05T04:13:19.212Z","schemaVersion":2},"datasetVersion":"2026-09-12T07:17:12.445Z"}