{"record":{"id":"0887621c1dc2c81b","repo":"jdx/mise","slug":"invalid-checksum-platform-key","errorCode":null,"errorMessage":"Invalid checksum: {platform_key}","messagePattern":"Invalid checksum: (.+?)","errorType":"exception","errorClass":"eyre::Report","httpStatus":null,"severity":"error","filePath":"src/backend/ubi.rs","lineNumber":410,"sourceCode":"        if let Some(exe) = opts.exe() {\n            platform_key = format!(\"{platform_key}-{exe}\");\n        }\n        if let Some(matching) = opts.matching() {\n            platform_key = format!(\"{platform_key}-{matching}\");\n        }\n        // Include filename to distinguish different downloads for the same platform\n        platform_key = format!(\"{platform_key}-{filename}\");\n\n        // Get or create platform info for this platform key\n        let platform_info = tv.lock_platforms.entry(platform_key.clone()).or_default();\n\n        if let Some(checksum) = &platform_info.checksum {\n            ctx.pr\n                .set_message(format!(\"checksum verify {platform_key}\"));\n            if let Some((algo, check)) = checksum.split_once(':') {\n                hash::ensure_checksum(file, check, Some(ctx.pr.as_ref()), algo)?;\n            } else {\n                bail!(\"Invalid checksum: {platform_key}\");\n            }\n        } else if Settings::get().lockfile_enabled() {\n            ctx.pr\n                .set_message(format!(\"checksum generate {platform_key}\"));\n            let hash = hash::file_hash_blake3(file, Some(ctx.pr.as_ref()))?;\n            platform_info.checksum = Some(format!(\"blake3:{hash}\"));\n        }\n        Ok(())\n    }\n\n    async fn list_bin_paths(\n        &self,\n        _config: &Arc<Config>,\n        tv: &ToolVersion,\n    ) -> eyre::Result<Vec<std::path::PathBuf>> {\n        let raw_opts = tv.request.options();\n        let opts = UbiOptions::new(&raw_opts);\n        if let Some(bin_path) = opts.bin_path() {","sourceCodeStart":392,"sourceCodeEnd":428,"githubUrl":"https://github.com/jdx/mise/blob/9dcfcaa0dc8747a2577d3270b69bb9d8313b2807/src/backend/ubi.rs#L392-L428","documentation":"When a mise.lock entry carries a checksum for a platform key, the ubi backend expects the format `algorithm:hexdigest` and splits on the first colon to pick the hash algorithm. A stored value without a colon cannot be parsed, so the checksum verification step bails with 'Invalid checksum: <platform_key>' (src/backend/ubi.rs:410).","triggerScenarios":"A mise.lock file whose lock_platforms.<platform>.checksum value is a bare hex digest (no `blake3:` prefix) — typically from hand-editing the lockfile, a merge conflict resolution, or an older lockfile format. Hits during install/verify of the matching platform asset.","commonSituations":"Editing mise.lock to paste a sha256 from a vendor site without the algo prefix; git merge conflicts in mise.lock resolved by keeping only the hash; tools that regenerate lockfiles with a non-conforming format.","solutions":["Fix the lockfile value to `blake3:<hash>` (algorithm, colon, digest), e.g. blake3:af39c1...","Or delete the tool's entry (or the whole mise.lock) and re-run mise install to have mise regenerate conforming checksums","Avoid manual checksum edits; use MISE_LOCKFILE settings or mise's own generation instead"],"exampleFix":"# before (mise.lock)\n[tools.ubi.org\\tool.v1.0.0.lock_platforms.\"x86_64-linux-tool.tar.gz\"]\nchecksum = \"af39c1a5d2...\"\n\n# after\nchecksum = \"blake3:af39c1a5d2...\"","handlingStrategy":"validation","validationCode":"# Validate every lockfile checksum has an algo prefix\nfn checksum_ok(v: &str) -> bool {\n    match v.split_once(':') {\n        Some((algo, hash)) => !algo.is_empty() && !hash.is_empty(),\n        None => false,\n    }\n}\nassert!(checksum_ok(\"blake3:0f9c...\"));\nassert!(!checksum_ok(\"0f9c...\"));","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Never paste bare hashes into mise.lock — include the algorithm prefix","Resolve mise.lock merge conflicts by regenerating (delete and mise install) instead of hand-merging","Add a CI grep for checksum lines lacking a colon"],"tags":["mise","lockfile","checksum","ubi","config-validation"],"backgroundTag":"invalid-checksum-format","analyzedSha":"9dcfcaa0dc8747a2577d3270b69bb9d8313b2807","analyzedAt":"2026-08-17T14:28:50.624Z","schemaVersion":2},"datasetVersion":"2026-08-21T13:17:26.733Z"}