netbirdio/netbird · error
parse rx_bytes
Error message
parse rx_bytes: %w
What it means
The rx_bytes field of a wireguard-go UAPI dump line could not be parsed as an integer in parseTransfers. The value came from the userspace implementation's IPC output and is not a valid base-10 number.
Solutions
- Skip malformed stats lines instead of failing the whole transfer report
- Check the wireguard-go version for UAPI format changes
- Log the offending line to identify the producer
Defensive patterns
Strategy: validation
When it happens
Trigger: Thrown at client/iface/configurer/usp.go:412 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/624f1c39103dc7a7.
Report an issue: GitHub.
Appendix: source
Thrown at client/iface/configurer/usp.go:412
continue
}
key := strings.SplitN(line, "=", 2)
if len(key) != 2 {
continue
}
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.BuilderView on GitHub (pinned to 93e97f4bf1)