jdx/mise · error

Python dependency graphs require lockfile revision 2; run…

Error message

Python dependency graphs require lockfile revision 2; run `mise lock --upgrade`

What it means

Lockfile revision 2 added support for embedding Python (uv) dependency graphs. When reading a lockfile whose revision is 1 (or unset) while any tool entry carries a `uv` section, mise bails rather than silently dropping dependency-graph data, and tells the user to upgrade the lockfile.

Solutions

  1. Run `mise lock --upgrade` to rewrite the lockfile at revision 2 with the dependency graph intact.
  2. Set `lockfile_version = 2` at the top of mise.lock if the body is already in revision-2 format, then re-run the command.
  3. Delete mise.lock and regenerate it with the current mise (`mise lock`) if the contents are inconsistent.

Example fix

# before (mise.lock)
lockfile_version = 1
[[tools.python]]
uv = ...

# after
$ mise lock --upgrade
# lockfile_version = 2
Defensive patterns

Strategy: validation

Validate before calling

const ver = doc.get('lockfile_version') ?? 0;
const hasUv = (doc.get('tools') || []).some(t => 'uv' in t);
if (ver < 2 && hasUv) throw new Error('run `mise lock --upgrade` before using Python dependency graphs');

Try / catch

try {
  mise('run', task);
} catch (e) {
  if (String(e).includes('lockfile revision 2')) {
    execSync('mise lock --upgrade');
  } else { throw e; }
}

Prevention

When it happens

Trigger: Running a command that loads the lockfile's Python dependency graph (e.g. `mise run` with python env, `mise lock`) against a revision-1 mise.lock that contains `uv` blocks — typically after upgrading mise features or merging a lockfile that lost its `lockfile_version = 2` header.

Common situations: Old lockfiles upgraded in place by hand-editing in uv data; merge conflicts that dropped the version bump; teams where one member regenerated uv entries with a newer mise but the header stayed at revision 1.

Related errors


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

Appendix: source

Thrown at src/lockfile.rs:1246

                        graph.resolve_path(path)?;
                    }
                    if let Some(graph) = &mut entry.aube {
                        graph.resolve_path(path)?;
                    }
                    Ok(entry)
                })
                .collect::<Result<Vec<_>>>()?;
            lockfile.tools.entry(short).or_default().extend(versions);
        }

        if lockfile_version < 2
            && lockfile
                .tools
                .values()
                .flatten()
                .any(|tool| tool.uv.is_some())
        {
            bail!(
                "Python dependency graphs require lockfile revision 2; run `mise lock --upgrade`"
            );
        }

        // Parse conda-packages section: platform -> basename -> CondaPackageInfo
        if let Some(conda_packages) = table.remove("conda-packages") {
            let platforms: toml::Table = conda_packages.try_into()?;
            for (platform, packages) in platforms {
                let packages_table: toml::Table = packages.try_into()?;
                for (basename, info) in packages_table {
                    let info: CondaPackageInfo = info.try_into()?;
                    lockfile
                        .conda_packages
                        .entry(platform.clone())
                        .or_default()
                        .insert(basename, info);
                }
            }

View on GitHub (pinned to 533346cc37)