{"record":{"id":"a9b8e1e58bd3a251","repo":"kubernetes/kops","slug":"unable-to-determine-hash-from-http-head-q","errorCode":null,"errorMessage":"unable to determine hash from HTTP HEAD: %q","messagePattern":"unable to determine hash from HTTP HEAD: %q","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"upup/pkg/fi/assetstore.go","lineNumber":199,"sourceCode":"\tklog.Infof(\"Doing HTTP HEAD on %q\", url)\n\tresponse, err := http.Head(url)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"error doing HEAD on %q: %v\", url, err)\n\t}\n\tdefer response.Body.Close()\n\n\tetag := response.Header.Get(\"ETag\")\n\tetag = strings.TrimSpace(etag)\n\tetag = strings.Trim(etag, \"'\\\"\")\n\n\tif etag != \"\" {\n\t\tif len(etag) == 32 {\n\t\t\t// Likely md5\n\t\t\treturn hashing.HashAlgorithmMD5.FromString(etag)\n\t\t}\n\t}\n\n\treturn nil, fmt.Errorf(\"unable to determine hash from HTTP HEAD: %q\", url)\n}\n\n// Add an asset into the store, in one of the recognized formats (see Assets in types package)\nfunc (a *AssetStore) Add(ctx context.Context, id string) error {\n\tif strings.HasPrefix(id, \"http://\") || strings.HasPrefix(id, \"https://\") || strings.HasPrefix(id, \"gs://\") || strings.HasPrefix(id, \"s3://\") || strings.HasPrefix(id, \"azureblob://\") {\n\t\treturn a.addURLs(ctx, strings.Split(id, \",\"), nil)\n\t}\n\ti := strings.Index(id, \"@http://\")\n\tif i == -1 {\n\t\ti = strings.Index(id, \"@https://\")\n\t}\n\tif i == -1 {\n\t\ti = strings.Index(id, \"@gs://\")\n\t}\n\tif i == -1 {\n\t\ti = strings.Index(id, \"@s3://\")\n\t}\n\tif i == -1 {","sourceCodeStart":181,"sourceCodeEnd":217,"githubUrl":"https://github.com/kubernetes/kops/blob/4c8573c808a73d578c5eadc86d410646ea0b0d73/upup/pkg/fi/assetstore.go#L181-L217","documentation":"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.","triggerScenarios":"Thrown at upup/pkg/fi/assetstore.go:199 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","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"],"exampleFix":null,"handlingStrategy":"fallback","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"4c8573c808a73d578c5eadc86d410646ea0b0d73","analyzedAt":"2026-09-05T04:13:19.212Z","contentChangedAt":"2026-09-05T04:13:19.212Z","schemaVersion":2},"datasetVersion":"2026-09-12T12:17:11.808Z"}