netbirdio/netbird · warning

parse IPC config: %w

Error message

parse IPC config: %w

What it means

RemoveEndpointAddress wrapped a parseStatus failure over the raw IpcGet dump. parseStatus is deliberately lenient: it logs and skips malformed lines (bad keys, bad CIDRs) and in the current code always returns a nil error, so this branch is defensive and effectively unreachable with a well-formed wireguard-go dump. If it ever fires, the IPC string came from an incompatible producer or was corrupted in memory.

Source

Thrown at client/iface/configurer/usp.go:146

	}
	return nil
}

func (c *WGUSPConfigurer) RemoveEndpointAddress(peerKey string) error {
	peerKeyParsed, err := wgtypes.ParseKey(peerKey)
	if err != nil {
		return fmt.Errorf("parse peer key: %w", err)
	}

	ipcStr, err := c.device.IpcGet()
	if err != nil {
		return fmt.Errorf("get IPC config: %w", err)
	}

	// Parse current status to get allowed IPs for the peer
	stats, err := parseStatus(c.deviceName, ipcStr)
	if err != nil {
		return fmt.Errorf("parse IPC config: %w", err)
	}

	var allowedIPs []net.IPNet
	found := false
	for _, peer := range stats.Peers {
		if peer.PublicKey == peerKey {
			allowedIPs = peer.AllowedIPs
			found = true
			break
		}
	}
	if !found {
		return fmt.Errorf("peer %s not found", peerKey)
	}

	// remove the peer from the WireGuard configuration
	peer := wgtypes.PeerConfig{
		PublicKey: peerKeyParsed,

View on GitHub (pinned to 93e97f4bf1)

Solutions

  1. Pin or verify the wireguard-go version paired with this configurer
  2. Capture the raw IPC dump when this triggers and diff it against expected UAPI lines
  3. Keep parseStatus tolerant: skip unknown lines rather than failing the whole operation
  4. Add a regression test feeding a known-good dump through RemoveEndpointAddress
Defensive patterns

Strategy: try-catch

Try / catch

if err := uspCfg.RemoveEndpointAddress(peerKey); err != nil {
	if strings.Contains(err.Error(), "parse IPC config") {
		// capture the dump for diagnosis; parseStatus is lenient so this is near-unreachable
		log.Debugf("parse IPC config failed for peer %s", peerKey)
	}
	return err
}

Prevention

When it happens

Trigger: A wireguard-go version whose UAPI output diverges from the expected key=value lines; an IPC string produced by something other than the paired device; memory corruption or a data race on the dumped string.

Common situations: Vendored wireguard-go fork with altered UAPI serialization; test harness injecting hand-written IPC strings; version skew after a dependency bump.

Related errors


AI-assisted analysis of netbirdio/netbird@93e97f4bf1 (2026-08-16). Data as JSON: /api/errors/f2aecfed1ab6f50c. Report an issue: GitHub.