{"record":{"id":"59577b76c0034faf","repo":"slackhq/nebula","slug":"localaddr-returned-invalid-ip-address-s-59577b","errorCode":null,"errorMessage":"LocalAddr returned invalid IP address: %s","messagePattern":"LocalAddr returned invalid IP address: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"udp/udp_generic.go","lineNumber":67,"sourceCode":"\twritten := 0\n\tfor i, b := range bufs {\n\t\tif _, err := u.UDPConn.WriteToUDPAddrPort(b, addrs[i]); err == nil {\n\t\t\twritten++\n\t\t} else {\n\t\t\tu.l.Debug(\"failed to write packet in batch\", \"udpAddr\", addrs[i], \"error\", err)\n\t\t}\n\t}\n\treturn written, nil\n}\n\nfunc (u *GenericConn) LocalAddr() (netip.AddrPort, error) {\n\ta := u.UDPConn.LocalAddr()\n\n\tswitch v := a.(type) {\n\tcase *net.UDPAddr:\n\t\taddr, ok := netip.AddrFromSlice(v.IP)\n\t\tif !ok {\n\t\t\treturn netip.AddrPort{}, fmt.Errorf(\"LocalAddr returned invalid IP address: %s\", v.IP)\n\t\t}\n\t\treturn netip.AddrPortFrom(addr, uint16(v.Port)), nil\n\n\tdefault:\n\t\treturn netip.AddrPort{}, fmt.Errorf(\"LocalAddr returned: %#v\", a)\n\t}\n}\n\nfunc (u *GenericConn) ReloadConfig(c *config.C) {\n\n}\n\nfunc NewUDPStatsEmitter(udpConns []Conn) func() {\n\t// No UDP stats for non-linux\n\treturn func() {}\n}\n\ntype rawMessage struct {","sourceCodeStart":49,"sourceCodeEnd":85,"githubUrl":"https://github.com/slackhq/nebula/blob/dd8f660c0ac37903ec4080ca4d3c861ba9342ceb/udp/udp_generic.go#L49-L85","documentation":"Type-guard failure in GenericConn.LocalAddr: the local address's IP slice failed netip.AddrFromSlice conversion (invalid length), so it cannot become a netip.AddrPort. Indicates corrupt address data from the runtime rather than user error.","triggerScenarios":"Thrown at udp/udp_generic.go:67 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["netip.AddrFromSlice failed on the UDPAddr.IP, which is nil or not 4/16 bytes — usually means the socket is bound to an invalid or unspecified address; set a concrete valid listen.host in the nebula config","Check for inherited/activated sockets (systemd, container) with no bound address; bind explicitly instead","Restart nebula after fixing the listen address; the local address is resolved once during NewListener via LocalAddr","If persistent across valid configs, report with Go version — this would indicate unexpected *net.UDPAddr behavior"],"exampleFix":null,"handlingStrategy":"type-guard","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"dd8f660c0ac37903ec4080ca4d3c861ba9342ceb","analyzedAt":"2026-09-03T11:13:55.444Z","contentChangedAt":"2026-09-03T11:13:55.444Z","schemaVersion":2},"datasetVersion":"2026-09-10T17:17:09.494Z"}