{"record":{"id":"6957d38df28067f9","repo":"cilium/cilium","slug":"unable-to-initialize-ipv6-allocator-w","errorCode":null,"errorMessage":"unable to initialize IPv6 allocator: %w","messagePattern":"unable to initialize IPv6 allocator: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"critical","filePath":"operator/pkg/ipam/allocator/clusterpool/clusterpool.go","lineNumber":68,"sourceCode":"\t\t}\n\n\t\tv4Allocators, err := cidralloc.NewCIDRSets(false, a.ClusterPoolIPv4CIDR, a.ClusterPoolIPv4MaskSize)\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"unable to initialize IPv4 allocator: %w\", err)\n\t\t}\n\t\ta.v4CIDRSet = v4Allocators\n\t} else if len(a.ClusterPoolIPv4CIDR) != 0 {\n\t\treturn fmt.Errorf(\"cluster-pool-ipv4-cidr must not be set if IPv4 is disabled\")\n\t}\n\n\tif option.Config.EnableIPv6 {\n\t\tif len(a.ClusterPoolIPv6CIDR) == 0 {\n\t\t\treturn fmt.Errorf(\"cluster-pool-ipv6-cidr must be provided when using ClusterPool\")\n\t\t}\n\n\t\tv6Allocators, err := cidralloc.NewCIDRSets(true, a.ClusterPoolIPv6CIDR, a.ClusterPoolIPv6MaskSize)\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"unable to initialize IPv6 allocator: %w\", err)\n\t\t}\n\t\ta.v6CIDRSet = v6Allocators\n\t} else if len(a.ClusterPoolIPv6CIDR) != 0 {\n\t\treturn fmt.Errorf(\"cluster-pool-ipv6-cidr must not be set if IPv6 is disabled\")\n\t}\n\n\treturn nil\n}\n\n// Start kicks off Operator allocation.\nfunc (a *AllocatorOperator) Start(ctx context.Context, updater allocator.CiliumNodeGetterUpdater, iMetrics trigger.MetricsObserver) (allocator.NodeEventHandler, error) {\n\ta.logger.Info(\n\t\t\"Starting ClusterPool IP allocator\",\n\t\tlogfields.IPv4CIDRs, a.ClusterPoolIPv4CIDR,\n\t\tlogfields.IPv6CIDRs, a.ClusterPoolIPv6CIDR,\n\t)\n\n\tnodeManager := podcidr.NewNodesPodCIDRManager(a.logger, a.v4CIDRSet, a.v6CIDRSet, updater, iMetrics)","sourceCodeStart":50,"sourceCodeEnd":86,"githubUrl":"https://github.com/cilium/cilium/blob/ac7b90affa4baf0642e6685319d56907b3a73a6d/operator/pkg/ipam/allocator/clusterpool/clusterpool.go#L50-L86","documentation":"In AllocatorOperator.Init, an error returned by cidralloc.NewCIDRSets(true, ClusterPoolIPv6CIDR, ClusterPoolIPv6MaskSize) is wrapped as 'unable to initialize IPv6 allocator'. It indicates the configured IPv6 CIDR list or mask size could not be parsed or is invalid, preventing IPv6 pool allocation setup.","triggerScenarios":"Init passes an invalid ClusterPoolIPv6CIDR (bad CIDR syntax) or invalid ClusterPoolIPv6MaskSize to cidralloc.NewCIDRSets with isV6=true, and the returned error is wrapped.","commonSituations":"Malformed IPv6 prefix (missing /prefixlen, wrong address); mask size larger than prefix allows or beyond 128 bits; Helm templating producing empty or double-comma list entries.","solutions":["Read the wrapped cause in the operator log to identify the offending CIDR","Fix the --cluster-pool-ipv6-cidr entries to valid IPv6 CIDRs (e.g. 2001:db8::/56)","Set a valid --cluster-pool-ipv6-mask-size (commonly 116) consistent with the prefix"],"exampleFix":"// before\n--cluster-pool-ipv6-cidr=2001:db8::\n// after\n--cluster-pool-ipv6-cidr=2001:db8::/56","handlingStrategy":"validation","validationCode":"for _, c := range strings.Split(cfg.ClusterPoolIPv6CIDR, \",\") {\n    ip := net.ParseIP(strings.TrimSpace(c))\n    if ip == nil || ip.To4() != nil || !strings.Contains(c, \"/\") {\n        return fmt.Errorf(\"invalid IPv6 CIDR %q\", c)\n    }\n}\nif cfg.ClusterPoolIPv6MaskSize <= 0 || cfg.ClusterPoolIPv6MaskSize > 128 {\n    return fmt.Errorf(\"invalid cluster-pool-ipv6-mask-size %d\", cfg.ClusterPoolIPv6MaskSize)\n}","typeGuard":null,"tryCatchPattern":"if err := alloc.Init(ctx, logger); err != nil {\n    if strings.Contains(err.Error(), \"unable to initialize IPv6 allocator\") {\n        logger.Error(\"bad IPv6 CIDR/mask config; check --cluster-pool-ipv6-cidr and --cluster-pool-ipv6-mask-size\", \"err\", err)\n    }\n    return err\n}","preventionTips":["Use full IPv6 prefixes with explicit prefix length (e.g. 2001:db8::/56)","Verify mask size leaves enough per-node prefixes (commonly 116)","Sanity-check Helm list values for empty or malformed entries"],"tags":["cilium","ipam","ipv6","cidr"],"backgroundTag":"invalid-cidr-notation","analyzedSha":"ac7b90affa4baf0642e6685319d56907b3a73a6d","analyzedAt":"2026-08-31T18:27:15.868Z","schemaVersion":2},"datasetVersion":"2026-08-31T19:17:28.585Z"}