{"record":{"id":"f6d5c60804288286","repo":"jdx/mise","slug":"unsupported-lockfile-version-lockfile-version-t","errorCode":null,"errorMessage":"unsupported lockfile version {lockfile_version}; this mise supports up to version {CURRENT_LOCKFILE_VERSION}","messagePattern":"unsupported lockfile version (.+?); this mise supports up to version (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/lockfile.rs","lineNumber":1017,"sourceCode":"        true\n    }\n\n    pub(crate) fn read<P: AsRef<Path>>(path: P) -> Result<Self> {\n        let path = path.as_ref();\n        if !path.exists() {\n            return Ok(Lockfile::default());\n        }\n        trace!(\"reading lockfile {}\", path.display_user());\n        let content = file::read_to_string(path)?;\n        let generated_header_url = existing_lockfile_doc_url(&content);\n        let mut table: toml::Table = toml::from_str(&content)?;\n        let lockfile_version = table\n            .remove(\"lockfile_version\")\n            .map(|value| value.try_into())\n            .transpose()?\n            .unwrap_or(0);\n        if lockfile_version > CURRENT_LOCKFILE_VERSION {\n            bail!(\n                \"unsupported lockfile version {lockfile_version}; this mise supports up to version {CURRENT_LOCKFILE_VERSION}\"\n            );\n        }\n\n        let tools: toml::Table = table\n            .remove(\"tools\")\n            .unwrap_or(toml::Table::new().into())\n            .try_into()?;\n\n        let mut lockfile = Lockfile {\n            lockfile_version,\n            generated_header_url,\n            ..Default::default()\n        };\n\n        for (short, value) in tools {\n            let versions = match value {\n                toml::Value::Array(arr) => arr","sourceCodeStart":999,"sourceCodeEnd":1035,"githubUrl":"https://github.com/jdx/mise/blob/afd2eddd3a50c16190efc1c7e94404b48f72af57/src/lockfile.rs#L999-L1035","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","solutions":["Upgrade mise to at least the version that wrote the lockfile (check `mise --version` vs the lockfile_version value)","Run `mise lock --downgrade` (or delete/regenerate mise.lock) with the older mise to rewrite it in the supported version","Pin the same mise version across CI and local environments (e.g. via mise's self-management)"],"exampleFix":"# before: lockfile_version = 4 written by mise 2026.9, running mise 2025.1\n# after: upgrade mise, or rewrite lockfile\nmise lock --downgrade  # or: rm mise.lock && mise lock","handlingStrategy":"fallback","validationCode":"// Compare lockfile version against the running mise before relying on it\nlet v: u64 = toml::from_str::<toml::Value>(&txt)?.get(\"lockfile_version\")\n    .and_then(|v| v.as_integer()).unwrap_or(0) as u64;\nlet supported: u64 = /* CURRENT_LOCKFILE_VERSION of your mise */ 2;\nif v > supported { eprintln!(\"lockfile v{v} newer than supported v{supported}; upgrade mise\"); }","typeGuard":null,"tryCatchPattern":"match parse_lockfile(txt) {\n    Err(e) if e.to_string().contains(\"unsupported lockfile version\") => {\n        // regenerate with the current mise instead of failing hard\n        regenerate_lockfile()?;\n    }\n    other => other?,\n}","preventionTips":["Pin the same mise version in CI and locally","Before downgrading mise, run `mise lock --downgrade` to rewrite the lockfile","Check lockfile_version in mise.lock after pulling teammate changes"],"tags":["lockfile","versioning","compatibility"],"backgroundTag":"incompatible-source-type","analyzedSha":"afd2eddd3a50c16190efc1c7e94404b48f72af57","analyzedAt":"2026-09-09T01:38:25.179Z","contentChangedAt":"2026-09-09T01:38:25.179Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}