netbirdio/netbird · error

parse destination

Error message

parse destination: %w

What it means

The static destination prefix of an ACL rule failed netip.ParsePrefix during destination building. The rule's destination string is malformed (bad CIDR notation or wrong family), so the rule cannot be compiled.

Solutions

  1. Validate destination CIDR format on the management side
  2. Skip rules with unparseable destinations
  3. Check family consistency between source and destination
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at client/internal/acl/manager.go:503 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/49d43a1296816ec7. Report an issue: GitHub.

Appendix: source

Thrown at client/internal/acl/manager.go:503

	if rule.IsDynamic {
		if dynamicResolver {
			if len(rule.Domains) > 0 {
				destination.Set = firewall.NewDomainSet(domain.FromPunycodeList(rule.Domains))
			} else {
				// isDynamic is set but no domains = outdated management server
				log.Warn("connected to an older version of management server (no domains in rules), using default destination")
				destination.Prefix = getDefault(sources[0])
			}
		} else {
			// client resolves DNS, we (router) don't know the destination
			destination.Prefix = getDefault(sources[0])
		}
		return destination, nil
	}

	prefix, err := netip.ParsePrefix(rule.Destination)
	if err != nil {
		return destination, fmt.Errorf("parse destination: %w", err)
	}
	destination.Prefix = prefix
	return destination, nil
}

func getDefault(prefix netip.Prefix) netip.Prefix {
	if prefix.Addr().Is6() {
		return netip.PrefixFrom(netip.IPv6Unspecified(), 0)
	}
	return netip.PrefixFrom(netip.IPv4Unspecified(), 0)
}

View on GitHub (pinned to 93e97f4bf1)