jdx/mise · error · eyre::Report

Invalid checksum: {checksum}

Error message

Invalid checksum: {checksum}

What it means

During generic lockfile verification (Backend::install path in backend/mod.rs), mise validates a downloaded artifact's checksum stored in tv.lock_platforms. The string must be `algorithm:value` (split_once(':')); a checksum with no colon cannot name its hash algorithm, so it is rejected before any hashing — unlike a plain mismatch, which produces a richer lock-entry message.

Source

Thrown at src/backend/mod.rs:4043

        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 6f52dcdf99)

Solutions

  1. Fix the entry to `algorithm:digest` form, e.g. `blake3:...` or `sha256:...`
  2. Delete the tool's lock entry and run `mise lock` to regenerate it correctly
  3. Treat mise.lock as generated output — re-lock instead of hand-editing checksums

Example fix

# before (mise.lock)
checksum = "9a4f2c..."
# after
checksum = "blake3:9a4f2c..."
Defensive patterns

Strategy: validation

Validate before calling

# preflight: all lockfile checksums must carry an algorithm prefix
yq '.tools[].lock_platforms[].checksum' mise.lock | grep -vE '^[a-z0-9]+:' && echo 'bad checksum format' || echo ok

Prevention

When it happens

Trigger: A mise.lock entry's checksum field contains a bare digest (no `blake3:`/`sha256:` prefix) — hand-edited lockfile, entries written by older/external tooling, or programmatically generated locks — and the corresponding tool is reinstalled while lockfile verification runs.

Common situations: Editing mise.lock to update a checksum from a release's SHA256SUMS file and forgetting the algorithm prefix; lockfile migrations or merges that mangle the field; scripts that regenerate lock entries with raw digests.

Related errors


AI-assisted analysis of jdx/mise@6f52dcdf99 (2026-08-22). Data as JSON: /api/errors/45940efdf9bf032e. Report an issue: GitHub.