libnyanpasu/clash-nyanpasu · error

managed target is an unsupported reparse point: {}

Error message

managed target is an unsupported reparse point: {}

What it means

`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.

Source

Thrown at backend/tauri/src/service/profile_file.rs:698

            MaterializationResource::File { content } => hash_tagged(b"file", content.as_bytes()),
            MaterializationResource::Symlink { target } => {
                hash_tagged(b"symlink", target.as_str().as_bytes())
            }
        }
    }

    fn path_hash(path: &Path) -> anyhow::Result<String> {
        match std::fs::symlink_metadata(path) {
            Ok(metadata) if metadata.file_type().is_symlink() => {
                let target = std::fs::read_link(path)
                    .with_context(|| format!("read managed symlink {}", path.display()))?;
                let target = target
                    .to_str()
                    .context("managed symlink target is not valid UTF-8")?;
                Ok(hash_tagged(b"symlink", target.as_bytes()))
            }
            Ok(metadata) if is_symlink_or_reparse(&metadata) => {
                bail!(
                    "managed target is an unsupported reparse point: {}",
                    path.display()
                )
            }
            Ok(metadata) if metadata.is_file() => {
                let content = std::fs::read(path)
                    .with_context(|| format!("read managed profile {}", path.display()))?;
                Ok(hash_tagged(b"file", &content))
            }
            Ok(_) => bail!("managed target is not a file: {}", path.display()),
            Err(error) if error.kind() == std::io::ErrorKind::NotFound => {
                Ok(ABSENT_HASH.to_owned())
            }
            Err(error) => Err(error).with_context(|| format!("inspect {}", path.display())),
        }
    }

    fn ensure_replaceable_target(path: &Path) -> anyhow::Result<()> {

View on GitHub (pinned to f7dbce2997)

Solutions

  1. 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)
  2. Move the actual data to the managed location and delete the junction
  3. Exclude the managed path from OneDrive placeholder behavior (Always keep on this device) or relocate it out of synced folders
  4. Re-run the profile operation after normalizing the path type

Example fix

// before: junction at managed path
rmdir C:\Users\me\.config\nyanpasu\profiles
mklink /D C:\Users\me\.config\nyanpasu\profiles D:\data\profiles
// after: plain symbolic link instead of junction/reparse point
Defensive patterns

Strategy: validation

Validate before calling

#[cfg(windows)]
fn is_plain_symlink_or_file(path: &std::path::Path) -> bool {
    use std::os::windows::fs::MetadataExt;
    match std::fs::symlink_metadata(path) {
        Ok(md) => {
            let ft = md.file_type();
            ft.is_symlink() || md.is_file()
            // junctions/mount points report as dirs with reparse attrs -> excluded
        }
        Err(_) => false,
    }
}

Type guard

fn hashable_target(md: &std::fs::Metadata) -> bool {
    md.file_type().is_symlink() || md.is_file()
}

Try / catch

match path_hash(&managed) {
    Err(e) if e.to_string().contains("unsupported reparse point") => {
        // replace junction/placeholder with a real dir/file or plain symlink, then retry
    }
    other => other?,
}

Prevention

When it happens

Trigger: 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.

Common situations: 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.

Understand the failure class

Background: UnsupportedOperationException and "is not supported" errors: when a library deliberately refuses a call — this error's family across 30 libraries.

Related errors


AI-assisted analysis of libnyanpasu/clash-nyanpasu@f7dbce2997 (2026-09-08). Data as JSON: /api/errors/b889641d2430271e. Report an issue: GitHub.