{"record":{"id":"dc3f892aaa9cfd41","repo":"kubernetes/kops","slug":"error-creating-nlb-q-found-d","errorCode":null,"errorMessage":"error creating NLB %q: found %d","messagePattern":"error creating NLB %q: found (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"upup/pkg/fi/cloudup/awstasks/network_load_balancer.go","lineNumber":529,"sourceCode":"\t\t\t\trequest.SubnetMappings = append(request.SubnetMappings, elbv2types.SubnetMapping{\n\t\t\t\t\tSubnetId:           subnetMapping.Subnet.ID,\n\t\t\t\t\tAllocationId:       subnetMapping.AllocationID,\n\t\t\t\t\tPrivateIPv4Address: subnetMapping.PrivateIPv4Address,\n\t\t\t\t})\n\t\t\t}\n\n\t\t\tfor _, sg := range e.SecurityGroups {\n\t\t\t\trequest.SecurityGroups = append(request.SecurityGroups, aws.ToString(sg.ID))\n\t\t\t}\n\n\t\t\tklog.V(2).Infof(\"Creating NLB %q\", loadBalancerName)\n\n\t\t\tresponse, err := t.Cloud.ELBV2().CreateLoadBalancer(ctx, request)\n\t\t\tif err != nil {\n\t\t\t\treturn fmt.Errorf(\"error creating NLB %q: %w\", loadBalancerName, err)\n\t\t\t}\n\t\t\tif len(response.LoadBalancers) != 1 {\n\t\t\t\treturn fmt.Errorf(\"error creating NLB %q: found %d\", loadBalancerName, len(response.LoadBalancers))\n\t\t\t}\n\n\t\t\tlb := response.LoadBalancers[0]\n\t\t\te.DNSName = lb.DNSName\n\t\t\te.HostedZoneId = lb.CanonicalHostedZoneId\n\t\t\te.VPC = &VPC{ID: lb.VpcId}\n\t\t\tloadBalancerArn = aws.ToString(lb.LoadBalancerArn)\n\t\t\te.loadBalancerArn = loadBalancerArn\n\t\t\te.revision = revision\n\t\t}\n\n\t\tif e.waitForLoadBalancerReady {\n\t\t\tklog.Infof(\"Waiting for load balancer %q to be created...\", loadBalancerName)\n\t\t\trequest := &elbv2.DescribeLoadBalancersInput{\n\t\t\t\tNames: []string{loadBalancerName},\n\t\t\t}\n\n\t\t\terr := elbv2.NewLoadBalancerAvailableWaiter(t.Cloud.ELBV2()).Wait(ctx, request, 15*time.Minute)","sourceCodeStart":511,"sourceCodeEnd":547,"githubUrl":"https://github.com/kubernetes/kops/blob/4c8573c808a73d578c5eadc86d410646ea0b0d73/upup/pkg/fi/cloudup/awstasks/network_load_balancer.go#L511-L547","documentation":"CreateLoadBalancer returned success but the response did not contain exactly one load balancer, so kOps cannot determine which NLB was created; treated as an invariant violation of the AWS API response rather than a user error.","triggerScenarios":"Thrown at upup/pkg/fi/cloudup/awstasks/network_load_balancer.go:529 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Retry the operation — this reflects an unexpected AWS API response","Open a kOps GitHub issue if it reproduces"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"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"}