{"record":{"id":"df02310851888dba","repo":"jdx/mise","slug":"cannot-merge-lockfile-version-from-into-lock","errorCode":null,"errorMessage":"cannot merge lockfile version {} from {} into lockfile version {} at {}; run `mise lock --upgrade` at the monorepo root","messagePattern":"cannot merge lockfile version (.+?) from (.+?) into lockfile version (.+?) at (.+?); run `mise lock --upgrade` at the monorepo root","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/lockfile.rs","lineNumber":2231,"sourceCode":"            Lockfile::read(target).unwrap_or_else(|err| handle_lockfile_read_error(err, target));\n        let subproject_lockfile = match Lockfile::read(source) {\n            Ok(lockfile) => lockfile,\n            Err(err) if is_not_found_report(&err) => continue,\n            Err(err) => return Err(err),\n        };\n        if !target_existed {\n            root_lockfile.lockfile_version = subproject_lockfile.lockfile_version;\n        } else if root_lockfile.lockfile_version != subproject_lockfile.lockfile_version\n            && allow_format_upgrade\n        {\n            // Keep the newer format so request bindings from either input remain\n            // serialized if the subsequent rebuild fails. Entries imported from\n            // version 0 remain reachable through the unbound-entry fallback.\n            root_lockfile.lockfile_version = root_lockfile\n                .lockfile_version\n                .max(subproject_lockfile.lockfile_version);\n        } else if root_lockfile.lockfile_version != subproject_lockfile.lockfile_version {\n            bail!(\n                \"cannot merge lockfile version {} from {} into lockfile version {} at {}; run `mise lock --upgrade` at the monorepo root\",\n                subproject_lockfile.lockfile_version,\n                display_path(source),\n                root_lockfile.lockfile_version,\n                display_path(target)\n            );\n        }\n        merge_lockfile_preserving_root(&mut root_lockfile, subproject_lockfile);\n        root_lockfile.save(target)?;\n        if let Err(err) = fs::remove_file(source)\n            && err.kind() != ErrorKind::NotFound\n        {\n            return Err(err.into());\n        }\n        remove_migrated_sidecars(source, target)?;\n        migrated += 1;\n    }\n","sourceCodeStart":2213,"sourceCodeEnd":2249,"githubUrl":"https://github.com/jdx/mise/blob/533346cc374382b41ec5ff70536252b2e96e725c/src/lockfile.rs#L2213-L2249","documentation":"When mise merges a subproject (legacy) lockfile into the monorepo root lockfile, the two files must use the same lockfile_version unless format upgrades are allowed for this operation. Hitting this branch means the root and subproject versions differ and `allow_format_upgrade` was false, so mise refuses to guess which format to keep and directs you to run `mise lock --upgrade` at the monorepo root, which enables upgrade mode.","triggerScenarios":"Running ordinary commands (install/exec, non-upgrade migration paths) while a subproject `mise.lock` with a different lockfile_version than the root lockfile exists and needs migrating into the root; committing a new-format root lockfile while a teammate still has an old-format subproject lockfile on disk.","commonSituations":"Mixed-version team after a mise upgrade: one machine regenerated the lockfile in the new format, another checkout still has version-0/old subproject lockfiles; branch merges that combine old and new lockfiles; stale subproject lockfiles left behind after switching to monorepo-root locking.","solutions":["Run `mise lock --upgrade` at the monorepo root to migrate all subproject lockfiles into the root with the newer format.","Delete or commit/regenerate stale subproject lockfiles so root and subproject versions agree.","After upgrading, commit the regenerated root lockfile so teammates get matching formats."],"exampleFix":"// before: plain install hits the version mismatch\nmise install\n// after: upgrade formats at the root first\ncd <monorepo-root> && mise lock --upgrade && mise install","handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":["Run `mise lock --upgrade` at the monorepo root immediately after upgrading mise.","Keep legacy subproject lockfiles out of the repo once the root lockfile exists.","Pin the same mise version across the team and CI so lockfile formats stay in sync."],"tags":["lockfile","monorepo","migration","version-mismatch"],"backgroundTag":"incompatible-source-type","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"}