{"record":{"id":"e0a4b491a5753a55","repo":"jdx/mise","slug":"global-configuration-directory-must-not-be-a-symli","errorCode":null,"errorMessage":"global configuration directory must not be a symlink","messagePattern":"global configuration directory must not be a symlink","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/system/remote_repository.rs","lineNumber":194,"sourceCode":"        &global_directory(),\n    )\n}\n\nfn install_at(\n    bundle: &Path,\n    origin: &str,\n    revision: &str,\n    update: bool,\n    yes: bool,\n    dry_run: bool,\n    destination: &Path,\n) -> Result<PathBuf> {\n    validate_origin(origin)?;\n    if !matches!(revision.len(), 40 | 64) || !revision.bytes().all(|b| b.is_ascii_hexdigit()) {\n        bail!(\"invalid pinned revision\");\n    }\n    if destination.is_symlink() {\n        bail!(\"global configuration directory must not be a symlink\");\n    }\n    let parent = destination\n        .parent()\n        .ok_or_else(|| eyre::eyre!(\"missing parent directory\"))?;\n    if !dry_run {\n        std::fs::create_dir_all(parent)?;\n    }\n    let _lock = crate::lock_file::LockFile::new(destination).lock()?;\n    // the checkout is renamed into place, so it is staged next to the\n    // destination; a dry run never renames and leaves the parent alone\n    let temporary = if dry_run {\n        tempfile::tempdir()?\n    } else {\n        tempfile::tempdir_in(parent)?\n    };\n    let checkout = temporary.path().join(\"checkout\");\n    let shown = crate::file::display_path(destination);\n    let mut command = Command::new(\"git\");","sourceCodeStart":176,"sourceCodeEnd":212,"githubUrl":"https://github.com/jdx/mise/blob/533346cc374382b41ec5ff70536252b2e96e725c/src/system/remote_repository.rs#L176-L212","documentation":"install_at refuses to install into a destination that is a symbolic link. The global configuration directory (e.g. ~/.config/mise) is managed in place; replacing or writing through a symlink risks corrupting or escaping the intended install target, so it is rejected up front.","triggerScenarios":"Calling install / install_at / install_source / preview_source where `destination.is_symlink()` is true — e.g. the destination path itself was replaced by a symlink by a dotfile manager (stow, chezmoi, dotbot).","commonSituations":"Dotfile managers symlinking ~/.config/mise to a synced folder; users manually linking config dirs across filesystems; restoring from backups that turned directories into links.","solutions":["Remove the symlink and create a real directory at the destination (`rm <dest> && mkdir <dest>`), migrating contents first.","Reconfigure your dotfile manager to manage files *inside* the directory rather than the directory itself.","Choose a different non-symlink destination path if supported by your tooling."],"exampleFix":"// before\n$ ls -la ~/.config/mise\nmise -> /mnt/dotfiles/mise   # symlink\n// after\n$ rm ~/.config/mise\n$ mkdir ~/.config/mise\n$ cp -a /mnt/dotfiles/mise/. ~/.config/mise/","handlingStrategy":"validation","validationCode":"const st = fs.lstatSync(destination);\nif (st.isSymbolicLink()) throw new Error(\"destination must be a real directory, not a symlink\");","typeGuard":"function isRealDir(p: string): boolean { try { return fs.lstatSync(p).isDirectory(); } catch { return false; } }","tryCatchPattern":null,"preventionTips":["Configure dotfile managers (stow/chezmoi) to manage files inside ~/.config/mise, not the directory itself.","Check `ls -la` for symlinks before running onboarding."],"tags":["filesystem","symlink","validation","install"],"backgroundTag":"invalid-config-value","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"}