jdx/mise · error

Invalid checksum

Error message

Invalid checksum: {checksum}

What it means

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.

Solutions

  1. Run `mise lock` (or `mise install --locked=false` once) to regenerate the lockfile checksum entries.
  2. Delete the bad lockfile entry or the whole mise.lock and let mise regenerate it.
  3. 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).

Example fix

// before (hand-edited mise.lock)
checksum = "9f86d081884c7d65..."  # wrong field/format

// after
$ mise lock   # regenerate valid checksum entries
Defensive patterns

Strategy: validation

Validate before calling

// validate lockfile checksum fields match mise's format before installing
grep -n 'checksum' mise.lock  # inspect entries; regenerate instead of hand-editing

Prevention

When it happens

Trigger: 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.

Common situations: 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.

Understand the failure class

Background: Checksum mismatch errors: "checksum verification failed", "digest mismatch", "expected vs actual checksum" — what they mean and how to fix them — this error's family across 41 libraries.

Related errors


AI-assisted analysis of jdx/mise@533346cc37 (2026-09-17). Data as JSON: /api/errors/45940efdf9bf032e. Report an issue: GitHub.

Appendix: source

Thrown at src/backend/mod.rs:4324

        if let Some(checksum) = &locked.checksum {
            ctx.pr.set_message(format!("checksum {filename}"));
            if let Some((algo, check)) = checksum.split_once(':') {
                hash::ensure_checksum(file, check, Some(ctx.pr.as_ref()), algo).wrap_err_with(
                    || {
                        // Name the lock entry the expectation came from: a mismatch
                        // usually means the entry describes a different artifact
                        // than the one this machine downloads (e.g. a Swift build
                        // for another Linux distro).
                        let entry = self.describe_lock_entry(tv, &platform_key);
                        match &locked.url {
                            Some(url) => format!("{entry} locks {url}"),
                            None => entry,
                        }
                    },
                )?;
            } else {
                bail!("Invalid checksum: {checksum}");
            }
        } else if lockfile_enabled {
            ctx.pr.set_message(format!("generate checksum {filename}"));
            let hash = hash::file_hash_blake3(file, Some(ctx.pr.as_ref()))?;
            tv.lock_platforms
                .entry(platform_key.clone())
                .or_default()
                .checksum = Some(format!("blake3:{hash}"));
        }

        // Handle size verification and generation
        if let Some(expected_size) = locked.size {
            ctx.pr.set_message(format!("verify size {filename}"));
            let actual_size = file.metadata()?.len();
            if actual_size != expected_size {
                bail!(
                    "Size mismatch for {}: expected {}, got {}",
                    filename,

View on GitHub (pinned to 533346cc37)