getsops/sops · error

missing Location header

Error message

missing Location header

What it means

Error "missing Location header" thrown in getsops/sops.

Source

Thrown at version/version.go:190

		}
		return nil
	}

	resp, err := client.Head(fmt.Sprintf("%s/%s/releases/latest", f.endpoint, repository))
	if err != nil {
		return "", "", err
	}
	if resp.Body != nil {
		defer resp.Body.Close()
	}

	if resp.StatusCode < 300 || resp.StatusCode > 399 {
		return "", "", fmt.Errorf("unexpected status code: %d", resp.StatusCode)
	}

	location := resp.Header.Get("Location")
	if location == "" {
		return "", "", fmt.Errorf("missing Location header")
	}

	tagMarker := "releases/tag/"
	if tagIndex := strings.Index(location, tagMarker); tagIndex != -1 {
		return location[tagIndex+len(tagMarker):], location, nil
	}
	return "", "", fmt.Errorf("unexpected Location header: %s", location)
}

// LatestReleaseUsingAPI retrieves the most recent release version from the
// GitHub API. It returns the latest version as a string, along with its
// corresponding URL, or an error in case of request failure or parsing issues
// with the response.
//
// This approach boasts higher reliability compared to
// LatestReleaseUsingRedirect as it leverages the versioned GitHub API.
// However, it can be affected by GitHub API rate limiting.
func (f releaseFetcher) LatestReleaseUsingAPI(repository string) (tag, url string, err error) {

View on GitHub (pinned to 13442bb981)

When it happens

Trigger: Thrown at version/version.go:190 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of getsops/sops@13442bb981 (2026-09-01). Data as JSON: /api/errors/11025b8cad06968e. Report an issue: GitHub.