{"record":{"id":"a1b2dd8fe289ba7d","repo":"jdx/mise","slug":"lockfile-contains-multiple-resolutions-for-short","errorCode":null,"errorMessage":"lockfile contains multiple resolutions for {short}@{specifier} with the same options","messagePattern":"lockfile contains multiple resolutions for (.+?)@(.+?) with the same options","errorType":"error_code","errorClass":"AmbiguousRequestBinding","httpStatus":null,"severity":"error","filePath":"src/lockfile.rs","lineNumber":4261,"sourceCode":"                backend.lockfile_options_are_host_specific(),\n            )));\n        }\n        Ok(Some((request_options.clone(), legacy_options_fallback)))\n    };\n    if let Some(tools) = lockfile.tools_for(short) {\n        if lockfile.uses_request_bindings() {\n            let (matching, binding_error) =\n                matching_request_bindings(lockfile.as_ref(), short, specifier, |tool| {\n                    Ok(binding_options(tool)?.is_some_and(|(options, _)| tool.options == options))\n                });\n            match matching.as_slice() {\n                [] => {}\n                [found] => {\n                    trace!(\"[{short}@{specifier}] found {} in lockfile\", found.version);\n                    return Ok(Some((*found).clone()));\n                }\n                _ => {\n                    bail!(AmbiguousRequestBinding(format!(\n                        \"lockfile contains multiple resolutions for {short}@{specifier} with the same options\"\n                    )))\n                }\n            }\n\n            let (legacy, legacy_error) =\n                matching_request_bindings(lockfile.as_ref(), short, specifier, |tool| {\n                    Ok(\n                        binding_options(tool)?.is_some_and(|(options, allow_fallback)| {\n                            allow_fallback && !options.is_empty() && tool.options.is_empty()\n                        }),\n                    )\n                });\n            match legacy.as_slice() {\n                [] => {}\n                [found] => {\n                    trace!(\n                        \"[{short}@{specifier}] found {} in lockfile without options, keeping the version pin and dropping its artifact data\",","sourceCodeStart":4243,"sourceCodeEnd":4279,"githubUrl":"https://github.com/jdx/mise/blob/533346cc374382b41ec5ff70536252b2e96e725c/src/lockfile.rs#L4243-L4279","documentation":"In a request-binding (version >=1) lockfile, mise matches a tool request like `node@20` to lockfile entries whose recorded options exactly equal the request's resolved options. If more than one entry for the same short name and specifier has identical options, the resolution is ambiguous — mise cannot tell which pinned version/artifact to use — so it raises AmbiguousRequestBinding instead of silently picking one.","triggerScenarios":"A hand-edited or badly merged lockfile containing duplicate rows for the same tool+specifier+options; a merge conflict resolved by keeping both versions of an entry; a lockfile-generation bug writing the same binding twice.","commonSituations":"Git merge of mise.lock where both branches added the same tool resolution with different pins; scripts that append entries to mise.lock manually; rebasing feature branches that both regenerated the lockfile.","solutions":["Resolve the git conflict/duplicate by keeping only one entry for that tool@specifier with those options, then rerun the command.","Regenerate the lockfile cleanly: delete the duplicate entries (or the whole lockfile if trusted) and run `mise lock` to rebuild bindings.","Report/pin to a mise version where duplicate rows are pruned on generation; the generator counts distinct entries to reject duplicates going forward."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"# fail CI when a tool+specifier appears more than once\nyq '[.tools.node[] | select(.specifier == \"20\")] | length' mise.lock  # expect <= 1","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Resolve merge conflicts in mise.lock by regenerating (`mise lock`) rather than hand-merging.","Never append or duplicate entries in mise.lock manually.","Review lockfile diffs in PRs for duplicated tool rows."],"tags":["lockfile","ambiguity","duplicate-entries","merge-conflict"],"backgroundTag":"schema-validation-failed","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"}