netbirdio/netbird · error
parse tx_bytes
Error message
parse tx_bytes: %w
What it means
The userspace WireGuard status parser received a tx_bytes value over the IPC socket that toBytes could not convert to an integer, so peer transfer statistics cannot be built. The whole stats parse is aborted with this error since the resulting per-peer numbers would be incomplete or wrong.
Solutions
- Ignore the malformed line and keep prior stats
- Verify the UAPI producer emits decimal byte counters
- Log the raw line for diagnosis
Defensive patterns
Strategy: validation
When it happens
Trigger: Thrown at client/iface/configurer/usp.go:419 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of netbirdio/netbird@93e97f4bf1 (2026-08-16).
Data as JSON: /api/errors/d727f160e62e4fa5.
Report an issue: GitHub.
Appendix: source
Thrown at client/iface/configurer/usp.go:419
switch key[0] {
case ipcKeyLastHandshakeTimeSec:
hs, err := toLastHandshake(key[1])
if err != nil {
return nil, err
}
currentStats.LastHandshake = hs
stats[currentKey] = currentStats
case ipcKeyRxBytes:
rxBytes, err := toBytes(key[1])
if err != nil {
return nil, fmt.Errorf("parse rx_bytes: %w", err)
}
currentStats.RxBytes = rxBytes
stats[currentKey] = currentStats
case ipcKeyTxBytes:
TxBytes, err := toBytes(key[1])
if err != nil {
return nil, fmt.Errorf("parse tx_bytes: %w", err)
}
currentStats.TxBytes = TxBytes
stats[currentKey] = currentStats
}
}
return stats, nil
}
func toWgUserspaceString(wgCfg wgtypes.Config) string {
var sb strings.Builder
if wgCfg.PrivateKey != nil {
hexKey := hex.EncodeToString(wgCfg.PrivateKey[:])
sb.WriteString(fmt.Sprintf("private_key=%s\n", hexKey))
}
if wgCfg.ListenPort != nil {
sb.WriteString(fmt.Sprintf("listen_port=%d\n", *wgCfg.ListenPort))View on GitHub (pinned to 93e97f4bf1)