netbirdio/netbird · error
add netlink monitor
Error message
add netlink monitor: %w
What it means
The nftables netlink monitor could not be registered (conn.AddMonitor) in subscribe(). Without the monitor the manager cannot watch for external chain/table changes (e.g. firewalld reloads), so the watch loop fails to start.
Solutions
- Verify nftables and netlink monitor support in the kernel
- Check daemon capabilities (CAP_NET_ADMIN)
- Restart the daemon; older kernels lacking monitor support need the iptables backend
Defensive patterns
Strategy: retry
When it happens
Trigger: Thrown at client/firewall/nftables/external_chain_monitor_linux.go:150 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/f06571ab6d17bf2d.
Report an issue: GitHub.
Appendix: source
Thrown at client/firewall/nftables/external_chain_monitor_linux.go:150
}
if !isRelevantMonitorEvent(ev) {
continue
}
resetDebounce(debounce, pending)
pending = true
}
}
}
func (m *externalChainMonitor) subscribe() (chan *nftables.MonitorEvent, func(), error) {
conn := &nftables.Conn{}
mon := nftables.NewMonitor(
nftables.WithMonitorAction(nftables.MonitorActionNew),
nftables.WithMonitorObject(nftables.MonitorObjectChains|nftables.MonitorObjectTables),
)
events, err := conn.AddMonitor(mon)
if err != nil {
return nil, nil, fmt.Errorf("add netlink monitor: %w", err)
}
return events, func() { _ = mon.Close() }, nil
}
// resetDebounce reschedules a pending debounce timer without leaking a stale
// fire on its channel. pending must reflect whether the timer is armed.
func resetDebounce(t *time.Timer, pending bool) {
if pending && !t.Stop() {
select {
case <-t.C:
default:
}
}
t.Reset(externalMonitorReconcileDelay)
}
func (m *externalChainMonitor) reconcile() {
if err := m.reconciler.reconcileExternalChains(); err != nil {View on GitHub (pinned to 93e97f4bf1)