{"record":{"id":"e6088850aa3bc84b","repo":"slackhq/nebula","slug":"so-reuseport-failed-v-e60888","errorCode":null,"errorMessage":"SO_REUSEPORT failed: %v","messagePattern":"SO_REUSEPORT failed: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"udp/udp_bsd.go","lineNumber":29,"sourceCode":"\t\"log/slog\"\n\t\"net\"\n\t\"syscall\"\n\n\t\"golang.org/x/sys/unix\"\n)\n\nfunc NewListener(l *slog.Logger, s Settings) (Conn, error) {\n\treturn NewGenericListener(l, s)\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 {\n\t\t\t\tvar controlErr error\n\t\t\t\terr := c.Control(func(fd uintptr) {\n\t\t\t\t\tif err := syscall.SetsockoptInt(int(fd), syscall.SOL_SOCKET, unix.SO_REUSEPORT, 1); err != nil {\n\t\t\t\t\t\tcontrolErr = fmt.Errorf(\"SO_REUSEPORT failed: %v\", err)\n\t\t\t\t\t\treturn\n\t\t\t\t\t}\n\t\t\t\t})\n\t\t\t\tif err != nil {\n\t\t\t\t\treturn err\n\t\t\t\t}\n\t\t\t\tif controlErr != nil {\n\t\t\t\t\treturn controlErr\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn nil\n\t\t},\n\t}\n}\n\nfunc (u *GenericConn) Rebind() error {\n\treturn nil\n}","sourceCodeStart":11,"sourceCodeEnd":47,"githubUrl":"https://github.com/slackhq/nebula/blob/dd8f660c0ac37903ec4080ca4d3c861ba9342ceb/udp/udp_bsd.go#L11-L47","documentation":"Error inside the BSD ListenConfig Control callback: syscall.SetsockoptInt failed while enabling SO_REUSEPORT on the UDP socket fd. The OS refused the socket option — commonly because the kernel/libc lacks SO_REUSEPORT support; the errno is included and the listener creation fails.","triggerScenarios":"Thrown at udp/udp_bsd.go:29 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Disable multi (listen.routines / reuseport setting) so the option is not requested","Upgrade to a kernel that supports SO_REUSEPORT","Check the errno (e.g. ENOPROTOOPT) to confirm support is missing"],"exampleFix":null,"handlingStrategy":"fallback","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"}