juanfont/headscale · error

%s confirm form: no action attribute

Error message

%s confirm form: no action attribute

What it means

Error "%s confirm form: no action attribute" thrown in juanfont/headscale.

Source

Thrown at integration/scenario.go:1256

	}

	return body, redirectURL, nil
}

// submitConfirmForm parses the OIDC registration confirmation
// interstitial HTML, extracts the form action and CSRF token, and
// POSTs the form using the same HTTP client (which carries the CSRF
// cookie set by the callback).
func submitConfirmForm(
	hostname string,
	htmlBody string,
	prevResp *http.Response,
	hc *http.Client,
) (string, *url.URL, error) {
	// Extract form action URL.
	actionIdx := strings.Index(htmlBody, `action="`)
	if actionIdx == -1 {
		return "", nil, fmt.Errorf("%s confirm form: no action attribute", hostname) //nolint:err113
	}

	actionStart := actionIdx + len(`action="`)

	actionEnd := strings.Index(htmlBody[actionStart:], `"`)
	if actionEnd == -1 {
		return "", nil, fmt.Errorf("%s confirm form: unterminated action attribute", hostname) //nolint:err113
	}

	formAction := htmlBody[actionStart : actionStart+actionEnd]

	// Extract hidden CSRF input value. The rendered <input> has
	// attributes in name-type-value order so we grab the whole tag.
	before, _, ok := strings.Cut(htmlBody, `name="headscale_register_confirm"`)
	if !ok {
		return "", nil, fmt.Errorf("%s confirm form: no CSRF input", hostname) //nolint:err113
	}

View on GitHub (pinned to 565fd254d0)

Solutions

  1. Inspect the wrapped error for the underlying cause and correct the failing condition (confirm form); 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 (confirm form); retry the operation after fixing the input, configuration, or environment.

When it happens

Trigger: Thrown at integration/scenario.go:1256 when the library encounters an invalid state.

Common situations: The confirm page form had no action attribute. The mock OIDC provider's confirm template may have changed; check the page HTML.


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