{"record":{"id":"67346c38a86e2055","repo":"kubernetes/kops","slug":"nlb-has-more-then-one-privateipv4address-which-is","errorCode":null,"errorMessage":"NLB has more then one PrivateIPv4Address, which is unexpected. This is a bug in kOps, please open a GitHub issue.","messagePattern":"NLB has more then one PrivateIPv4Address, which is unexpected\\. This is a bug in kOps, please open a GitHub issue\\.","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"upup/pkg/fi/cloudup/awstasks/network_load_balancer.go","lineNumber":232,"sourceCode":"\tfor _, tag := range latest.Tags {\n\t\tk := aws.ToString(tag.Key)\n\t\tif strings.HasPrefix(k, \"aws:cloudformation:\") {\n\t\t\tcontinue\n\t\t}\n\t\tif k == awsup.KopsResourceRevisionTag {\n\t\t\tcontinue\n\t\t}\n\t\tactual.Tags[k] = aws.ToString(tag.Value)\n\t}\n\n\tfor _, az := range lb.AvailabilityZones {\n\t\tsm := &SubnetMapping{\n\t\t\tSubnet: &Subnet{ID: az.SubnetId},\n\t\t}\n\t\tfor _, a := range az.LoadBalancerAddresses {\n\t\t\tif a.PrivateIPv4Address != nil {\n\t\t\t\tif sm.PrivateIPv4Address != nil {\n\t\t\t\t\treturn nil, fmt.Errorf(\"NLB has more then one PrivateIPv4Address, which is unexpected. This is a bug in kOps, please open a GitHub issue.\")\n\t\t\t\t}\n\t\t\t\tsm.PrivateIPv4Address = a.PrivateIPv4Address\n\t\t\t}\n\t\t\tif a.AllocationId != nil {\n\t\t\t\tif sm.AllocationID != nil {\n\t\t\t\t\treturn nil, fmt.Errorf(\"NLB has more then one AllocationID per subnet, which is unexpected. This is a bug in kOps, please open a GitHub issue.\")\n\t\t\t\t}\n\t\t\t\tsm.AllocationID = a.AllocationId\n\t\t\t}\n\t\t}\n\t\tactual.SubnetMappings = append(actual.SubnetMappings, sm)\n\t}\n\n\tfor _, sg := range lb.SecurityGroups {\n\t\tactual.SecurityGroups = append(actual.SecurityGroups, &SecurityGroup{ID: aws.String(sg)})\n\t}\n\n\t{","sourceCodeStart":214,"sourceCodeEnd":250,"githubUrl":"https://github.com/kubernetes/kops/blob/4c8573c808a73d578c5eadc86d410646ea0b0d73/upup/pkg/fi/cloudup/awstasks/network_load_balancer.go#L214-L250","documentation":"While rebuilding NLB state in Find, kOps maps each availability zone to one SubnetMapping and expects at most one PrivateIPv4Address per subnet. If DescribeLoadBalancers returns multiple addresses with a private IPv4 for a single AZ, it reports this as a kOps bug and asks for a GitHub issue.","triggerScenarios":"An AZ's LoadBalancerAddresses contains two or more entries with non-nil PrivateIPv4Address during Find on an internal NLB with statically assigned private IPs.","commonSituations":"NLB modified outside kOps (manually added second address); AWS behavior change or unexpected API response shape; wrong load balancer discovered matching the cluster's name/tag.","solutions":["Verify the NLB's per-AZ addresses with aws elbv2 describe-load-balancers; remove unexpected manual changes","Confirm the discovered NLB actually belongs to this cluster (check tags/name)","If the API genuinely returned multiple private IPs for one subnet, file a GitHub issue with kops version and the NLB description output as the message instructs"],"exampleFix":null,"handlingStrategy":"type-guard","validationCode":"// verify NLB address shape before letting kops adopt it\nfor _, az := range lb.AvailabilityZones {\n    n := 0\n    for _, a := range az.LoadBalancerAddresses { if a.PrivateIPv4Address != nil { n++ } }\n    if n > 1 { return fmt.Errorf(\"NLB az %s has %d private IPs; fix externally first\", aws.ToString(az.SubnetId), n) }\n}","typeGuard":"func atMostOnePrivateIP(az elbv2types.AvailabilityZone) bool {\n    n := 0\n    for _, a := range az.LoadBalancerAddresses { if a.PrivateIPv4Address != nil { n++ } }\n    return n <= 1\n}","tryCatchPattern":null,"preventionTips":["Do not manually add addresses to kops-managed NLBs","Verify NLB tags/name to ensure the right LB is discovered","Report genuine API anomalies to kops GitHub as the message instructs"],"tags":["aws","nlb","find","invariant-violation"],"backgroundTag":"unexpected-aws-api-response","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"}