stablyai/orca · error · Error
Unsupported file type in '${displayPath}'
Error message
Unsupported file type in '${displayPath}' What it means
Thrown by stageFileEntry() when the staged file lstat()s as neither a symlink (checked first) nor a regular file — isFile() is false. As a plain Error it surfaces as { status: 'failed' } for the source. The same type check is repeated after open(...O_NOFOLLOW) via fileHandle.stat() to catch a TOCTOU swap; both rejections share the message shape.
Source
Thrown at src/main/ipc/filesystem-mutations.ts:583
}
}
await visit(rootPath)
return entries
}
async function stageFileEntry(
filePath: string,
relativePath: string,
options?: { rootRealPath?: string; totalBytesBefore?: number }
): Promise<{ entry: StagedExternalImportEntry; byteLength: number }> {
const statResult = await lstat(filePath)
const displayPath = normalizeRelativeUploadPath(relativePath)
if (statResult.isSymbolicLink()) {
throw new RuntimeUploadSymlinkError(`Symlink not allowed in '${displayPath}'`)
}
if (!statResult.isFile()) {
throw new Error(`Unsupported file type in '${displayPath}'`)
}
if (options?.rootRealPath) {
await assertRealPathInsideRoot(options.rootRealPath, filePath, displayPath)
}
const initialTotalBytes =
options?.totalBytesBefore === undefined
? statResult.size
: options.totalBytesBefore + statResult.size
assertRemoteUploadBudget(relativePath, statResult.size, initialTotalBytes)
const fileHandle = await open(filePath, constants.O_RDONLY | (constants.O_NOFOLLOW ?? 0))
try {
const openedStat = await fileHandle.stat()
if (!openedStat.isFile()) {
throw new Error(`Unsupported file type in '${displayPath}'`)
}
if (
openedStat.size !== statResult.size ||
(statResult.ino !== 0 && openedStat.ino !== 0 && openedStat.ino !== statResult.ino) ||View on GitHub (pinned to 1136503c6a)
Solutions
- Remove the special file from the source and re-stage.
- Filter non-regular files out of the upload selection before staging.
- If the file was swapped mid-scan (TOCTOU), re-select the source and avoid modifying it during staging.
Defensive patterns
Strategy: validation
Validate before calling
// Ensure a single-file source is a regular file before staging
import { lstat } from 'node:fs/promises'
async function isRegularFile(p: string): Promise<boolean> {
try { const s = await lstat(p); return !s.isSymbolicLink() && s.isFile() } catch { return false }
} Try / catch
const res = await stageOneSourceForRuntimeUpload(src)
if (res.status === 'failed' && /Unsupported file type/.test(res.reason ?? '')) {
// report that the source is a special file and cannot be staged
} Prevention
- Filter non-regular files (sockets/FIFOs/devices) out of single-file uploads.
- Re-select the source if it was swapped mid-scan (TOCTOU).
- Surface unsupported-type failures with the path so users can remove the special file.
When it happens
Trigger: stageFileEntry is asked to stage a path whose lstat type is not regular file (e.g. a socket/FIFO/device presented as a file), or the file was replaced by a special file between the directory listing and the per-file lstat.
Common situations: A dropped 'file' that is actually a Unix socket or named pipe; a special device node in a file slot; build/runtime artifacts (lock sockets, pid-gated FIFOs) selected for upload.
Related errors
- Unsupported file type in '${normalizeRelativeUploadPath(rela
- Unsupported file type in '${childRelativePath}'
- Symlink not allowed in '${normalizeRelativeUploadPath(relati
- Symlink not allowed in '${childRelativePath}'
- Symlink not allowed in '${displayPath}'
AI-assisted analysis of stablyai/orca@1136503c6a (2026-08-12).
Data as JSON: /api/errors/4c886b3ad66143de.
Report an issue: GitHub.