juanfont/headscale · error

test %d, accept %q: %w

Error message

test %d, accept %q: %w

What it means

Error "test %d, accept %q: %w" thrown in juanfont/headscale.

Source

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

func validateTests(pol *Policy, tests []PolicyTest) error {
	var errs []error

	for i, t := range tests {
		if len(t.Accept) == 0 && len(t.Deny) == 0 {
			errs = append(errs, fmt.Errorf("test %d: %w", i, ErrTestEmptyAssertions))
		}

		if t.Proto != "" &&
			t.Proto != ProtocolNameTCP &&
			t.Proto != ProtocolNameUDP &&
			t.Proto != ProtocolNameSCTP {
			errs = append(errs, fmt.Errorf("test %d: %w: %q", i, ErrTestProtocolNotAllowed, t.Proto))
		}

		for _, dst := range t.Accept {
			err := validateTestDestination(pol, dst)
			if err != nil {
				errs = append(errs, fmt.Errorf("test %d, accept %q: %w", i, dst, err))
			}
		}

		for _, dst := range t.Deny {
			err := validateTestDestination(pol, dst)
			if err != nil {
				errs = append(errs, fmt.Errorf("test %d, deny %q: %w", i, dst, err))
			}
		}
	}

	if len(errs) > 0 {
		return fmt.Errorf("%w:\n%w", errPolicyTestsFailed, multierr.New(errs...))
	}

	return nil
}

View on GitHub (pinned to 565fd254d0)

Solutions

  1. Inspect the wrapped error for the underlying cause and correct the failing condition (test , accept); retry the operation after fixing the input, configuration, or environment.

Example fix

Inspect the wrapped error for the underlying cause and correct the failing condition (test , accept); retry the operation after fixing the input, configuration, or environment.

When it happens

Trigger: Thrown at hscontrol/policy/v2/types.go:3215 when the library encounters an invalid state.

Common situations: An accept entry in a policy test failed to resolve. Ensure the accept destination is a single valid host.


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