netbirdio/netbird · error

invalid action

Error message

invalid action: %w

What it means

The ACL rule's action from management could not be converted to a firewall action (convertFirewallAction returned an error). Only ACCEPT and DROP are recognized; anything else fails rule installation.

Solutions

  1. Check the management server version for unknown action values
  2. Skip or reject rules with unsupported actions
  3. Upgrade client and management to matching protocol versions
Defensive patterns

Strategy: validation

When it happens

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

Appendix: source

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

		if err != nil {
			return "", fmt.Errorf("parse source range: %w", err)
		}
		sources = append(sources, source)
	}

	destination, err := determineDestination(rule, dynamicResolver, sources)
	if err != nil {
		return "", fmt.Errorf("determine destination: %w", err)
	}

	protocol, err := convertToFirewallProtocol(rule.Protocol)
	if err != nil {
		return "", fmt.Errorf("invalid protocol: %w", err)
	}

	action, err := convertFirewallAction(rule.Action)
	if err != nil {
		return "", fmt.Errorf("invalid action: %w", err)
	}

	dPorts := convertPortInfo(rule.PortInfo)

	addedRule, err := d.firewall.AddRouteFiltering(rule.PolicyID, sources, destination, protocol, nil, dPorts, action)
	if err != nil {
		return "", fmt.Errorf("add route rule: %w", err)
	}

	return id.RuleID(addedRule.ID()), nil
}

func (d *DefaultManager) protoRuleToFirewallRule(
	r *mgmProto.FirewallRule,
	ipsetName string,
) (id.RuleID, []firewall.Rule, error) {
	ip, err := extractRuleIP(r)
	if err != nil {

View on GitHub (pinned to 93e97f4bf1)