{"record":{"id":"45940efdf9bf032e","repo":"jdx/mise","slug":"invalid-checksum-checksum-45940e","errorCode":null,"errorMessage":"Invalid checksum: {checksum}","messagePattern":"Invalid checksum: (.+?)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/backend/mod.rs","lineNumber":4324,"sourceCode":"\n        if let Some(checksum) = &locked.checksum {\n            ctx.pr.set_message(format!(\"checksum {filename}\"));\n            if let Some((algo, check)) = checksum.split_once(':') {\n                hash::ensure_checksum(file, check, Some(ctx.pr.as_ref()), algo).wrap_err_with(\n                    || {\n                        // Name the lock entry the expectation came from: a mismatch\n                        // usually means the entry describes a different artifact\n                        // than the one this machine downloads (e.g. a Swift build\n                        // for another Linux distro).\n                        let entry = self.describe_lock_entry(tv, &platform_key);\n                        match &locked.url {\n                            Some(url) => format!(\"{entry} locks {url}\"),\n                            None => entry,\n                        }\n                    },\n                )?;\n            } else {\n                bail!(\"Invalid checksum: {checksum}\");\n            }\n        } else if lockfile_enabled {\n            ctx.pr.set_message(format!(\"generate checksum {filename}\"));\n            let hash = hash::file_hash_blake3(file, Some(ctx.pr.as_ref()))?;\n            tv.lock_platforms\n                .entry(platform_key.clone())\n                .or_default()\n                .checksum = Some(format!(\"blake3:{hash}\"));\n        }\n\n        // Handle size verification and generation\n        if let Some(expected_size) = locked.size {\n            ctx.pr.set_message(format!(\"verify size {filename}\"));\n            let actual_size = file.metadata()?.len();\n            if actual_size != expected_size {\n                bail!(\n                    \"Size mismatch for {}: expected {}, got {}\",\n                    filename,","sourceCodeStart":4306,"sourceCodeEnd":4342,"githubUrl":"https://github.com/jdx/mise/blob/533346cc374382b41ec5ff70536252b2e96e725c/src/backend/mod.rs#L4306-L4342","documentation":"During checksum verification/generation, mise compares the downloaded file's hash against the locked checksum. If the lockfile entry's checksum is in an unparseable/unsupported format (the code reached the else branch where neither a URL-locked nor otherwise valid checksum representation exists), it bails with \"Invalid checksum\". This prevents silently trusting a malformed lockfile entry.","triggerScenarios":"A lockfile entry contains a checksum string that mise cannot parse into a known hash format (hand-edited lockfile, checksum from another tool's format, corrupted lock entry); the verification code path finds Some(checksum) but the value does not match any supported representation.","commonSituations":"Manually editing mise.lock and pasting an sha256 hex digest in the wrong field/format; merging lockfile changes from a different mise version; a lockfile generated by another tool.","solutions":["Run `mise lock` (or `mise install --locked=false` once) to regenerate the lockfile checksum entries.","Delete the bad lockfile entry or the whole mise.lock and let mise regenerate it.","If hand-editing, use the exact checksum format mise writes (per-platform entries with the algorithm mise expects, e.g. blake3/sha256 fields as in existing entries)."],"exampleFix":"// before (hand-edited mise.lock)\nchecksum = \"9f86d081884c7d65...\"  # wrong field/format\n\n// after\n$ mise lock   # regenerate valid checksum entries","handlingStrategy":"validation","validationCode":"// validate lockfile checksum fields match mise's format before installing\ngrep -n 'checksum' mise.lock  # inspect entries; regenerate instead of hand-editing","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Never hand-edit mise.lock checksums; use `mise lock`","Commit lockfiles generated by the same mise version as CI","If a checksum must be verified manually, compare against upstream's published hash in mise's format"],"tags":["lockfile","checksum","verification"],"backgroundTag":"checksum-mismatch","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"}