{"record":{"id":"c0bb3942d5c7ef85","repo":"cilium/cilium","slug":"setting-forwardable-ips-for-node-s-w","errorCode":null,"errorMessage":"setting forwardable IPs for node %s: %w","messagePattern":"setting forwardable IPs for node (.+?): %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/node/neighbordiscovery/node_neighbor_discovery.go","lineNumber":156,"sourceCode":"\n\t\ttxn = o.db.ReadTxn()\n\t}\n}\n\nfunc (o *nodeNeighborObserver) apply(change statedb.Change[*node.Node]) error {\n\tn := change.Object\n\tid := n.Identity()\n\tips := nodeIPs(n)\n\tif change.Deleted || n.Local != nil {\n\t\tips = nil\n\t}\n\n\towner := neighbor.ForwardableIPOwner{\n\t\tType: neighbor.ForwardableIPOwnerNode,\n\t\tID:   id.String(),\n\t}\n\tif err := o.forwardableIPManager.Set(owner, maps.Keys(ips)); err != nil {\n\t\treturn fmt.Errorf(\"setting forwardable IPs for node %s: %w\", id, err)\n\t}\n\treturn nil\n}\n\nfunc nodeIPs(n *node.Node) map[netip.Addr]struct{} {\n\tips := map[netip.Addr]struct{}{}\n\tfor _, ipv6 := range []bool{false, true} {\n\t\tif ip, ok := netip.AddrFromSlice(n.GetNodeIP(ipv6)); ok {\n\t\t\tips[ip.Unmap()] = struct{}{}\n\t\t}\n\t}\n\treturn ips\n}\n\nfunc (o *nodeNeighborObserver) NodeConfigurationChanged(config.Config) error {\n\to.configInitOnce.Do(func() { close(o.configInitialized) })\n\treturn nil\n}","sourceCodeStart":138,"sourceCodeEnd":174,"githubUrl":"https://github.com/cilium/cilium/blob/ac7b90affa4baf0642e6685319d56907b3a73a6d/pkg/node/neighbordiscovery/node_neighbor_discovery.go#L138-L174","documentation":"This error wraps a failure from ForwardableIPManager.Set when the node neighbor discovery module tries to register a node's forwardable IP addresses (used for L2 neighbor discovery) under an owner identified by the node ID. The %w wrapping preserves the underlying cause (e.g. the Set call failing to program or record the IP set). It is raised in the observer's apply step, invoked from its run job loop when node table changes are processed.","triggerScenarios":"The statedb node table emits an upsert/change for a node; apply() constructs a ForwardableIPOwner{Type: ForwardableIPOwnerNode, ID: id.String()} and calls forwardableIPManager.Set(owner, maps.Keys(ips)), which returns a non-nil error (e.g. neighbor map programming failure in the datapath, invalid/zero IP addresses, or internal state errors).","commonSituations":"Nodes with no usable or malformed IPs entering the node table; kernel/netlink failures while refreshing neighbor entries; races or shutdown in progress when the manager processes updates; L2 neighbor discovery enabled in environments where the datapath cannot program forwardable IPs.","solutions":["Inspect the wrapped (%v / errors.Unwrap) inner error in the agent logs to identify the actual Set failure.","Verify the node's IPs (nodeIPs(n)) are valid, non-zero netip.Addr values before they reach the node table.","Check that L2 neighbor discovery is supported/functional on the host kernel; disable it if the datapath cannot program neighbor entries.","Restart the agent so the node-neighbor-discovery job re-runs apply with fresh state; check for stale neighbor state."],"exampleFix":"// before\nif err := o.forwardableIPManager.Set(owner, maps.Keys(ips)); err != nil {\n    return fmt.Errorf(\"setting forwardable IPs for node %s: %w\", id, err)\n}\n// after\nips := nodeIPs(n)\nif len(ips) == 0 {\n    o.Logger.Warn(\"node has no forwardable IPs, skipping\", \"node\", id)\n    return nil\n}\nif err := o.forwardableIPManager.Set(owner, maps.Keys(ips)); err != nil {\n    return fmt.Errorf(\"setting forwardable IPs for node %s: %w\", id, err)\n}","handlingStrategy":"try-catch","validationCode":"ips := nodeIPs(n)\nif len(ips) == 0 {\n    return nil // skip Set for nodes with no forwardable IPs\n}","typeGuard":"func hasValidIPs(ips map[netip.Addr]struct{}) bool {\n    for a := range ips {\n        if a.IsValid() && !a.IsUnspecified() {\n            return true\n        }\n    }\n    return false\n}","tryCatchPattern":"if err := o.forwardableIPManager.Set(owner, maps.Keys(ips)); err != nil {\n    return fmt.Errorf(\"setting forwardable IPs for node %s: %w\", id, err)\n}\n// caller: log with errors.Unwrap(err) details and continue the observer loop instead of crashing the job","preventionTips":["Validate node IPs before they enter the node table.","Monitor agent logs for netlink/neighbor programming failures.","Keep the host kernel up to date for neighbor-discovery support.","Test node churn (add/remove) in CI with L2 discovery enabled."],"tags":["go","network","neighbor-discovery","netlink"],"backgroundTag":"forwardable-ip-programming-failed","analyzedSha":"ac7b90affa4baf0642e6685319d56907b3a73a6d","analyzedAt":"2026-08-31T18:27:15.868Z","schemaVersion":2},"datasetVersion":"2026-08-31T19:17:28.585Z"}