jdx/mise · error

symlink target

Error message

symlink target

What it means

Panic in src/shims.rs is_mise_shim: a path is known to be a symlink (is_symlink() returned true), so resolved_symlink_target is expected to always return Some. An None target means the symlink metadata vanished or could not be resolved between the check and the read — a race or filesystem inconsistency rather than normal usage.

Source

Thrown at src/shims.rs:891

        target
            .file_name()
            .and_then(|name| name.to_str())
            .is_some_and(is_mise_dispatcher_name)
    }))
}

fn is_mise_shim(path: &Path, mise_bin: &Path) -> Result<bool> {
    if path
        .file_name()
        .and_then(|name| name.to_str())
        .is_some_and(is_mise_dispatcher_name)
    {
        // A package manager may install mise itself as a symlink in the shared
        // directory. It is the dispatcher, not one of its shims.
        return Ok(false);
    }
    if path.is_symlink() {
        let target = resolved_symlink_target(path)?.expect("symlink target");
        return Ok(file::paths_eq(
            &file::canonicalize_or_self(&target),
            &file::canonicalize_or_self(mise_bin),
        ));
    }

    #[cfg(windows)]
    {
        if !path.is_file() {
            return Ok(false);
        }
        let parent = path.parent().unwrap_or_else(|| Path::new("."));
        if is_dedicated_shims_dir(parent) {
            // Preserve the existing upgrade behavior in mise's dedicated
            // farms. Native copies from an older mise cannot be identified by
            // their contents after mise-shim.exe changes. Use the same
            // unredirected check as pruning so a junction to a shared bin
            // directory never grants ownership of every regular file there.

View on GitHub (pinned to afd2eddd3a)

Solutions

  1. Re-run the mise command — transient races usually resolve once the directory is stable.
  2. Ensure no concurrent process (another mise, sync tool, antivirus) is deleting shims while mise runs.
  3. Recreate the shims directory contents: mise reshard / re-run `mise reshim` to rebuild consistent symlinks.
  4. Report a bug if reproducible on a local filesystem — the expect assumes readlink succeeds right after is_symlink().
Defensive patterns

Strategy: retry

Try / catch

match resolved_symlink_target(path) {
    Ok(Some(t)) => /* compare t to mise_bin */,
    Ok(None) | Err(_) => /* treat as not-a-shim or retry the scan */,
}

Prevention

When it happens

Trigger: Another process deletes or replaces the shim symlink concurrently while publish_staged_shim_farm or get_actual_shims scans the shims directory; exotic filesystems returning inconsistent symlink metadata.

Common situations: Parallel mise invocations or package managers mutating the shared shims directory; network/overlay filesystems (NFS, Docker volumes) with racy symlink resolution.

Understand the failure class

Background: "This is a bug, please report it": internal invariant violations, unreachable panics, and SNH errors explained — this error's family across 47 libraries.

Related errors


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