slackhq/nebula · error

SO_REUSEPORT failed: %v

Error message

SO_REUSEPORT failed: %v

What it means

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.

Source

Thrown at udp/udp_bsd.go:29

	"log/slog"
	"net"
	"syscall"

	"golang.org/x/sys/unix"
)

func NewListener(l *slog.Logger, s Settings) (Conn, error) {
	return NewGenericListener(l, s)
}

func NewListenConfig(multi bool) net.ListenConfig {
	return net.ListenConfig{
		Control: func(network, address string, c syscall.RawConn) error {
			if multi {
				var controlErr error
				err := c.Control(func(fd uintptr) {
					if err := syscall.SetsockoptInt(int(fd), syscall.SOL_SOCKET, unix.SO_REUSEPORT, 1); err != nil {
						controlErr = fmt.Errorf("SO_REUSEPORT failed: %v", err)
						return
					}
				})
				if err != nil {
					return err
				}
				if controlErr != nil {
					return controlErr
				}
			}
			return nil
		},
	}
}

func (u *GenericConn) Rebind() error {
	return nil
}

View on GitHub (pinned to dd8f660c0a)

Solutions

  1. Disable multi (listen.routines / reuseport setting) so the option is not requested
  2. Upgrade to a kernel that supports SO_REUSEPORT
  3. Check the errno (e.g. ENOPROTOOPT) to confirm support is missing
Defensive patterns

Strategy: fallback

When it happens

Trigger: Thrown at udp/udp_bsd.go:29 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of slackhq/nebula@dd8f660c0a (2026-09-03). Data as JSON: /api/errors/e6088850aa3bc84b. Report an issue: GitHub.