{"record":{"id":"6ea2d21c1781ed64","repo":"jdx/mise","slug":"local-plugin-source-cannot-contain-be-or-be-insi","errorCode":null,"errorMessage":"local plugin source cannot contain, be, or be inside the plugin install path: {}","messagePattern":"local plugin source cannot contain, be, or be inside the plugin install path: (.+?)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/plugins/mod.rs","lineNumber":576,"sourceCode":"    if !source.is_dir() {\n        bail!(\n            \"local plugin source is not a directory: {}\",\n            display_path(source)\n        );\n    }\n    let resolved_source = file::desymlink_path(source);\n    let resolved_plugin_path = match (plugin_path.parent(), plugin_path.file_name()) {\n        (Some(parent), Some(file_name)) => file::desymlink_path(parent).join(file_name),\n        _ => plugin_path.to_path_buf(),\n    };\n    if resolved_source\n        .ancestors()\n        .any(|path| file::paths_eq(path, &resolved_plugin_path))\n        || resolved_plugin_path\n            .ancestors()\n            .any(|path| file::paths_eq(path, &resolved_source))\n    {\n        bail!(\n            \"local plugin source cannot contain, be, or be inside the plugin install path: {}\",\n            display_path(source)\n        );\n    }\n    Ok(())\n}\n\npub(crate) fn install_local_plugin_source(\n    plugin_path: &Path,\n    source: &Path,\n    pr: &dyn SingleReport,\n) -> Result<()> {\n    let parent = plugin_path.parent().ok_or_else(|| {\n        eyre!(\n            \"plugin install path has no parent: {}\",\n            display_path(plugin_path)\n        )\n    })?;","sourceCodeStart":558,"sourceCodeEnd":594,"githubUrl":"https://github.com/jdx/mise/blob/533346cc374382b41ec5ff70536252b2e96e725c/src/plugins/mod.rs#L558-L594","documentation":"After resolving the local plugin source and the plugin install path, mise rejects a source that would overlap the installation target: the source must not be the install path, inside it, or contain it. Installing from such a path would recursively copy/link a directory into itself, so the check compares both paths and their ancestors with `file::paths_eq` and bails.","triggerScenarios":"Running `mise plugin add <name> <path>` where `<path>` equals, is a parent of, or is nested inside the plugin install directory (`~/.local/share/mise/plugins/<name>`), including after `desymlink_path` resolution.","commonSituations":"Passing the mise data/plugins directory itself (or `~/.local/share/mise`) as the source; creating a plugin inside the plugins dir and then trying to 'install' it from there; symlinked home directories making a source path resolve under the install path.","solutions":["Move the plugin source outside the mise install path (e.g. a repo checkout under ~/src) and install from there.","If the plugin already lives where it should, use `mise plugin link <name> <path>` instead of installing/copying.","Check for symlink loops: resolve real paths of both the source and `~/.local/share/mise/plugins` and ensure neither contains the other."],"exampleFix":"// before\nmise plugin add myplugin ~/.local/share/mise/plugins/myplugin-src\n// after\ngit clone https://github.com/user/myplugin ~/src/myplugin\nmise plugin add myplugin ~/src/myplugin","handlingStrategy":"validation","validationCode":"const real = p => require('fs').realpathSync(p);\nconst install = real(require('os').homedir() + '/.local/share/mise/plugins/' + name);\nif (real(src).startsWith(install) || install.startsWith(real(src)))\n  throw new Error('plugin source overlaps install path');","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Keep plugin sources in a separate location (~/src, ~/plugins) away from ~/.local/share/mise.","Use `mise plugin link` for plugins you manage in place instead of copying from within the data dir."],"tags":["plugin","filesystem","paths-overlap"],"backgroundTag":"invalid-argument-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"}