{"record":{"id":"d1e28ce03181b10f","repo":"slackhq/nebula","slug":"failed-to-open-udp-socket-w","errorCode":null,"errorMessage":"failed to open udp socket: %w","messagePattern":"failed to open udp socket: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"udp/udp_darwin.go","lineNumber":42,"sourceCode":"\tsysFd uintptr\n\tl     *slog.Logger\n}\n\nvar _ Conn = &StdConn{}\n\nfunc NewListener(l *slog.Logger, s Settings) (Conn, error) {\n\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","sourceCodeStart":24,"sourceCodeEnd":60,"githubUrl":"https://github.com/slackhq/nebula/blob/dd8f660c0ac37903ec4080ca4d3c861ba9342ceb/udp/udp_darwin.go#L24-L60","documentation":"Wrapping error in the Darwin UDP listener: uc.SyscallConn() failed on an already-listening net.UDPConn, so the raw fd needed for sendmmsg/recvmmsg-style control could not be obtained. Rare plumbing failure between netpoll and syscall; cause preserved with %w.","triggerScenarios":"Thrown at udp/udp_darwin.go:42 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Retry creating the listener","Report with Go version and macOS version if persistent — likely a runtime/netpoll issue","Close and reopen the socket if fd exhaustion is suspected"],"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"}