{"record":{"id":"4a536873788e0885","repo":"jdx/mise","slug":"python-dependency-graphs-require-lockfile-revision-2-run","errorCode":null,"errorMessage":"Python dependency graphs require lockfile revision 2; run `mise lock --upgrade`","messagePattern":"Python dependency graphs require lockfile revision 2; run `mise lock --upgrade`","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/lockfile.rs","lineNumber":1246,"sourceCode":"                        graph.resolve_path(path)?;\n                    }\n                    if let Some(graph) = &mut entry.aube {\n                        graph.resolve_path(path)?;\n                    }\n                    Ok(entry)\n                })\n                .collect::<Result<Vec<_>>>()?;\n            lockfile.tools.entry(short).or_default().extend(versions);\n        }\n\n        if lockfile_version < 2\n            && lockfile\n                .tools\n                .values()\n                .flatten()\n                .any(|tool| tool.uv.is_some())\n        {\n            bail!(\n                \"Python dependency graphs require lockfile revision 2; run `mise lock --upgrade`\"\n            );\n        }\n\n        // Parse conda-packages section: platform -> basename -> CondaPackageInfo\n        if let Some(conda_packages) = table.remove(\"conda-packages\") {\n            let platforms: toml::Table = conda_packages.try_into()?;\n            for (platform, packages) in platforms {\n                let packages_table: toml::Table = packages.try_into()?;\n                for (basename, info) in packages_table {\n                    let info: CondaPackageInfo = info.try_into()?;\n                    lockfile\n                        .conda_packages\n                        .entry(platform.clone())\n                        .or_default()\n                        .insert(basename, info);\n                }\n            }","sourceCodeStart":1228,"sourceCodeEnd":1264,"githubUrl":"https://github.com/jdx/mise/blob/533346cc374382b41ec5ff70536252b2e96e725c/src/lockfile.rs#L1228-L1264","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","solutions":["Run `mise lock --upgrade` to rewrite the lockfile at revision 2 with the dependency graph intact.","Set `lockfile_version = 2` at the top of mise.lock if the body is already in revision-2 format, then re-run the command.","Delete mise.lock and regenerate it with the current mise (`mise lock`) if the contents are inconsistent."],"exampleFix":"# before (mise.lock)\nlockfile_version = 1\n[[tools.python]]\nuv = ...\n\n# after\n$ mise lock --upgrade\n# lockfile_version = 2","handlingStrategy":"validation","validationCode":"const ver = doc.get('lockfile_version') ?? 0;\nconst hasUv = (doc.get('tools') || []).some(t => 'uv' in t);\nif (ver < 2 && hasUv) throw new Error('run `mise lock --upgrade` before using Python dependency graphs');","typeGuard":null,"tryCatchPattern":"try {\n  mise('run', task);\n} catch (e) {\n  if (String(e).includes('lockfile revision 2')) {\n    execSync('mise lock --upgrade');\n  } else { throw e; }\n}","preventionTips":["Run `mise lock --upgrade` once when adopting Python dependency graphs.","Keep lockfile_version in sync when tool entries gain uv sections.","Watch merge conflicts around the lockfile_version header.","Standardize the team's mise version so revision features land together."],"tags":["lockfile","python","versioning","uv"],"backgroundTag":"feature-not-enabled","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"}