{"record":{"id":"96732af045bcc3f2","repo":"jdx/mise","slug":"lockfile-contains-multiple-optionless-resolutions","errorCode":null,"errorMessage":"lockfile contains multiple optionless resolutions for {short}@{specifier}","messagePattern":"lockfile contains multiple optionless resolutions for (.+?)@(.+?)","errorType":"error_code","errorClass":"AmbiguousRequestBinding","httpStatus":null,"severity":"error","filePath":"src/lockfile.rs","lineNumber":4285,"sourceCode":"            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\",\n                        found.version\n                    );\n                    return Ok(binding_options(found)?\n                        .map(|(options, _)| lockfile_tool_with_request_options(found, &options)));\n                }\n                _ => bail!(AmbiguousRequestBinding(format!(\n                    \"lockfile contains multiple optionless resolutions for {short}@{specifier}\"\n                ))),\n            }\n\n            // Mixed-format monorepo migration can temporarily place legacy\n            // entries without bindings in a version-1 file. Keep those pins\n            // reachable until a successful full format upgrade binds them.\n            let version_matches = |v: &LockfileTool| {\n                v.specifiers.is_empty()\n                    && lockfile_version_matches(prefix, &v.version)\n                    && (!require_prefix_boundary\n                        || lockfile_version_matches_prefix_boundary(prefix, &v.version))\n            };\n            let matching = tools\n                .iter()\n                .filter(|v| version_matches(v) && &v.options == request_options)\n                .collect_vec();\n            if let Some(found) = select_unbound_lockfile_tool(matching, backend, selection_options)?","sourceCodeStart":4267,"sourceCodeEnd":4303,"githubUrl":"https://github.com/jdx/mise/blob/533346cc374382b41ec5ff70536252b2e96e725c/src/lockfile.rs#L4267-L4303","documentation":"This is the legacy-fallback form of the ambiguity check: when no request-bound entry matched, mise looks for optionless (legacy-format) entries for the same short@specifier that may keep a version pin. If more than one such optionless entry exists, the pin itself is ambiguous, so mise raises AmbiguousRequestBinding rather than guessing which pinned version to keep.","triggerScenarios":"A lockfile that mixes version-0 legacy entries into a version-1 file (e.g. after a partial monorepo migration) contains two or more optionless rows for the same tool and specifier; hand-edited or conflict-resolved lockfiles duplicating legacy entries.","commonSituations":"Mixed-format monorepo state mid-migration where multiple branches contributed unbound legacy entries; manually consolidated lockfiles after a bad merge; older lockfiles imported repeatedly.","solutions":["Deduplicate the optionless entries for that tool@specifier, keeping one pin, then rerun.","Run `mise lock --upgrade` at the monorepo root to fully rebind legacy entries into the current format.","Regenerate the lockfile (`mise lock`) so the mixed legacy entries are consolidated."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"# detect duplicate optionless entries for a tool before running mise\nyq '[.tools.node[] | select(has(\"options\") | not)] | length' mise.lock  # expect <= 1","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Complete monorepo format migration (`mise lock --upgrade`) before merging branches.","Regenerate rather than hand-merge lockfiles containing legacy entries.","Avoid mixing version-0 lockfiles into version-1 files across branches."],"tags":["lockfile","ambiguity","legacy-format","duplicate-entries"],"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"}