{"record":{"id":"535c6eb9747e3e9d","repo":"cilium/cilium","slug":"ipv6-allocation-disabled","errorCode":null,"errorMessage":"IPv6 allocation disabled","messagePattern":"IPv6 allocation disabled","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"pkg/ipam/allocator.go","lineNumber":31,"sourceCode":"\n\tipamOption \"github.com/cilium/cilium/pkg/ipam/option\"\n\t\"github.com/cilium/cilium/pkg/logging/logfields\"\n\t\"github.com/cilium/cilium/pkg/metrics\"\n\t\"github.com/cilium/cilium/pkg/time\"\n)\n\nconst (\n\tmetricAllocate = \"allocate\"\n\tmetricRelease  = \"release\"\n)\n\n// Error definitions\nvar (\n\t// ErrIPv4Disabled is returned when IPv4 allocation is disabled\n\tErrIPv4Disabled = errors.New(\"IPv4 allocation disabled\")\n\n\t// ErrIPv6Disabled is returned when Ipv6 allocation is disabled\n\tErrIPv6Disabled = errors.New(\"IPv6 allocation disabled\")\n)\n\nfunc (ipam *IPAM) determineIPAMPool(owner string, family Family) (Pool, error) {\n\tpool, err := ipam.metadata.GetIPPoolForPod(owner, family)\n\tif err != nil {\n\t\treturn \"\", fmt.Errorf(\"unable to determine IPAM pool for owner %q: %w\", owner, err)\n\t}\n\n\treturn Pool(pool), nil\n}\n\n// AllocateIP allocates an IP address.\nfunc (ipam *IPAM) AllocateIP(ip netip.Addr, owner string, pool Pool) error {\n\tneedSyncUpstream := true\n\t_, err := ipam.allocateIP(ip, owner, pool, needSyncUpstream)\n\treturn err\n}\n","sourceCodeStart":13,"sourceCodeEnd":49,"githubUrl":"https://github.com/cilium/cilium/blob/ac7b90affa4baf0642e6685319d56907b3a73a6d/pkg/ipam/allocator.go#L13-L49","documentation":"ErrIPv6Disabled is returned by the IPAM allocator when an IPv6 allocation or release is attempted while IPv6 allocation is disabled. It mirrors ErrIPv4Disabled for the IPv6 family.","triggerScenarios":"allocateIP or releaseIPLocked invoked with family IPv6 when IPAM has no IPv6 pool configured (e.g. --ipv6 not enabled or no IPv6 CIDR).","commonSituations":"Default single-stack IPv4 clusters where a workload or CNI plugin requests an IPv6 address; dual-stack flag missing at install time.","solutions":["Enable IPv6 (configure --ipv6 / IPv6 pod CIDR, dual-stack) if IPv6 addresses are needed","If IPv6 is intentionally off, restrict requests to the IPv4 family","Handle ErrIPv6Disabled explicitly so pod allocation falls back to IPv4 instead of erroring"],"exampleFix":"// before\nip, err := ipam.AllocateNext(IPv6) // ErrIPv6Disabled on ipv4-only node\n// after\nif errors.Is(err, ErrIPv6Disabled) {\n    ip, err = ipam.AllocateNext(IPv4)\n}","handlingStrategy":"type-guard","validationCode":"if !ipamConfig.IPv6Enabled && family == ipam.IPv6 {\n    // skip IPv6 request entirely\n}","typeGuard":"func isIPv6Disabled(err error) bool { return errors.Is(err, ipam.ErrIPv6Disabled) }","tryCatchPattern":"ip, err := ipam.AllocateNext(fam)\nif errors.Is(err, ipam.ErrIPv6Disabled) {\n    // feature off: fall back to IPv4 or skip cleanly\n}","preventionTips":["Only request IPv6 when --ipv6/dual-stack is enabled at install","Verify CNI requests match the cluster's IP families","Handle ErrIPv6Disabled explicitly in allocation loops to avoid pod setup failures"],"tags":["ipam","ipv6","configuration"],"backgroundTag":"allocation-disabled","analyzedSha":"ac7b90affa4baf0642e6685319d56907b3a73a6d","analyzedAt":"2026-08-31T18:27:15.868Z","schemaVersion":2},"datasetVersion":"2026-08-31T19:17:28.585Z"}