{"record":{"id":"3f0e48375d6ea8e1","repo":"Hmbown/CodeWhale","slug":"is-a-reparse-point-not-a-workspace-owned-file","errorCode":null,"errorMessage":"{} is a reparse point, not a workspace-owned file","messagePattern":"(.+?) is a reparse point, not a workspace-owned file","errorType":"exception","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"crates/tui/src/lib.rs","lineNumber":3041,"sourceCode":"        .map_err(|error| anyhow!(\"could not securely open {}: {error}\", path.display()))\n}\n\n#[cfg(windows)]\nfn open_workspace_dotenv_without_following_links(path: &Path) -> Result<std::fs::File> {\n    use std::os::windows::fs::{MetadataExt, OpenOptionsExt};\n\n    const FILE_ATTRIBUTE_REPARSE_POINT: u32 = 0x0000_0400;\n    const FILE_FLAG_OPEN_REPARSE_POINT: u32 = 0x0020_0000;\n    let file = std::fs::OpenOptions::new()\n        .read(true)\n        .custom_flags(FILE_FLAG_OPEN_REPARSE_POINT)\n        .open(path)\n        .map_err(|error| anyhow!(\"could not securely open {}: {error}\", path.display()))?;\n    let metadata = file\n        .metadata()\n        .map_err(|error| anyhow!(\"could not inspect {}: {error}\", path.display()))?;\n    if metadata.file_attributes() & FILE_ATTRIBUTE_REPARSE_POINT != 0 {\n        bail!(\n            \"{} is a reparse point, not a workspace-owned file\",\n            path.display()\n        );\n    }\n    Ok(file)\n}\n\n#[cfg(not(any(unix, windows)))]\nfn open_workspace_dotenv_without_following_links(path: &Path) -> Result<std::fs::File> {\n    let metadata = std::fs::symlink_metadata(path)\n        .map_err(|error| anyhow!(\"could not inspect {}: {error}\", path.display()))?;\n    if metadata.file_type().is_symlink() {\n        bail!(\n            \"{} is a symbolic link, not a workspace-owned file\",\n            path.display()\n        );\n    }\n    std::fs::File::open(path)","sourceCodeStart":3023,"sourceCodeEnd":3059,"githubUrl":"https://github.com/Hmbown/CodeWhale/blob/73e0f67d83c59909b571efdfc88c4bc28c309cb1/crates/tui/src/lib.rs#L3023-L3059","documentation":"On Windows, open_workspace_dotenv_without_following_links opens the .env with FILE_FLAG_OPEN_REPARSE_POINT semantics and checks the file attributes for FILE_ATTRIBUTE_REPARSE_POINT. A reparse point (symlink, junction, mount point, OneDrive placeholder, etc.) is not a workspace-owned regular file, so loading credentials from it is refused.","triggerScenarios":"On Windows, the workspace `.env` has the reparse-point attribute: it is an NTFS symlink/junction, a Dev Drive/projected filesystem placeholder, or a OneDrive/cloud-files placeholder.","commonSituations":"Symlinking .env from a dotfiles directory on Windows, workspace living under OneDrive where files are placeholders, or a junctioned workspace folder.","solutions":["Replace the symlink/junction with a real copy: `Copy-Item` the target content into a plain .env file.","Exclude the workspace from OneDrive (move it out of the OneDrive folder) or force files fully on-disk (always keep on this device).","Check attributes with `fsutil reparsepoint query .env` or `(Get-Item .env).Attributes` and confirm/fix the reparse flag.","Create the .env directly inside the workspace rather than linking it from elsewhere."],"exampleFix":"// PowerShell before\nNew-Item -ItemType SymbolicLink -Path .env -Target $HOME\\.secrets\\codewhale.env\n// after\nCopy-Item $HOME\\.secrets\\codewhale.env .env","handlingStrategy":"validation","validationCode":"// PowerShell\nif ((Get-Item .env -Force).Attributes -band [IO.FileAttributes]::ReparsePoint) { throw '.env must not be a reparse point' }","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Copy instead of symlinking .env on Windows.","Keep workspaces out of OneDrive or mark files 'always keep on this device'.","Avoid junctioned workspace paths for credential files."],"tags":["windows","dotenv","symlink","security"],"backgroundTag":"incompatible-source-type","analyzedSha":"73e0f67d83c59909b571efdfc88c4bc28c309cb1","analyzedAt":"2026-09-22T01:30:00.501Z","contentChangedAt":"2026-09-22T01:30:00.501Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}