slackhq/nebula · error

failed to get udp fd: %w

Error message

failed to get udp fd: %w

What it means

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.

Source

Thrown at udp/udp_darwin.go:49

	lc := NewListenConfig(s.Multi)
	pc, err := lc.ListenPacket(context.TODO(), "udp", s.Listen.String())
	if err != nil {
		return nil, err
	}

	if uc, ok := pc.(*net.UDPConn); ok {
		c := &StdConn{UDPConn: uc, l: l}

		rc, err := uc.SyscallConn()
		if err != nil {
			return nil, fmt.Errorf("failed to open udp socket: %w", err)
		}

		err = rc.Control(func(fd uintptr) {
			c.sysFd = fd
		})
		if err != nil {
			return nil, fmt.Errorf("failed to get udp fd: %w", err)
		}

		la, err := c.LocalAddr()
		if err != nil {
			return nil, err
		}
		c.isV4 = la.Addr().Is4()

		return c, nil
	}

	return nil, fmt.Errorf("unexpected PacketConn: %T %#v", pc, pc)
}

func NewListenConfig(multi bool) net.ListenConfig {
	return net.ListenConfig{
		Control: func(network, address string, c syscall.RawConn) error {
			if multi {

View on GitHub (pinned to dd8f660c0a)

Solutions

  1. Retry listener creation
  2. Check the wrapped errno for the real cause (fd/closing race)
  3. Report if reproducible — indicates a runtime-level Control failure
Defensive patterns

Strategy: retry

When it happens

Trigger: Thrown at udp/udp_darwin.go:49 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/963312e55acdd248. Report an issue: GitHub.