diegosouzapw/OmniRoute · error · Error
Local corpus file is not accessible
Error message
Local corpus file is not accessible
What it means
fs.lstat on the resolved file path threw — the file does not exist (or the process lacks permission to stat it). Fires after containment was verified, so the path is inside the root; the file itself is missing or unreadable at read time.
Solutions
- Re-index the corpus if files moved or were deleted
- Fix filesystem permissions for the corpus tree
Defensive patterns
Strategy: try-catch
When it happens
Trigger: Thrown at src/lib/localCorpus/index.ts:553 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of diegosouzapw/OmniRoute@a179ffed5b (2026-08-25).
Data as JSON: /api/errors/8beca9b01a52a218.
Report an issue: GitHub.
Appendix: source
Thrown at src/lib/localCorpus/index.ts:553
): Promise<LocalCorpusReadResult> {
if (!inputPath || path.isAbsolute(inputPath) || hasDeniedSegment(inputPath)) {
throw new Error("Local corpus file path must be a permitted relative path");
}
if (!isAllowedExtension(inputPath, this.limits.allowedExtensions)) {
throw new Error("Local corpus file type is not permitted");
}
const root = await this.getRoot();
const resolved = path.resolve(root, inputPath);
if (!isContained(root, resolved)) {
throw new Error("Local corpus file path escapes the configured root");
}
let linkStat;
try {
linkStat = await fs.lstat(resolved);
} catch {
throw new Error("Local corpus file is not accessible");
}
if (linkStat.isSymbolicLink() || !linkStat.isFile()) {
throw new Error("Local corpus path must point to a regular file");
}
if (linkStat.size > this.limits.maxFileBytes) {
throw new Error("Local corpus file exceeds the configured read limit");
}
let canonicalFile: string;
try {
canonicalFile = await fs.realpath(resolved);
} catch {
throw new Error("Local corpus file is not accessible");
}
if (!isContained(root, canonicalFile)) {
throw new Error("Local corpus file path escapes the configured root");
}
View on GitHub (pinned to a179ffed5b)