tailscale/tailscale · error

wanted HTTP status code %d but got %d: %#q

Error message

wanted HTTP status code %d but got %d: %#q

What it means

Error "wanted HTTP status code %d but got %d: %#q" thrown in tailscale/tailscale.

Source

Thrown at cmd/gitops-pusher/gitops-pusher.go:445

	req, err := http.NewRequestWithContext(ctx, httpm.GET, fmt.Sprintf("https://%s/api/v2/tailnet/%s/acl", *apiServer, tailnet), nil)
	if err != nil {
		return "", err
	}

	req.SetBasicAuth(apiKey, "")
	req.Header.Set("Accept", "application/hujson")

	resp, err := client.Do(req)
	if err != nil {
		return "", err
	}
	defer resp.Body.Close()

	got := resp.StatusCode
	want := http.StatusOK
	if got != want {
		errorDetails, _ := io.ReadAll(resp.Body)
		return "", fmt.Errorf("wanted HTTP status code %d but got %d: %#q", want, got, string(errorDetails))
	}

	return Shuck(resp.Header.Get("ETag")), nil
}

View on GitHub (pinned to cfe32b8be6)

When it happens

Trigger: Thrown at cmd/gitops-pusher/gitops-pusher.go:445 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of tailscale/tailscale@cfe32b8be6 (2026-08-15). Data as JSON: /api/errors/fe2e7c089cf4ce28. Report an issue: GitHub.