{"record":{"id":"78cea1e1f5651c78","repo":"jdx/mise","slug":"path-component-was-concurrently-created-by-anot","errorCode":null,"errorMessage":"path component {} was concurrently created by another user","messagePattern":"path component (.+?) was concurrently created by another user","errorType":"error_code","errorClass":"eyre::Report","httpStatus":null,"severity":"error","filePath":"src/system/managed_files.rs","lineNumber":1740,"sourceCode":"                        });\n                    }\n                };\n                let created = openat(&directory, name.as_os_str(), flags, Mode::empty())\n                    .wrap_err_with(|| {\n                        format!(\n                            \"failed to open newly available path component {} without following symlinks\",\n                            component_path.display()\n                        )\n                    })?;\n                let stat = nix::sys::stat::fstat(&created)?;\n                if stat.st_uid != nix::unistd::geteuid().as_raw() {\n                    if created_by_us {\n                        bail!(\n                            \"created path component {} was replaced before it could be opened\",\n                            component_path.display()\n                        );\n                    } else {\n                        bail!(\n                            \"path component {} was concurrently created by another user\",\n                            component_path.display()\n                        );\n                    }\n                }\n                created\n            }\n        };\n        current.push(name);\n    }\n    Ok(directory)\n}\n\n#[cfg(unix)]\nfn set_directory_metadata(\n    directory: &std::os::fd::OwnedFd,\n    owner: Option<&str>,\n    group: Option<&str>,","sourceCodeStart":1722,"sourceCodeEnd":1758,"githubUrl":"https://github.com/jdx/mise/blob/533346cc374382b41ec5ff70536252b2e96e725c/src/system/managed_files.rs#L1722-L1758","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","solutions":["Chown the component to your user (sudo chown -R $USER <path>) or remove it so mise can recreate it","Avoid sharing mise data paths between different Unix users","Run mise as the same user that owns the directories"],"exampleFix":"// before\nsudo mise install node  # creates dirs owned by root\n// after\nmise install node      # run as your user, or chown -R $USER ~/.local/share/mise","handlingStrategy":"validation","validationCode":"import os\ndef components_owned_by_me(root):\n    uid = os.geteuid()\n    return all(os.stat(os.path.join(dp, f)).st_uid == uid\n               for dp, _, fs in os.walk(root) for f in fs)","typeGuard":null,"tryCatchPattern":"match result {\n    Err(e) if e.to_string().contains(\"concurrently created by another user\") => {\n        // chown or remove the foreign-owned component, then retry\n    }\n    r => r,\n}","preventionTips":["Never run mise under sudo against user-owned data dirs","Use per-user data directories, not shared ones","After switching users, chown -R the mise data directories back","Avoid shared group-writable install prefixes"],"tags":["filesystem","ownership","permissions","race-condition"],"backgroundTag":"permission-denied","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"}