Hmbown/CodeWhale · error

has multiple filesystem links

Error message

has multiple filesystem links

What it means

Windows guard in runtime_store_file_identity: GetFileInformationByHandle reported nNumberOfLinks != 1 on the store file. Multiple hard links make inode identity ambiguous (the same content reachable under several names), so the runtime refuses to rely on the file index for its store-swap detection.

Source

Thrown at crates/tui/src/runtime_threads.rs:8981

}

#[cfg(windows)]
fn runtime_store_file_identity(file: &File) -> Result<(u64, u64)> {
    use std::os::windows::fs::MetadataExt as _;
    use std::os::windows::io::AsRawHandle as _;
    use windows_sys::Win32::Storage::FileSystem::{
        BY_HANDLE_FILE_INFORMATION, FILE_ATTRIBUTE_REPARSE_POINT, GetFileInformationByHandle,
    };

    let metadata = file.metadata()?;
    let safe = metadata.is_file() && metadata.file_attributes() & FILE_ATTRIBUTE_REPARSE_POINT == 0;
    anyhow::ensure!(safe, "not a regular non-reparse file");
    let mut info = BY_HANDLE_FILE_INFORMATION::default();
    // SAFETY: the handle and writable output remain valid for the call.
    if unsafe { GetFileInformationByHandle(file.as_raw_handle(), &mut info) } == 0 {
        return Err(std::io::Error::last_os_error()).context("Inspect Runtime store file identity");
    }
    anyhow::ensure!(info.nNumberOfLinks == 1, "has multiple filesystem links");
    Ok((
        u64::from(info.dwVolumeSerialNumber),
        (u64::from(info.nFileIndexHigh) << 32) | u64::from(info.nFileIndexLow),
    ))
}

#[cfg(all(not(unix), not(windows)))]
fn runtime_store_file_identity(file: &File) -> Result<(u64, u64)> {
    anyhow::ensure!(file.metadata()?.is_file(), "must be a regular file");
    Ok((0, 0))
}

fn validate_same_runtime_store_file_handles(
    first: &File,
    second: &File,
    path: &Path,
) -> Result<()> {
    let first = runtime_store_file_identity(first)?;

View on GitHub (pinned to 0c42157ee5)

Solutions

  1. Find other links with fsutil hardlink list and remove them so the store file has exactly one name
  2. Restore from a fresh single-link copy if the link set is unclear
  3. Prevent dedup/backup tooling from hard-linking the runtime store
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at crates/tui/src/runtime_threads.rs:8981 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of Hmbown/CodeWhale@0c42157ee5 (2026-08-20). Data as JSON: /api/errors/505a9f394189ab57. Report an issue: GitHub.