{"record":{"id":"b889641d2430271e","repo":"libnyanpasu/clash-nyanpasu","slug":"managed-target-is-an-unsupported-reparse-point","errorCode":null,"errorMessage":"managed target is an unsupported reparse point: {}","messagePattern":"managed target is an unsupported reparse point: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"backend/tauri/src/service/profile_file.rs","lineNumber":698,"sourceCode":"            MaterializationResource::File { content } => hash_tagged(b\"file\", content.as_bytes()),\n            MaterializationResource::Symlink { target } => {\n                hash_tagged(b\"symlink\", target.as_str().as_bytes())\n            }\n        }\n    }\n\n    fn path_hash(path: &Path) -> anyhow::Result<String> {\n        match std::fs::symlink_metadata(path) {\n            Ok(metadata) if metadata.file_type().is_symlink() => {\n                let target = std::fs::read_link(path)\n                    .with_context(|| format!(\"read managed symlink {}\", path.display()))?;\n                let target = target\n                    .to_str()\n                    .context(\"managed symlink target is not valid UTF-8\")?;\n                Ok(hash_tagged(b\"symlink\", target.as_bytes()))\n            }\n            Ok(metadata) if is_symlink_or_reparse(&metadata) => {\n                bail!(\n                    \"managed target is an unsupported reparse point: {}\",\n                    path.display()\n                )\n            }\n            Ok(metadata) if metadata.is_file() => {\n                let content = std::fs::read(path)\n                    .with_context(|| format!(\"read managed profile {}\", path.display()))?;\n                Ok(hash_tagged(b\"file\", &content))\n            }\n            Ok(_) => bail!(\"managed target is not a file: {}\", path.display()),\n            Err(error) if error.kind() == std::io::ErrorKind::NotFound => {\n                Ok(ABSENT_HASH.to_owned())\n            }\n            Err(error) => Err(error).with_context(|| format!(\"inspect {}\", path.display())),\n        }\n    }\n\n    fn ensure_replaceable_target(path: &Path) -> anyhow::Result<()> {","sourceCodeStart":680,"sourceCodeEnd":716,"githubUrl":"https://github.com/libnyanpasu/clash-nyanpasu/blob/f7dbce2997c633e484f54788035e770b3ee99773/backend/tauri/src/service/profile_file.rs#L680-L716","documentation":"`path_hash` computes a content fingerprint of a managed target (file content or symlink target) to detect drift before materialization. Symlinks are hashed by target; regular files by content. If the entry is some other reparse point (e.g. a Windows junction or other special link not handled as a plain symlink), the code cannot hash it meaningfully and throws this error instead of silently misbehaving.","triggerScenarios":"Drift-check code calls `path_hash` on a managed path whose `symlink_metadata` shows a reparse point that is neither a standard symlink nor a regular file — typically Windows directory junctions, mount points, or OneDrive placeholder files at a managed profile path.","commonSituations":"Windows users with junctioned config directories (moving profiles to another drive via `mklink /J`); OneDrive/cloud 'files on demand' placeholders; Dev Drive / project援 reparse features.","solutions":["Replace the junction/reparse point with a real directory or file at the managed path, or with a plain symlink the app can handle (`mklink` symbolic link instead of `/J` junction)","Move the actual data to the managed location and delete the junction","Exclude the managed path from OneDrive placeholder behavior (Always keep on this device) or relocate it out of synced folders","Re-run the profile operation after normalizing the path type"],"exampleFix":"// before: junction at managed path\nrmdir C:\\Users\\me\\.config\\nyanpasu\\profiles\nmklink /D C:\\Users\\me\\.config\\nyanpasu\\profiles D:\\data\\profiles\n// after: plain symbolic link instead of junction/reparse point","handlingStrategy":"validation","validationCode":"#[cfg(windows)]\nfn is_plain_symlink_or_file(path: &std::path::Path) -> bool {\n    use std::os::windows::fs::MetadataExt;\n    match std::fs::symlink_metadata(path) {\n        Ok(md) => {\n            let ft = md.file_type();\n            ft.is_symlink() || md.is_file()\n            // junctions/mount points report as dirs with reparse attrs -> excluded\n        }\n        Err(_) => false,\n    }\n}","typeGuard":"fn hashable_target(md: &std::fs::Metadata) -> bool {\n    md.file_type().is_symlink() || md.is_file()\n}","tryCatchPattern":"match path_hash(&managed) {\n    Err(e) if e.to_string().contains(\"unsupported reparse point\") => {\n        // replace junction/placeholder with a real dir/file or plain symlink, then retry\n    }\n    other => other?,\n}","preventionTips":["On Windows, use symbolic links (mklink /D) rather than junctions (mklink /J) for managed paths","Disable OneDrive placeholder/Files-On-Demand for folders holding managed profiles","Avoid mount points and dedupe/tiering tools on managed directories","Verify path types with symlink_metadata before running materialization"],"tags":["windows","reparse-point","filesystem"],"backgroundTag":"unsupported-operation","analyzedSha":"f7dbce2997c633e484f54788035e770b3ee99773","analyzedAt":"2026-09-08T01:24:59.197Z","contentChangedAt":"2026-09-08T01:24:59.197Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}