{"record":{"id":"4c886b3ad66143de","repo":"stablyai/orca","slug":"unsupported-file-type-in-displaypath","errorCode":null,"errorMessage":"Unsupported file type in '${displayPath}'","messagePattern":"Unsupported file type in '(.+?)'","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"src/main/ipc/filesystem-mutations.ts","lineNumber":583,"sourceCode":"    }\n  }\n\n  await visit(rootPath)\n  return entries\n}\n\nasync function stageFileEntry(\n  filePath: string,\n  relativePath: string,\n  options?: { rootRealPath?: string; totalBytesBefore?: number }\n): Promise<{ entry: StagedExternalImportEntry; byteLength: number }> {\n  const statResult = await lstat(filePath)\n  const displayPath = normalizeRelativeUploadPath(relativePath)\n  if (statResult.isSymbolicLink()) {\n    throw new RuntimeUploadSymlinkError(`Symlink not allowed in '${displayPath}'`)\n  }\n  if (!statResult.isFile()) {\n    throw new Error(`Unsupported file type in '${displayPath}'`)\n  }\n  if (options?.rootRealPath) {\n    await assertRealPathInsideRoot(options.rootRealPath, filePath, displayPath)\n  }\n  const initialTotalBytes =\n    options?.totalBytesBefore === undefined\n      ? statResult.size\n      : options.totalBytesBefore + statResult.size\n  assertRemoteUploadBudget(relativePath, statResult.size, initialTotalBytes)\n  const fileHandle = await open(filePath, constants.O_RDONLY | (constants.O_NOFOLLOW ?? 0))\n  try {\n    const openedStat = await fileHandle.stat()\n    if (!openedStat.isFile()) {\n      throw new Error(`Unsupported file type in '${displayPath}'`)\n    }\n    if (\n      openedStat.size !== statResult.size ||\n      (statResult.ino !== 0 && openedStat.ino !== 0 && openedStat.ino !== statResult.ino) ||","sourceCodeStart":565,"sourceCodeEnd":601,"githubUrl":"https://github.com/stablyai/orca/blob/1136503c6a231a16dce8f921f6fadb63d181e8db/src/main/ipc/filesystem-mutations.ts#L565-L601","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","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."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"// Ensure a single-file source is a regular file before staging\nimport { lstat } from 'node:fs/promises'\nasync function isRegularFile(p: string): Promise<boolean> {\n  try { const s = await lstat(p); return !s.isSymbolicLink() && s.isFile() } catch { return false }\n}","typeGuard":null,"tryCatchPattern":"const res = await stageOneSourceForRuntimeUpload(src)\nif (res.status === 'failed' && /Unsupported file type/.test(res.reason ?? '')) {\n  // report that the source is a special file and cannot be staged\n}","preventionTips":["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."],"tags":["filesystem","upload","runtime-upload","staging","unsupported-type"],"backgroundTag":null,"analyzedSha":"1136503c6a231a16dce8f921f6fadb63d181e8db","analyzedAt":"2026-08-12T23:15:58.167Z","schemaVersion":2},"datasetVersion":"2026-08-12T23:17:12.415Z"}