slackhq/nebula · error

LocalAddr returned: %#v

Error message

LocalAddr returned: %#v

What it means

Type-guard failure in Darwin StdConn.LocalAddr: the value returned by UDPConn.LocalAddr() was not a *net.UDPAddr (its Go representation is printed with %#v), so the address cannot be converted to netip.AddrPort. Unexpected runtime state; not reachable on a normal UDP socket.

Source

Thrown at udp/udp_darwin.go:171

			u.l.Debug("failed to write packet in batch", "udpAddr", addrs[i], "error", err)
		}
	}
	return written, nil
}

func (u *StdConn) LocalAddr() (netip.AddrPort, error) {
	a := u.UDPConn.LocalAddr()

	switch v := a.(type) {
	case *net.UDPAddr:
		addr, ok := netip.AddrFromSlice(v.IP)
		if !ok {
			return netip.AddrPort{}, fmt.Errorf("LocalAddr returned invalid IP address: %s", v.IP)
		}
		return netip.AddrPortFrom(addr, uint16(v.Port)), nil

	default:
		return netip.AddrPort{}, fmt.Errorf("LocalAddr returned: %#v", a)
	}
}

func (u *StdConn) ReloadConfig(c *config.C) {
	// TODO
}

func NewUDPStatsEmitter(udpConns []Conn) func() {
	// No UDP stats for non-linux
	return func() {}
}

func (u *StdConn) ListenOut(r EncReader, flush func()) error {
	buffer := make([]byte, MTU)

	for {
		// Just read one packet at a time
		n, rua, err := u.ReadFromUDPAddrPort(buffer)

View on GitHub (pinned to dd8f660c0a)

Solutions

  1. Defensive default-case error: UDPConn.LocalAddr returned a type other than *net.UDPAddr, which should not happen for a standard UDP socket — update Go/nebula if the net package behavior changed
  2. Check that no wrapper or proxy type is substituting the underlying UDPConn on this platform
  3. Capture the %#v detail in the error; it shows the actual dynamic type and value returned and should be included in a bug report
  4. Reconfigure the listener with an explicit, valid UDP listen address and retry
Defensive patterns

Strategy: type-guard

When it happens

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