{"record":{"id":"0138ccfb3cc04729","repo":"EpicGames/lore","slug":"matching-file-not-found","errorCode":null,"errorMessage":"Matching file not found","messagePattern":"Matching file not found","errorType":"exception","errorClass":"tokio::io::Error (NotFound)","httpStatus":null,"severity":"error","filePath":"lore-revision/src/util/fs.rs","lineNumber":556,"sourceCode":"        let name = remain_path.pop_root();\n        // Nearly every component is already in the case the filesystem holds it,\n        // and that costs one lookup to establish. Only where it is not, or where\n        // the platform will not say, does the directory get read, and a name\n        // allocated for what it says.\n        if candidate_is_held(operation, &candidate_path(found_path.as_str(), name)).await\n            == Some(true)\n        {\n            found_path.push(name);\n            continue;\n        }\n        let directory = candidate_path(found_path.as_str(), \"\");\n        let Ok(fs_names) = names_folding_to_in_operation(operation, &directory, name).await else {\n            return Err(tokio::io::Error::other(\n                \"Failed to read the directory for case variations\",\n            ));\n        };\n        if fs_names.is_empty() {\n            return Err(tokio::io::Error::new(\n                tokio::io::ErrorKind::NotFound,\n                \"Matching file not found\",\n            ));\n        }\n        if fs_names.len() > 1 {\n            if remain_path.is_empty() {\n                lore_debug!(\"Found ambiguous path case variations for {find_path}\");\n                return Err(tokio::io::Error::other(\n                    \"Ambiguous case variations for path {find_path}\",\n                ));\n            }\n\n            // Find the match in either or many of the potential variations\n            let mut found_variation = false;\n            for entry in fs_names.iter() {\n                let next_full_path = directory.join(entry);\n\n                lore_debug!(","sourceCodeStart":538,"sourceCodeEnd":574,"githubUrl":"https://github.com/EpicGames/lore/blob/074eb0b0d1194c997d7cf28b55519e3e197b3e23/lore-revision/src/util/fs.rs#L538-L574","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","solutions":["Check the exact path spelling and confirm the entry exists in that directory.","If the file should exist, restore it or fix the stored reference that points at it.","Catch `io::ErrorKind::NotFound` and surface a clearer 'path does not exist' message to your user."],"exampleFix":"// before\nlet p = fs::filesystem_path(&path).await?;\n\n// after\nmatch fs::filesystem_path(&path).await {\n    Ok(p) => p,\n    Err(e) if e.kind() == io::ErrorKind::NotFound => {\n        eprintln!(\"path does not exist: {}\", path.display());\n        return Err(e);\n    }\n    Err(e) => return Err(e),\n}","handlingStrategy":"try-catch","validationCode":"if !tokio::fs::try_exists(&path).await.unwrap_or(false) {\n    // fail fast with your own clear message before calling filesystem_path\n}","typeGuard":null,"tryCatchPattern":"match fs::filesystem_path(&path).await {\n    Ok(p) => p,\n    Err(e) if e.kind() == io::ErrorKind::NotFound => return Err(anyhow!(\"path does not exist: {}\", path.display())),\n    Err(e) => return Err(e.into()),\n}","preventionTips":["Validate user-supplied paths exist before resolving them through the library.","Refresh any cached/stored paths after deletes or renames.","Log the exact requested component when a lookup fails to spot typos quickly."],"tags":["filesystem","not-found","case-insensitive"],"backgroundTag":"file-not-found","analyzedSha":"074eb0b0d1194c997d7cf28b55519e3e197b3e23","analyzedAt":"2026-09-13T09:00:57.509Z","contentChangedAt":"2026-09-13T09:00:57.509Z","schemaVersion":2},"datasetVersion":"2026-09-16T09:17:16.951Z"}