{"record":{"id":"2672da33a3847b12","repo":"kubernetes/kops","slug":"etag-was-not-a-valid-md5-sum-q-2672da","errorCode":null,"errorMessage":"etag was not a valid MD5 sum: %q","messagePattern":"etag was not a valid MD5 sum: %q","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"util/pkg/vfs/swiftfs.go","lineNumber":625,"sourceCode":"}\n\nfunc (p *SwiftPath) PreferredHash() (*hashing.Hash, error) {\n\treturn p.Hash(hashing.HashAlgorithmMD5)\n}\n\nfunc (p *SwiftPath) Hash(a hashing.HashAlgorithm) (*hashing.Hash, error) {\n\tif a != hashing.HashAlgorithmMD5 {\n\t\treturn nil, nil\n\t}\n\n\tmd5 := p.hash\n\tif md5 == \"\" {\n\t\treturn nil, nil\n\t}\n\n\tmd5Bytes, err := hex.DecodeString(md5)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"etag was not a valid MD5 sum: %q\", md5)\n\t}\n\n\treturn &hashing.Hash{Algorithm: hashing.HashAlgorithmMD5, HashValue: md5Bytes}, nil\n}\n\nfunc isSwiftNotFound(err error) bool {\n\treturn gophercloud.ResponseCodeIs(err, http.StatusNotFound)\n}\n","sourceCodeStart":607,"sourceCodeEnd":634,"githubUrl":"https://github.com/kubernetes/kops/blob/4c8573c808a73d578c5eadc86d410646ea0b0d73/util/pkg/vfs/swiftfs.go#L607-L634","documentation":"Returned by SwiftPath.Hash when the cached object etag cannot be hex-decoded. Swift normally exposes the content MD5 as a hex etag, but DLO/SLO large objects have etags that are not the MD5 of the content, and any malformed value fails hex decoding — the hash is then unavailable to callers. Non-MD5 algorithm requests return (nil, nil) earlier.","triggerScenarios":"Thrown at util/pkg/vfs/swiftfs.go:625 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Treat the hash as unavailable and fall back to a full-content hash if integrity checking is required","For large objects, compute the MD5 of the downloaded body instead of trusting the etag","Re-list the object to refresh a possibly corrupted cached etag"],"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"}