{"record":{"id":"a4f7be7d8a0fea39","repo":"slackhq/nebula","slug":"localaddr-returned-v","errorCode":null,"errorMessage":"LocalAddr returned: %#v","messagePattern":"LocalAddr returned: %#v","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"udp/udp_darwin.go","lineNumber":171,"sourceCode":"\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 *StdConn) 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 *StdConn) ReloadConfig(c *config.C) {\n\t// TODO\n}\n\nfunc NewUDPStatsEmitter(udpConns []Conn) func() {\n\t// No UDP stats for non-linux\n\treturn func() {}\n}\n\nfunc (u *StdConn) ListenOut(r EncReader, flush func()) error {\n\tbuffer := make([]byte, MTU)\n\n\tfor {\n\t\t// Just read one packet at a time\n\t\tn, rua, err := u.ReadFromUDPAddrPort(buffer)","sourceCodeStart":153,"sourceCodeEnd":189,"githubUrl":"https://github.com/slackhq/nebula/blob/dd8f660c0ac37903ec4080ca4d3c861ba9342ceb/udp/udp_darwin.go#L153-L189","documentation":"Type-guard failure in Darwin StdConn.LocalAddr: the value returned by UDPConn.LocalAddr() was not a *net.UDPAddr (its Go representation is printed with %#v), so the address cannot be converted to netip.AddrPort. Unexpected runtime state; not reachable on a normal UDP socket.","triggerScenarios":"Thrown at udp/udp_darwin.go:171 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Defensive default-case error: UDPConn.LocalAddr returned a type other than *net.UDPAddr, which should not happen for a standard UDP socket — update Go/nebula if the net package behavior changed","Check that no wrapper or proxy type is substituting the underlying UDPConn on this platform","Capture the %#v detail in the error; it shows the actual dynamic type and value returned and should be included in a bug report","Reconfigure the listener with an explicit, valid UDP listen address and retry"],"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"}