{"record":{"id":"b35c1fce2bfa3c57","repo":"cilium/cilium","slug":"local-node-has-not-been-initialized-yet-w","errorCode":null,"errorMessage":"local node has not been initialized yet: %w","messagePattern":"local node has not been initialized yet: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/fqdn/lookup/endpoint.go","lineNumber":48,"sourceCode":"\tLookupRegisteredEndpoint(endpointAddr netip.Addr) (endpoint *endpoint.Endpoint, isHost bool, err error)\n}\n\ntype proxyLookupHandler struct {\n\tipCache         *ipcache.IPCache\n\tlocalNodeStore  *node.LocalNodeStore\n\tendpointManager endpointmanager.EndpointManager\n}\n\nvar _ ProxyLookupHandler = &proxyLookupHandler{}\n\nfunc (p *proxyLookupHandler) LookupRegisteredEndpoint(endpointAddr netip.Addr) (endpoint *endpoint.Endpoint, isHost bool, err error) {\n\tif e := p.endpointManager.LookupIP(endpointAddr); e != nil {\n\t\treturn e, e.IsHost(), nil\n\t}\n\n\tlocalNode, err := p.localNodeStore.Get(context.Background())\n\tif err != nil {\n\t\treturn nil, true, fmt.Errorf(\"local node has not been initialized yet: %w\", err)\n\t}\n\n\tif localNode.IsNodeIP(endpointAddr) != \"\" {\n\t\tif e := p.endpointManager.GetHostEndpoint(); e != nil {\n\t\t\treturn e, true, nil\n\t\t} else {\n\t\t\treturn nil, true, errors.New(\"host endpoint has not been created yet\")\n\t\t}\n\t}\n\n\treturn nil, false, fmt.Errorf(\"cannot find endpoint with IP %s\", endpointAddr.String())\n}\n\nfunc (p *proxyLookupHandler) LookupSecIDByIP(ip netip.Addr) (secID ipcache.Identity, exists bool) {\n\treturn p.ipCache.LookupSecIDByIP(ip)\n}\n\nfunc (p *proxyLookupHandler) LookupByIdentity(nid identity.NumericIdentity) []string {","sourceCodeStart":30,"sourceCodeEnd":66,"githubUrl":"https://github.com/cilium/cilium/blob/ac7b90affa4baf0642e6685319d56907b3a73a6d/pkg/fqdn/lookup/endpoint.go#L30-L66","documentation":"LookupRegisteredEndpoint resolves an IP to a Cilium endpoint. Before doing a full lookup it fetches the local node from localNodeStore; if that store cannot yet produce a node (context wait failed/timed out), the whole lookup fails with this wrapped error. The second return value is true, indicating the caller may retry since this is a transient initialization condition.","triggerScenarios":"Calling LookupRegisteredEndpoint (used during FQDN/IP lookups in policy evaluation) before the local node has been registered in localNodeStore, or when the underlying Get context call errors (deadline, shutdown).","commonSituations":"Cilium agent still starting up while DNS requests or policy lookups arrive; agent restarting and local node not yet synced from cluster store; heavy load delaying node initialization.","solutions":["Retry the lookup after a short delay — the local node registers shortly after agent startup","Check agent logs for localNodeStore initialization errors or shutdown in progress","Wait for the agent to reach a ready/healthy state before sending traffic through it","Inspect the wrapped %w error for context deadline/cancellation causes"],"exampleFix":null,"handlingStrategy":"retry","validationCode":"// Only proceed once the agent is healthy/ready\n// e.g. wait for cilium 'ready' state before doing endpoint lookups","typeGuard":null,"tryCatchPattern":"ep, retryable, err := lookup.LookupRegisteredEndpoint(ip)\nif err != nil {\n    if retryable {\n        time.AfterFunc(200*time.Millisecond, func() { retryLookup(ip) })\n        return\n    }\n    log.Error(\"permanent lookup failure\", \"err\", err)\n}","preventionTips":["Gate traffic/lookups on agent readiness before startup completes","Distinguish retryable (second return value) from permanent errors","Retry with backoff for a bounded duration during agent startup"],"tags":["cilium","initialization","local-node","transient"],"backgroundTag":"local-node-not-initialized","analyzedSha":"ac7b90affa4baf0642e6685319d56907b3a73a6d","analyzedAt":"2026-08-31T18:27:15.868Z","schemaVersion":2},"datasetVersion":"2026-08-31T19:17:28.585Z"}