{"record":{"id":"bf63fd5d37f546da","repo":"kubernetes/kops","slug":"failed-to-find-load-balancer-q-private-address","errorCode":null,"errorMessage":"failed to find load-balancer %q private address","messagePattern":"failed to find load-balancer %q private address","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"upup/pkg/fi/cloudup/hetznertasks/loadbalancer.go","lineNumber":95,"sourceCode":"\tcloud := c.T.Cloud.(hetzner.HetznerCloud)\n\tclient := cloud.LoadBalancerClient()\n\n\t// TODO(hakman): Find using label selector\n\tloadbalancers, err := client.All(ctx)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tfor _, loadbalancer := range loadbalancers {\n\t\tif loadbalancer.Name == fi.ValueOf(v.Name) {\n\t\t\tvar addresses []string\n\t\t\tif loadbalancer.PublicNet.IPv4.IP == nil {\n\t\t\t\treturn nil, fmt.Errorf(\"failed to find load-balancer %q public address\", fi.ValueOf(v.Name))\n\t\t\t}\n\t\t\taddresses = append(addresses, loadbalancer.PublicNet.IPv4.IP.String())\n\t\t\tfor _, privateNetwork := range loadbalancer.PrivateNet {\n\t\t\t\tif privateNetwork.IP == nil {\n\t\t\t\t\treturn nil, fmt.Errorf(\"failed to find load-balancer %q private address\", fi.ValueOf(v.Name))\n\t\t\t\t}\n\t\t\t\taddresses = append(addresses, privateNetwork.IP.String())\n\t\t\t}\n\t\t\treturn addresses, nil\n\t\t}\n\t}\n\n\treturn nil, nil\n}\n\nfunc (v *LoadBalancer) Find(c *fi.CloudupContext) (*LoadBalancer, error) {\n\tctx := context.TODO()\n\tcloud := c.T.Cloud.(hetzner.HetznerCloud)\n\tclient := cloud.LoadBalancerClient()\n\n\t// TODO(hakman): Find using label selector\n\tloadbalancers, err := client.All(ctx)\n\tif err != nil {","sourceCodeStart":77,"sourceCodeEnd":113,"githubUrl":"https://github.com/kubernetes/kops/blob/4c8573c808a73d578c5eadc86d410646ea0b0d73/upup/pkg/fi/cloudup/hetznertasks/loadbalancer.go#L77-L113","documentation":"In the same FindAddresses loop, for every private network attachment (loadbalancer.PrivateNet) the task requires a non-nil IP. This error is thrown when the load balancer is attached to a Hetzner network but the API reports nil for the attachment's IP, i.e., the attachment exists without an assigned private address.","triggerScenarios":"The load balancer has an entry in PrivateNet whose IP is nil — the LB was attached to a network but IP assignment failed or is still in progress, or the network was detached/reattached leaving a stale entry.","commonSituations":"Load balancer network attachment still provisioning during a kops apply; manual hcloud network attach without IP assignment; race where FindAddresses runs immediately after creating/attaching the LB network.","solutions":["Retry kops apply once the network-attach action completes; confirm in the Hetzner console that the LB shows an IP in the attached network.","Detach and re-attach the load balancer to the Hetzner network (hcloud load-balancer detach-network / attach-network) to force a fresh IP assignment.","Verify the subnet in the Hetzner network has free IPs and is not misconfigured (overlapping CIDRs can prevent assignment)."],"exampleFix":null,"handlingStrategy":"retry","validationCode":"lb, _, err := client.Get(ctx, lbName)\nif err != nil {\n    return err\n}\nfor _, pn := range lb.PrivateNet {\n    if pn.IP == nil {\n        return fmt.Errorf(\"network %d attachment on %s has no IP yet; retry after attach completes\", pn.Network.ID, lbName)\n    }\n}","typeGuard":"func allPrivateIPsAssigned(lb *hcloud.LoadBalancer) bool {\n    for _, pn := range lb.PrivateNet {\n        if pn.IP == nil { return false }\n    }\n    return true\n}","tryCatchPattern":"err := retry.Do(func() error {\n    addrs, err := task.FindAddresses(ctx)\n    if err != nil && strings.Contains(err.Error(), \"private address\") {\n        return retry.Temporary(err) // IP not yet assigned; back off and retry\n    }\n    return err\n})","preventionTips":["Wait for network-attach actions to finish before calling FindAddresses","Ensure the Hetzner network subnet has free IPs and no overlapping CIDRs","Avoid manually detaching/reattaching LB networks during kops applies"],"tags":["hetzner","loadbalancer","networking","private-network"],"backgroundTag":"missing-private-ip","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"}