jdx/mise · error

unsupported lockfile version {lockfile_version}; this mise s

Error message

unsupported lockfile version {lockfile_version}; this mise supports up to version {CURRENT_LOCKFILE_VERSION}

What it means

When parsing a mise.lock, the loader reads lockfile_version and rejects files whose version exceeds CURRENT_LOCKFILE_VERSION — the newest format this mise build understands. This forward-compatibility guard prevents mise from misinterpreting lockfile fields written by a newer release.

Source

Thrown at src/lockfile.rs:1017

        true
    }

    pub(crate) fn read<P: AsRef<Path>>(path: P) -> Result<Self> {
        let path = path.as_ref();
        if !path.exists() {
            return Ok(Lockfile::default());
        }
        trace!("reading lockfile {}", path.display_user());
        let content = file::read_to_string(path)?;
        let generated_header_url = existing_lockfile_doc_url(&content);
        let mut table: toml::Table = toml::from_str(&content)?;
        let lockfile_version = table
            .remove("lockfile_version")
            .map(|value| value.try_into())
            .transpose()?
            .unwrap_or(0);
        if lockfile_version > CURRENT_LOCKFILE_VERSION {
            bail!(
                "unsupported lockfile version {lockfile_version}; this mise supports up to version {CURRENT_LOCKFILE_VERSION}"
            );
        }

        let tools: toml::Table = table
            .remove("tools")
            .unwrap_or(toml::Table::new().into())
            .try_into()?;

        let mut lockfile = Lockfile {
            lockfile_version,
            generated_header_url,
            ..Default::default()
        };

        for (short, value) in tools {
            let versions = match value {
                toml::Value::Array(arr) => arr

View on GitHub (pinned to afd2eddd3a)

Solutions

  1. Upgrade mise to at least the version that wrote the lockfile (check `mise --version` vs the lockfile_version value)
  2. Run `mise lock --downgrade` (or delete/regenerate mise.lock) with the older mise to rewrite it in the supported version
  3. Pin the same mise version across CI and local environments (e.g. via mise's self-management)

Example fix

# before: lockfile_version = 4 written by mise 2026.9, running mise 2025.1
# after: upgrade mise, or rewrite lockfile
mise lock --downgrade  # or: rm mise.lock && mise lock
Defensive patterns

Strategy: fallback

Validate before calling

// Compare lockfile version against the running mise before relying on it
let v: u64 = toml::from_str::<toml::Value>(&txt)?.get("lockfile_version")
    .and_then(|v| v.as_integer()).unwrap_or(0) as u64;
let supported: u64 = /* CURRENT_LOCKFILE_VERSION of your mise */ 2;
if v > supported { eprintln!("lockfile v{v} newer than supported v{supported}; upgrade mise"); }

Try / catch

match parse_lockfile(txt) {
    Err(e) if e.to_string().contains("unsupported lockfile version") => {
        // regenerate with the current mise instead of failing hard
        regenerate_lockfile()?;
    }
    other => other?,
}

Prevention

When it happens

Trigger: Loading a mise.lock whose lockfile_version value is greater than the current binary's CURRENT_LOCKFILE_VERSION — i.e. the lockfile was written by a newer mise than the one reading it. Happens after downgrading mise, or when a teammate/tool with a newer mise regenerated the shared lockfile.

Common situations: Downgrading mise while a newer lockfile is checked in; CI running an older pinned mise than developers use locally; switching branches where one branch was upgraded with a newer mise.

Understand the failure class

Background: "is not a compatible type" / "cannot merge" errors: when a value's type doesn't match what the library requires — this error's family across 65 libraries.

Related errors


AI-assisted analysis of jdx/mise@afd2eddd3a (2026-09-09). Data as JSON: /api/errors/f6d5c60804288286. Report an issue: GitHub.