juanfont/headscale · error

autogroup not supported for ACL destinations

Error message

autogroup not supported for ACL destinations

What it means

Returned by validateAutogroupForDst (hscontrol/policy/v2/types.go:2062) when an autogroup used as an ACL destination is not in autogroupForDst = {autogroup:internet, autogroup:member, autogroup:tagged, autogroup:self} (types.go:1999). autogroup:danger-all is special-cased to its own error (2058) first. The error message embeds the allowed destination autogroups.

Source

Thrown at hscontrol/policy/v2/types.go:138

	ErrInvalidAlias                = errors.New("invalid alias format")
	ErrInvalidAutoApprover         = errors.New("invalid auto approver format")
	ErrInvalidOwner                = errors.New("invalid owner format")
	ErrGroupNotDefined             = errors.New("group not defined in policy")
	ErrInvalidGroupMember          = errors.New("invalid group member type")
	ErrGroupValueNotArray          = errors.New("group value must be an array of users")
	ErrInvalidHostIP               = errors.New("hostname contains invalid IP address")
	ErrTagNotDefined               = errors.New("tag not found")
	ErrAutoApproverNotAlias        = errors.New("auto approver is not an alias")
	ErrInvalidACLAction            = errors.New("invalid ACL action")
	ErrInvalidSSHAction            = errors.New("invalid SSH action")
	ErrInvalidProtocolNumber       = errors.New("invalid protocol number")
	ErrProtocolLeadingZero         = errors.New("leading 0 not permitted in protocol number")
	ErrProtocolOutOfRange          = errors.New("protocol number out of range (0-255)")
	ErrAutogroupNotSupported       = errors.New("autogroup not supported in headscale")
	ErrAutogroupInternetSrc        = errors.New("autogroup:internet can only be used in ACL destinations")
	ErrAutogroupSelfSrc            = errors.New("\"autogroup:self\" not valid on the src side of a rule")
	ErrAutogroupNotSupportedACLSrc = errors.New("autogroup not supported for ACL sources")
	ErrAutogroupNotSupportedACLDst = errors.New("autogroup not supported for ACL destinations")
	ErrAutogroupDangerAllDst       = errors.New("cannot use autogroup:danger-all as a dst")
	ErrAutogroupNotSupportedSSHSrc = errors.New("autogroup not supported for SSH sources")
	ErrAutogroupNotSupportedSSHDst = errors.New("autogroup not supported for SSH destinations")
	ErrHostNotDefined              = errors.New("host not defined in policy")
	ErrSSHSourceAliasNotSupported  = errors.New("alias not supported for SSH source")
	ErrSSHDestAliasNotSupported    = errors.New("alias not supported for SSH destination")
	ErrUnknownField                = errors.New("unknown field")
	ErrProtocolNoSpecificPorts     = errors.New("protocol does not support specific ports")
	ErrTestEmptyAssertions         = errors.New("test entry must have at least one of \"accept\" or \"deny\"")
	ErrTestProtocolNotAllowed      = errors.New("test protocol must be tcp, udp, sctp, or empty")
	ErrTestDestinationMultiPort    = errors.New("test destination port must be a single port")
	ErrTestDestinationCIDR         = errors.New("test destination must be a single host, not a CIDR range")
	ErrAutogroupInternetTestDst    = errors.New("autogroup:internet not valid as a test destination")
	ErrSSHTestEmptySrc             = errors.New("SSH tests entry must have a non-empty src")
	ErrSSHTestEmptyDst             = errors.New("SSH tests entry must have at least one dst")
	ErrSSHTestDstUnknownTag        = errors.New("SSH tests dst contains unknown tag")
	ErrSSHTestDstDisallowedElement = errors.New("SSH tests dst contains disallowed element")
)

View on GitHub (pinned to 565fd254d0)

Solutions

  1. Use one of autogroup:internet, autogroup:member, autogroup:tagged, autogroup:self as the dst autogroup
  2. Remember dst requires a port suffix, e.g. "autogroup:member:22"
  3. If you meant 'everywhere', a "*:port" wildcard dst may express it without an autogroup

Example fix

// before
{"action": "accept", "src": ["group:dev"], "dst": ["autogroup:future-group:443"]}

// after
{"action": "accept", "src": ["group:dev"], "dst": ["autogroup:member:443"]}
Defensive patterns

Strategy: validation

Validate before calling

dstAutogroups := map[string]bool{"autogroup:internet": true, "autogroup:member": true, "autogroup:tagged": true, "autogroup:self": true}
for _, d := range acl.Dst {
	if strings.HasPrefix(d.Alias, "autogroup:") && !dstAutogroups[d.Alias] {
		return fmt.Errorf("%s not allowed as dst", d.Alias)
	}
}

Type guard

func isAutogroupNotSupportedACLDst(err error) bool {
	return errors.Is(err, policy.ErrAutogroupNotSupportedACLDst)
}

Try / catch

if err := p.Validate(); err != nil {
	if errors.Is(err, policy.ErrAutogroupNotSupportedACLDst) {
		return fmt.Errorf("illegal dst autogroup (legal: internet, member, tagged, self): %w", err)
	}
	return err
}

Prevention

When it happens

Trigger: An ACL dst containing an autogroup outside the allowed four (other than danger-all). Today the parse set makes this a forward-compatibility guard, but any newly added dst-only autogroup misuse lands here.

Common situations: Using autogroup:danger-all in dst (gets the dedicated danger-all error) or future autogroups in the wrong slot; converting Tailscale grants where dst autogroup semantics differ.

Related errors


AI-assisted analysis of juanfont/headscale@565fd254d0 (2026-08-15). Data as JSON: /api/errors/eb8bfd14919757cc. Report an issue: GitHub.