{"record":{"id":"9f0a126deafb4fb0","repo":"kubernetes/kops","slug":"error-creating-nlb-q-w","errorCode":null,"errorMessage":"error creating NLB %q: %w","messagePattern":"error creating NLB %q: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"upup/pkg/fi/cloudup/awstasks/network_load_balancer.go","lineNumber":526,"sourceCode":"\t\t\trequest.Tags = awsup.ELBv2Tags(tags)\n\n\t\t\tfor _, subnetMapping := range e.SubnetMappings {\n\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},","sourceCodeStart":508,"sourceCodeEnd":544,"githubUrl":"https://github.com/kubernetes/kops/blob/4c8573c808a73d578c5eadc86d410646ea0b0d73/upup/pkg/fi/cloudup/awstasks/network_load_balancer.go#L508-L544","documentation":"CreateLoadBalancer failed while creating the NLB — the wrapped AWS error typically indicates a bad subnet/security-group/AllocationId combination, a name conflict, or missing elasticloadbalancing:CreateLoadBalancer permission.","triggerScenarios":"Thrown at upup/pkg/fi/cloudup/awstasks/network_load_balancer.go:526 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Read the wrapped AWS error: fix subnet ids, security groups, or the ElasticIP allocation","Check IAM permissions for ELBV2 creation","Delete a leftover NLB of the same name if it conflicts"],"exampleFix":null,"handlingStrategy":"try-catch","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"}