{"record":{"id":"7b8b3404bd7064d4","repo":"jdx/mise","slug":"unsupported-remote-cache-digest-algorithm","errorCode":null,"errorMessage":"unsupported remote cache digest algorithm","messagePattern":"unsupported remote cache digest algorithm","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/mise-cache-core/src/lib.rs","lineNumber":120,"sourceCode":"            algorithm: \"blake3\".into(),\n            hash: blake3::hash(bytes).to_hex().to_string(),\n            size: bytes.len() as u64,\n        }\n    }\n\n    /// Hash a file while counting the bytes read in the same streaming pass.\n    pub fn blake3_file(path: &Path) -> Result<Self> {\n        let (hash, size) = hash_file_blake3(path)?;\n        Ok(Self {\n            algorithm: \"blake3\".into(),\n            hash,\n            size,\n        })\n    }\n\n    pub fn validate(&self) -> Result<()> {\n        if self.algorithm != \"blake3\" && self.algorithm != \"sha256\" {\n            bail!(\"unsupported remote cache digest algorithm\");\n        }\n        if self.hash.len() != 64\n            || !self\n                .hash\n                .bytes()\n                .all(|byte| byte.is_ascii_digit() || (b'a'..=b'f').contains(&byte))\n        {\n            bail!(\"invalid remote cache digest\");\n        }\n        Ok(())\n    }\n\n    pub fn matches_bytes(&self, bytes: &[u8]) -> Result<bool> {\n        self.validate()?;\n        if self.size != bytes.len() as u64 {\n            return Ok(false);\n        }\n        let hash = match self.algorithm.as_str() {","sourceCodeStart":102,"sourceCodeEnd":138,"githubUrl":"https://github.com/jdx/mise/blob/533346cc374382b41ec5ff70536252b2e96e725c/crates/mise-cache-core/src/lib.rs#L102-L138","documentation":"Digest::validate on a remote-cache descriptor rejected the `algorithm` field: only \"blake3\" and \"sha256\" are recognized, so any other string (typo, new algorithm, corrupted metadata) fails validation before the digest is used for cache matching or blob transfer.","triggerScenarios":"Thrown at crates/mise-cache-core/src/lib.rs:120 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Emit digests with algorithm \"blake3\" (the default produced by Digest::blake3*) or \"sha256\"","Regenerate the cache entry with the current mise version if the metadata was written by an incompatible client","Report the mismatch if the server advertises an algorithm mise does not support"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"533346cc374382b41ec5ff70536252b2e96e725c","analyzedAt":"2026-09-17T13:35:38.149Z","contentChangedAt":"2026-09-17T13:35:38.149Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}