kubernetes/kops · error

etag was not a valid MD5 sum: %q

Error message

etag was not a valid MD5 sum: %q

What it means

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.

Source

Thrown at util/pkg/vfs/swiftfs.go:625

}

func (p *SwiftPath) PreferredHash() (*hashing.Hash, error) {
	return p.Hash(hashing.HashAlgorithmMD5)
}

func (p *SwiftPath) Hash(a hashing.HashAlgorithm) (*hashing.Hash, error) {
	if a != hashing.HashAlgorithmMD5 {
		return nil, nil
	}

	md5 := p.hash
	if md5 == "" {
		return nil, nil
	}

	md5Bytes, err := hex.DecodeString(md5)
	if err != nil {
		return nil, fmt.Errorf("etag was not a valid MD5 sum: %q", md5)
	}

	return &hashing.Hash{Algorithm: hashing.HashAlgorithmMD5, HashValue: md5Bytes}, nil
}

func isSwiftNotFound(err error) bool {
	return gophercloud.ResponseCodeIs(err, http.StatusNotFound)
}

View on GitHub (pinned to 4c8573c808)

Solutions

  1. Treat the hash as unavailable and fall back to a full-content hash if integrity checking is required
  2. For large objects, compute the MD5 of the downloaded body instead of trusting the etag
  3. Re-list the object to refresh a possibly corrupted cached etag
Defensive patterns

Strategy: fallback

When it happens

Trigger: Thrown at util/pkg/vfs/swiftfs.go:625 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/2672da33a3847b12. Report an issue: GitHub.