{"record":{"id":"1e517a1680687003","repo":"cilium/cilium","slug":"pod-doesn-t-have-hostip-of-family-s","errorCode":null,"errorMessage":"pod doesn't have HostIP of family %s","messagePattern":"pod doesn't have HostIP of family (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cilium-cli/connectivity/check/context.go","lineNumber":1460,"sourceCode":"\t\tct.params.MultiCluster == \"\"\n}\n\nfunc (ct *ConnectivityTest) IsSocketLBFull() bool {\n\tsocketLBEnabled, _ := ct.Features.MatchRequirements(features.RequireEnabled(features.KPRSocketLB))\n\tif socketLBEnabled {\n\t\tsocketLBHostnsOnly, _ := ct.Features.MatchRequirements(features.RequireEnabled(features.KPRSocketLBHostnsOnly))\n\t\treturn !socketLBHostnsOnly\n\t}\n\treturn false\n}\n\nfunc (ct *ConnectivityTest) GetPodHostIPByFamily(pod Pod, ipFam features.IPFamily) (string, error) {\n\tfor _, addr := range pod.Pod.Status.HostIPs {\n\t\tif features.GetIPFamily(addr.IP) == ipFam {\n\t\t\treturn addr.IP, nil\n\t\t}\n\t}\n\treturn \"\", fmt.Errorf(\"pod doesn't have HostIP of family %s\", ipFam)\n}\n","sourceCodeStart":1442,"sourceCodeEnd":1462,"githubUrl":"https://github.com/cilium/cilium/blob/ac7b90affa4baf0642e6685319d56907b3a73a6d/cilium-cli/connectivity/check/context.go#L1442-L1462","documentation":"GetPodHostIPByFamily scans pod.Status.HostIPs looking for an address whose family matches the requested IPFamily (IPv4 or IPv6). If no HostIP entry matches, the helper returns this error. It is thrown when a pod simply has no host IP of the requested family, typically because the node/cluster is single-stack.","triggerScenarios":"Requesting features.IPFamilyIPv6 for a pod on an IPv4-only node (or vice versa); a pod not yet scheduled/running so Status.HostIPs is empty; kubelet configured without the requested dual-stack IPFamily.","commonSituations":"Running connectivity tests with --ip-family ipv6 against a cluster that was never provisioned for IPv6 (no dual-stack kube-apiserver/kubelet, no IPv6 pod CIDR); test pods still Pending so no host IPs are assigned yet.","solutions":["Verify the cluster/node actually supports the requested family: kubectl get node -o jsonpath='{.items[*].status.addresses}' and check for the matching address type.","Wait for the pod to be Running before resolving its HostIP (pods that are Pending have no HostIPs).","Run the test with an IP family the cluster supports (e.g. dual-stack cluster for ipv6 tests), or enable dual-stack on kubelet/kube-apiserver."],"exampleFix":"// before: request IPv6 on a single-stack cluster\nhostIP, err := ct.GetPodHostIPByFamily(pod, features.IPFamilyIPv6)\n// after: only request IPv6 when the cluster has the family\nif ct.Features().IPFamilyModes[features.IPFamilyIPv6] {\n    hostIP, err = ct.GetPodHostIPByFamily(pod, features.IPFamilyIPv6)\n}","handlingStrategy":"validation","validationCode":"// ensure cluster supports the family before requesting host IPs\nif ipFam == features.IPFamilyIPv6 && !ct.Features().IPFamilyModes[features.IPFamilyIPv6] {\n    return errors.New(\"cluster has no IPv6 support; skip IPv6 host IP lookup\")\n}\nif pod.Pod.Status.Phase != v1.PodRunning || len(pod.Pod.Status.HostIPs) == 0 {\n    return errors.New(\"pod not running; no HostIPs assigned yet\")\n}","typeGuard":null,"tryCatchPattern":"hostIP, err := ct.GetPodHostIPByFamily(pod, ipFam)\nif err != nil {\n    if strings.HasPrefix(err.Error(), \"pod doesn't have HostIP of family\") {\n        hostIP, err = ct.GetPodHostIPByFamily(pod, features.IPFamilyV4) // fallback family\n    }\n    if err != nil { return err }\n}","preventionTips":["Provision dual-stack clusters when testing IPv6 paths (dual-stack kubelet + pod CIDRs).","Only resolve HostIPs after pods reach Running state.","Match the test suite's --ip-family flag to the cluster's actual IP family mode.","Verify node .status.addresses contains the requested family before scheduling tests."],"tags":["kubernetes","networking","dual-stack","ipv6"],"backgroundTag":"ip-family-mismatch","analyzedSha":"ac7b90affa4baf0642e6685319d56907b3a73a6d","analyzedAt":"2026-08-31T18:27:15.868Z","schemaVersion":2},"datasetVersion":"2026-08-31T22:30:34.772Z"}