netbirdio/netbird · error

refresh v6 rules

Error message

refresh v6 rules: %w

What it means

The v6 counterpart of the rule-cache resync: refreshing the v6 router's rules from the kernel failed while resolving which family holds a rule id. Cache and kernel disagree and the resync itself errored, so the rule operation aborts.

Solutions

  1. Verify v6 nftables state is listable as root
  2. Restart the daemon to rebuild caches
  3. Check the inner error for the netlink failure cause
Defensive patterns

Strategy: retry

When it happens

Trigger: Thrown at client/firewall/nftables/manager_linux.go:360 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/e1fb14c195402ab5. Report an issue: GitHub.

Appendix: source

Thrown at client/firewall/nftables/manager_linux.go:360

// routerForRuleID picks the router holding the rule with the given id, using
// the supplied lookup. If the cached maps disagree (or both miss), it refreshes
// from the kernel once and re-checks before falling back to the v4 router.
func (m *Manager) routerForRuleID(id string, has func(*router, string) bool) (*router, error) {
	if has(m.router, id) {
		return m.router, nil
	}
	if m.hasIPv6() && has(m.router6, id) {
		return m.router6, nil
	}
	if !m.hasIPv6() {
		return m.router, nil
	}
	if err := m.router.refreshRulesMap(); err != nil {
		return nil, fmt.Errorf("refresh v4 rules: %w", err)
	}
	if err := m.router6.refreshRulesMap(); err != nil {
		return nil, fmt.Errorf("refresh v6 rules: %w", err)
	}
	if has(m.router6, id) && !has(m.router, id) {
		return m.router6, nil
	}
	return m.router, nil
}

func (m *Manager) IsServerRouteSupported() bool {
	return true
}

func (m *Manager) IsStateful() bool {
	return true
}

func (m *Manager) AddNatRule(pair firewall.RouterPair) error {
	m.mutex.Lock()
	defer m.mutex.Unlock()

View on GitHub (pinned to 93e97f4bf1)