jdx/mise · error
remote cache blob pack has an invalid digest algorithm
Error message
remote cache blob pack has an invalid digest algorithm
What it means
Each framed entry in a blob pack starts with a one-byte digest-algorithm identifier; only 1 (blake3) and 2 (sha256) are defined. Any other byte means the pack was produced by an incompatible/newer encoder, and the client bails. This is a strict forward-compatibility guard on the pack framing format.
Solutions
- Upgrade the client so it understands the algorithm IDs the server emits
- If the server introduced new algorithm IDs, pin the server to a format compatible with deployed clients
- Check for stream corruption if only some downloads fail — earlier framed_bytes/size checks would otherwise desync
- Reproduce with curl --raw to confirm whether the served bytes truly contain the bad ID
Defensive patterns
Strategy: fallback
Validate before calling
// When parsing pack framing yourself, whitelist algorithm IDs first:
let id = algorithm_byte;
if !matches!(id, 1 | 2) { bail!("unsupported pack algorithm id {id}"); } Try / catch
match client.get_blob_pack(&digests, staging).await? {
Some(pack) => use_pack(pack),
None => {
// decode unsupported — fetch blobs individually via get_blob/get_blob_file
}
} Prevention
- Upgrade clients before the server starts emitting new algorithm IDs
- Never hand-craft pack streams; generate them only with the library's encoder
- Investigate stream corruption if the bad ID appears sporadically (framing desync)
When it happens
Trigger: Decoding a blob pack (via get_blob_pack) whose entry framing contains an unrecognized algorithm byte — e.g. a server writing algorithm id 3 for a digest type this client doesn't know, or bit corruption shifting the framing.
Common situations: Server upgraded to a pack format with new algorithm IDs while the client is older; framing desync from a corrupted stream causing a payload byte to be read as the algorithm byte; hand-crafted or test packs with invalid IDs.
Understand the failure class
Background: Invalid enum value errors: "Unknown type", "Invalid scope", "must be one of" — when a string is not on the library's allowed list — this error's family across 23 libraries.
Related errors
- remote cache blob pack has invalid magic
- remote cache blob pack returned an unrequested digest
- cached rustc output directory has unsupported entries
- invalid remote action manifest ETag
- invalid remote task cache key
AI-assisted analysis of jdx/mise@533346cc37 (2026-09-17).
Data as JSON: /api/errors/ecd3eba56541065a.
Report an issue: GitHub.
Appendix: source
Thrown at crates/mise-cache-core/src/lib.rs:811
}
let directory = tempfile::tempdir_in(staging_dir)?;
let mut seen = BTreeSet::new();
let mut blobs = Vec::new();
let mut payload_bytes = 0_u64;
let mut framed_bytes = BLOB_PACK_MAGIC.len() as u64;
loop {
let mut algorithm = [0_u8; 1];
if reader.read(&mut algorithm).await? == 0 {
break;
}
let (algorithm, mut hasher) = match algorithm[0] {
1 => (
"blake3",
BlobPackHasher::Blake3(Box::new(blake3::Hasher::new())),
),
2 => ("sha256", BlobPackHasher::Sha256(sha2::Sha256::new())),
_ => bail!("remote cache blob pack has an invalid digest algorithm"),
};
let mut hash = [0_u8; 32];
reader.read_exact(&mut hash).await?;
let mut size = [0_u8; 8];
reader.read_exact(&mut size).await?;
let digest = CacheDigest {
algorithm: algorithm.into(),
hash: hex::encode(hash),
size: u64::from_be_bytes(size),
};
if !requested.contains(&digest) {
bail!("remote cache blob pack returned an unrequested digest");
}
if !seen.insert(digest.clone()) {
bail!("remote cache blob pack returned a duplicate digest");
}
framed_bytes = framed_bytes
.checked_add(BLOB_PACK_HEADER_BYTES)View on GitHub (pinned to 533346cc37)