{"record":{"id":"963312e55acdd248","repo":"slackhq/nebula","slug":"failed-to-get-udp-fd-w","errorCode":null,"errorMessage":"failed to get udp fd: %w","messagePattern":"failed to get udp fd: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"udp/udp_darwin.go","lineNumber":49,"sourceCode":"\tlc := NewListenConfig(s.Multi)\n\tpc, err := lc.ListenPacket(context.TODO(), \"udp\", s.Listen.String())\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tif uc, ok := pc.(*net.UDPConn); ok {\n\t\tc := &StdConn{UDPConn: uc, l: l}\n\n\t\trc, err := uc.SyscallConn()\n\t\tif err != nil {\n\t\t\treturn nil, fmt.Errorf(\"failed to open udp socket: %w\", err)\n\t\t}\n\n\t\terr = rc.Control(func(fd uintptr) {\n\t\t\tc.sysFd = fd\n\t\t})\n\t\tif err != nil {\n\t\t\treturn nil, fmt.Errorf(\"failed to get udp fd: %w\", err)\n\t\t}\n\n\t\tla, err := c.LocalAddr()\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tc.isV4 = la.Addr().Is4()\n\n\t\treturn c, nil\n\t}\n\n\treturn nil, fmt.Errorf(\"unexpected PacketConn: %T %#v\", pc, pc)\n}\n\nfunc NewListenConfig(multi bool) net.ListenConfig {\n\treturn net.ListenConfig{\n\t\tControl: func(network, address string, c syscall.RawConn) error {\n\t\t\tif multi {","sourceCodeStart":31,"sourceCodeEnd":67,"githubUrl":"https://github.com/slackhq/nebula/blob/dd8f660c0ac37903ec4080ca4d3c861ba9342ceb/udp/udp_darwin.go#L31-L67","documentation":"Wrapping error in the Darwin UDP listener: rc.Control, which runs the closure capturing the socket fd into StdConn.sysFd, returned an error. Without the cached fd the connection cannot operate, so listener creation aborts; underlying error preserved with %w.","triggerScenarios":"Thrown at udp/udp_darwin.go:49 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Retry listener creation","Check the wrapped errno for the real cause (fd/closing race)","Report if reproducible — indicates a runtime-level Control failure"],"exampleFix":null,"handlingStrategy":"retry","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"}