netbirdio/netbird · warning

IpcGet failed: %w

Error message

IpcGet failed: %w

What it means

WGUSPConfigurer.FullStats could not dump the userspace device state with device.IpcGet(). The same underlying conditions as the other IpcGet errors apply: the wireguard-go device is closed or being torn down while statistics are requested. FullStats powers detailed status output, so this degrades diagnostics rather than connectivity.

Source

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

				return err
			}
			peer.AllowedIPs = append(peer.AllowedIPs, *ipNet)
		}
	}

	if !removedAllowedIP {
		return ErrAllowedIPNotFound
	}
	config := wgtypes.Config{
		Peers: []wgtypes.PeerConfig{peer},
	}
	return c.device.IpcSet(toWgUserspaceString(config))
}

func (c *WGUSPConfigurer) FullStats() (*Stats, error) {
	ipcStr, err := c.device.IpcGet()
	if err != nil {
		return nil, fmt.Errorf("IpcGet failed: %w", err)
	}

	return parseStatus(c.deviceName, ipcStr)
}

func (c *WGUSPConfigurer) LastActivities() map[string]monotime.Time {
	return c.activityRecorder.GetLastActivities()
}

// startUAPI starts the UAPI listener for managing the WireGuard interface via external tool
func (t *WGUSPConfigurer) startUAPI() {
	var err error
	t.uapiListener, err = openUAPI(t.deviceName)
	if err != nil {
		log.Errorf("failed to open uapi listener: %v", err)
		return
	}

View on GitHub (pinned to 93e97f4bf1)

Solutions

  1. Check the device lifecycle before requesting stats and report 'unavailable' when closed
  2. Retry once after reconnect completes
  3. Cache the last successful FullStats result for read-only display
  4. Order teardown so stat endpoints stop before the device closes
Defensive patterns

Strategy: try-catch

Try / catch

stats, err := uspCfg.FullStats()
if err != nil {
	// diagnostics path: degrade instead of failing the caller
	log.Warnf("full stats unavailable (device closed?): %v", err)
	stats = &configurer.Stats{DeviceName: ifaceName}
}

Prevention

When it happens

Trigger: Status dump requested after device.Close(); FullStats racing a reconnect that rebuilds the device; device left half-initialized after a failed start.

Common situations: Status command running while the agent reconnects; UI polling stats during shutdown; embedded client queried after teardown.

Related errors


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