EpicGames/lore · error · tokio::io::Error (NotFound)

Matching file not found

Error message

Matching file not found

What it means

lore-revision resolves paths case-insensitively by scanning the directory for entries whose names fold to the requested name. In `filesystem_path_and_info`, when the set of directory entries matching the requested component case-insensitively is empty, it returns `ErrorKind::NotFound` with this message. It means no entry in that directory corresponds to the requested path component, regardless of casing.

Solutions

  1. Check the exact path spelling and confirm the entry exists in that directory.
  2. If the file should exist, restore it or fix the stored reference that points at it.
  3. Catch `io::ErrorKind::NotFound` and surface a clearer 'path does not exist' message to your user.

Example fix

// before
let p = fs::filesystem_path(&path).await?;

// after
match fs::filesystem_path(&path).await {
    Ok(p) => p,
    Err(e) if e.kind() == io::ErrorKind::NotFound => {
        eprintln!("path does not exist: {}", path.display());
        return Err(e);
    }
    Err(e) => return Err(e),
}
Defensive patterns

Strategy: try-catch

Validate before calling

if !tokio::fs::try_exists(&path).await.unwrap_or(false) {
    // fail fast with your own clear message before calling filesystem_path
}

Try / catch

match fs::filesystem_path(&path).await {
    Ok(p) => p,
    Err(e) if e.kind() == io::ErrorKind::NotFound => return Err(anyhow!("path does not exist: {}", path.display())),
    Err(e) => return Err(e.into()),
}

Prevention

When it happens

Trigger: Calling `filesystem_path` (or anything that reaches `filesystem_path_and_info`) with a path whose component does not exist at all in the target directory — not merely a casing difference.

Common situations: Typo'd file or directory names, lookups against a path that was deleted or renamed, resolving a path on the wrong branch/worktree, or stale cached references to removed files.

Understand the failure class

Background: "File not found" and ENOENT errors: why libraries can't find a file that should exist — this error's family across 50 libraries.

Related errors


AI-assisted analysis of EpicGames/lore@074eb0b0d1 (2026-09-13). Data as JSON: /api/errors/0138ccfb3cc04729. Report an issue: GitHub.

Appendix: source

Thrown at lore-revision/src/util/fs.rs:556

        let name = remain_path.pop_root();
        // Nearly every component is already in the case the filesystem holds it,
        // and that costs one lookup to establish. Only where it is not, or where
        // the platform will not say, does the directory get read, and a name
        // allocated for what it says.
        if candidate_is_held(operation, &candidate_path(found_path.as_str(), name)).await
            == Some(true)
        {
            found_path.push(name);
            continue;
        }
        let directory = candidate_path(found_path.as_str(), "");
        let Ok(fs_names) = names_folding_to_in_operation(operation, &directory, name).await else {
            return Err(tokio::io::Error::other(
                "Failed to read the directory for case variations",
            ));
        };
        if fs_names.is_empty() {
            return Err(tokio::io::Error::new(
                tokio::io::ErrorKind::NotFound,
                "Matching file not found",
            ));
        }
        if fs_names.len() > 1 {
            if remain_path.is_empty() {
                lore_debug!("Found ambiguous path case variations for {find_path}");
                return Err(tokio::io::Error::other(
                    "Ambiguous case variations for path {find_path}",
                ));
            }

            // Find the match in either or many of the potential variations
            let mut found_variation = false;
            for entry in fs_names.iter() {
                let next_full_path = directory.join(entry);

                lore_debug!(

View on GitHub (pinned to 074eb0b0d1)