jdx/mise · error · eyre::Report

path component was concurrently created by another user

Error message

path component {} was concurrently created by another user

What it means

Same race window as the replaced-component error, but the case where the managed component already existed (was not created by this call): mise fstat()s the opened component and finds it owned by a different user, indicating another user concurrently created it. Mise refuses to use a directory it does not own.

Solutions

  1. Chown the component to your user (sudo chown -R $USER <path>) or remove it so mise can recreate it
  2. Avoid sharing mise data paths between different Unix users
  3. Run mise as the same user that owns the directories

Example fix

// before
sudo mise install node  # creates dirs owned by root
// after
mise install node      # run as your user, or chown -R $USER ~/.local/share/mise
Defensive patterns

Strategy: validation

Validate before calling

import os
def components_owned_by_me(root):
    uid = os.geteuid()
    return all(os.stat(os.path.join(dp, f)).st_uid == uid
               for dp, _, fs in os.walk(root) for f in fs)

Try / catch

match result {
    Err(e) if e.to_string().contains("concurrently created by another user") => {
        // chown or remove the foreign-owned component, then retry
    }
    r => r,
}

Prevention

When it happens

Trigger: Opening an existing path component in a managed directory tree whose st_uid differs from the current effective UID while created_by_us is false.

Common situations: Multi-user machines where /tmp or a shared prefix contains directories created by other accounts; switching between users (sudo/su) while using the same mise data directories; container volume mounts with foreign ownership.

Understand the failure class

Background: Permission denied / not authorized / 403 Forbidden: access-control rejections when the caller lacks the required role, grant, or ownership — this error's family across 18 libraries.

Related errors


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

Appendix: source

Thrown at src/system/managed_files.rs:1740

                        });
                    }
                };
                let created = openat(&directory, name.as_os_str(), flags, Mode::empty())
                    .wrap_err_with(|| {
                        format!(
                            "failed to open newly available path component {} without following symlinks",
                            component_path.display()
                        )
                    })?;
                let stat = nix::sys::stat::fstat(&created)?;
                if stat.st_uid != nix::unistd::geteuid().as_raw() {
                    if created_by_us {
                        bail!(
                            "created path component {} was replaced before it could be opened",
                            component_path.display()
                        );
                    } else {
                        bail!(
                            "path component {} was concurrently created by another user",
                            component_path.display()
                        );
                    }
                }
                created
            }
        };
        current.push(name);
    }
    Ok(directory)
}

#[cfg(unix)]
fn set_directory_metadata(
    directory: &std::os::fd::OwnedFd,
    owner: Option<&str>,
    group: Option<&str>,

View on GitHub (pinned to 533346cc37)