{"record":{"id":"e0359af0d141dda3","repo":"jdx/mise","slug":"copy-link-is-not-a-symbolic-link","errorCode":null,"errorMessage":"copy_link is not a symbolic link: {}","messagePattern":"copy_link is not a symbolic link: (.+?)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/system/remote.rs","lineNumber":867,"sourceCode":"    for component in link.parent().unwrap_or_else(|| Path::new(\"\")).components() {\n        if let Component::Normal(component) = component {\n            parent.push(component);\n            let metadata = fs::symlink_metadata(&parent).wrap_err_with(|| {\n                format!(\"copy_link parent does not exist: {}\", parent.display())\n            })?;\n            if metadata.file_type().is_symlink() {\n                bail!(\n                    \"copy_link cannot be nested below a symbolic link: {}\",\n                    link.display()\n                );\n            }\n        }\n    }\n    let path = source.join(link);\n    let metadata = fs::symlink_metadata(&path)\n        .wrap_err_with(|| format!(\"copy_link does not exist: {}\", link.display()))?;\n    if !metadata.file_type().is_symlink() {\n        bail!(\"copy_link is not a symbolic link: {}\", link.display());\n    }\n    Ok(())\n}\n\nfn materialize_link(source: &Path, staged_source: &Path, link: &Path) -> Result<()> {\n    validate_copy_link_path(staged_source, link)\n        .wrap_err_with(|| format!(\"staged copy_link is unsafe: {}\", link.display()))?;\n    let source_link = source.join(link);\n    let staged_link = staged_source.join(link);\n    let target = fs::canonicalize(&source_link)\n        .wrap_err_with(|| format!(\"failed to resolve copy_link {}\", link.display()))?;\n    let parent = staged_link\n        .parent()\n        .expect(\"a validated copy_link has a staged parent\");\n    let original_permissions = make_directory_writable(parent)?;\n    let result = (|| {\n        crate::file::remove_file(&staged_link)?;\n        if target.is_dir() {","sourceCodeStart":849,"sourceCodeEnd":885,"githubUrl":"https://github.com/jdx/mise/blob/533346cc374382b41ec5ff70536252b2e96e725c/src/system/remote.rs#L849-L885","documentation":"A configured copy_link must name an existing symbolic link within the source directory; mise materializes that exact link into the staged copy. This error means the path exists (symlink_metadata succeeded) but is a regular file, directory, or other non-link entry, so there is nothing to materialize as a link.","triggerScenarios":"validate_copy_link_path finds source.join(link) via symlink_metadata and its file type is not a symlink; triggered from validate_copy_link/materialize_link during upload_source when host.copy_link is set.","commonSituations":"The path that used to be a symlink was replaced by a real file or directory (tooling checked it in as a regular file); the configured path points one level off (parent directory instead of the link itself); git checkout materialized the link as a plain file on a system without symlink support.","solutions":["Recreate the entry as a symlink: `ln -sfn <target> <link-path>`","Point copy_link at the actual symlink path, not its parent or a copy","If the entry should be a regular file, remove it from copy_link (regular files are uploaded normally anyway)","On symlink-less filesystems (some Windows checkouts), enable copy_links=true instead of per-link config"],"exampleFix":"# before: .claude is a regular directory\ncopy_link = \".claude\"\n# after: make it a symlink\nrm -rf .claude && ln -s ~/.claude .claude","handlingStrategy":"validation","validationCode":"# the configured path must be a symlink within the source\n[ -L \"$SOURCE_DIR/$LINK_REL\" ] || { echo \"$LINK_REL is not a symlink\"; exit 1; }","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Verify the target is still a symlink after git operations or checkouts on symlink-less filesystems","Recreate links with `ln -sfn` when tooling replaces them with real files","Drop copy_link entries for paths that became regular files"],"tags":["symlink","path-validation","config"],"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"}