jdx/mise · error · AmbiguousRequestBinding

lockfile contains multiple resolutions for

Error message

lockfile contains multiple resolutions for {short}@{specifier} with the same options

What it means

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.

Solutions

  1. Resolve the git conflict/duplicate by keeping only one entry for that tool@specifier with those options, then rerun the command.
  2. Regenerate the lockfile cleanly: delete the duplicate entries (or the whole lockfile if trusted) and run `mise lock` to rebuild bindings.
  3. Report/pin to a mise version where duplicate rows are pruned on generation; the generator counts distinct entries to reject duplicates going forward.
Defensive patterns

Strategy: validation

Validate before calling

# fail CI when a tool+specifier appears more than once
yq '[.tools.node[] | select(.specifier == "20")] | length' mise.lock  # expect <= 1

Prevention

When it happens

Trigger: 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.

Common situations: 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.

Understand the failure class

Background: Schema validation failed / invalid input schema: payload rejected because its shape doesn't match the expected schema — this error's family across 28 libraries.

Related errors


AI-assisted analysis of jdx/mise@533346cc37 (2026-09-17). Data as JSON: /api/errors/a1b2dd8fe289ba7d. Report an issue: GitHub.

Appendix: source

Thrown at src/lockfile.rs:4261

                backend.lockfile_options_are_host_specific(),
            )));
        }
        Ok(Some((request_options.clone(), legacy_options_fallback)))
    };
    if let Some(tools) = lockfile.tools_for(short) {
        if lockfile.uses_request_bindings() {
            let (matching, binding_error) =
                matching_request_bindings(lockfile.as_ref(), short, specifier, |tool| {
                    Ok(binding_options(tool)?.is_some_and(|(options, _)| tool.options == options))
                });
            match matching.as_slice() {
                [] => {}
                [found] => {
                    trace!("[{short}@{specifier}] found {} in lockfile", found.version);
                    return Ok(Some((*found).clone()));
                }
                _ => {
                    bail!(AmbiguousRequestBinding(format!(
                        "lockfile contains multiple resolutions for {short}@{specifier} with the same options"
                    )))
                }
            }

            let (legacy, legacy_error) =
                matching_request_bindings(lockfile.as_ref(), short, specifier, |tool| {
                    Ok(
                        binding_options(tool)?.is_some_and(|(options, allow_fallback)| {
                            allow_fallback && !options.is_empty() && tool.options.is_empty()
                        }),
                    )
                });
            match legacy.as_slice() {
                [] => {}
                [found] => {
                    trace!(
                        "[{short}@{specifier}] found {} in lockfile without options, keeping the version pin and dropping its artifact data",

View on GitHub (pinned to 533346cc37)