kubernetes/kops · error
unable to determine hash from HTTP HEAD: %q
Error message
unable to determine hash from HTTP HEAD: %q
What it means
The HTTP HEAD on the asset URL succeeded but yielded no usable ETag (or one that is not 32 hex chars, i.e. not an MD5), so the store cannot derive a checksum and refuses to register the unverified URL.
Source
Thrown at upup/pkg/fi/assetstore.go:199
klog.Infof("Doing HTTP HEAD on %q", url)
response, err := http.Head(url)
if err != nil {
return nil, fmt.Errorf("error doing HEAD on %q: %v", url, err)
}
defer response.Body.Close()
etag := response.Header.Get("ETag")
etag = strings.TrimSpace(etag)
etag = strings.Trim(etag, "'\"")
if etag != "" {
if len(etag) == 32 {
// Likely md5
return hashing.HashAlgorithmMD5.FromString(etag)
}
}
return nil, fmt.Errorf("unable to determine hash from HTTP HEAD: %q", url)
}
// Add an asset into the store, in one of the recognized formats (see Assets in types package)
func (a *AssetStore) Add(ctx context.Context, id string) error {
if strings.HasPrefix(id, "http://") || strings.HasPrefix(id, "https://") || strings.HasPrefix(id, "gs://") || strings.HasPrefix(id, "s3://") || strings.HasPrefix(id, "azureblob://") {
return a.addURLs(ctx, strings.Split(id, ","), nil)
}
i := strings.Index(id, "@http://")
if i == -1 {
i = strings.Index(id, "@https://")
}
if i == -1 {
i = strings.Index(id, "@gs://")
}
if i == -1 {
i = strings.Index(id, "@s3://")
}
if i == -1 {View on GitHub (pinned to 4c8573c808)
Solutions
- Serve the object with a 32-character (MD5) ETag header
- Specify the hash explicitly in the asset id using the '<hash>@<url>' form instead of relying on HEAD
Defensive patterns
Strategy: fallback
When it happens
Trigger: Thrown at upup/pkg/fi/assetstore.go:199 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of kubernetes/kops@4c8573c808 (2026-09-05).
Data as JSON: /api/errors/a9b8e1e58bd3a251.
Report an issue: GitHub.