stablyai/orca · error · Error

Unsupported file type in '${basename(srcPath)}'

Error message

Unsupported file type in '${basename(srcPath)}'

What it means

Thrown in copyLocalFileNoFollow during local import of a single file. The pre-open lstat shows the source is neither a symlink nor a regular file (isFile() false). This rejects special files like FIFOs, sockets, and device nodes that cannot be copied as file content.

Source

Thrown at src/main/ipc/filesystem-mutations.ts:718

    }
    if (!statResult.isFile()) {
      throw new Error(`Unsupported file type in '${entry.name}'`)
    }
    await copyLocalFileNoFollow(srcPath, dstPath, statResult)
  }
}

async function copyLocalFileNoFollow(
  srcPath: string,
  dstPath: string,
  statResult?: Awaited<ReturnType<typeof lstat>>
): Promise<void> {
  const beforeOpenStat = statResult ?? (await lstat(srcPath))
  if (beforeOpenStat.isSymbolicLink()) {
    throw new Error(`Symlink not allowed in '${basename(srcPath)}'`)
  }
  if (!beforeOpenStat.isFile()) {
    throw new Error(`Unsupported file type in '${basename(srcPath)}'`)
  }

  let destinationCreated = false
  const sourceHandle = await open(srcPath, constants.O_RDONLY | (constants.O_NOFOLLOW ?? 0))
  let destinationHandle: Awaited<ReturnType<typeof open>> | null = null
  try {
    const openedStat = await sourceHandle.stat()
    if (
      !openedStat.isFile() ||
      (typeof beforeOpenStat.size === 'number' && openedStat.size !== beforeOpenStat.size) ||
      (typeof beforeOpenStat.ino === 'number' &&
        beforeOpenStat.ino !== 0 &&
        openedStat.ino !== 0 &&
        openedStat.ino !== beforeOpenStat.ino) ||
      (typeof beforeOpenStat.dev === 'number' &&
        beforeOpenStat.dev !== 0 &&
        openedStat.dev !== 0 &&
        openedStat.dev !== beforeOpenStat.dev)

View on GitHub (pinned to 1136503c6a)

Solutions

  1. Check the file type with `file /path/to/source` or `ls -la` and confirm it is a regular file.
  2. Remove the special file or redirect the import to the actual regular file.
  3. If importing from a script, add a type check before invoking the import IPC.

Example fix

// before: import /tmp/app.sock (a Unix socket)
// after: target a real file
//   import /tmp/app.log instead of /tmp/app.sock
Defensive patterns

Strategy: type-guard

Validate before calling

const { lstat } = await import('node:fs/promises')

async function assertRegularFile(filePath: string): Promise<void> {
  const st = await lstat(filePath)
  if (!st.isFile()) {
    throw new Error(`${filePath} is not a regular file (type: ${describeType(st)})`)
  }
}
function describeType(st: { isFile(): boolean; isDirectory(): boolean; isSymbolicLink(): boolean; isFIFO(): boolean; isSocket(): boolean }): string {
  if (st.isDirectory()) return 'directory'
  if (st.isSymbolicLink()) return 'symlink'
  if (st.isFIFO()) return 'fifo'
  if (st.isSocket()) return 'socket'
  return 'special'
}

Type guard

async function isRegularFile(filePath: string): Promise<boolean> {
  const { lstat } = await import('node:fs/promises')
  try {
    return (await lstat(filePath)).isFile()
  } catch {
    return false
  }
}

Try / catch

try {
  await importLocalSource(sourcePath, destDir)
} catch (error) {
  if (error instanceof Error && error.message.startsWith('Unsupported file type')) {
    showUserError(`${error.message} — the source is not a regular file.`)
    return
  }
  throw error
}

Prevention

When it happens

Trigger: Importing a single top-level source path that is a special file type. The lstat reports isFile() false after the symlink check passes, meaning the path is a FIFO, socket, block, or character device.

Common situations: Attempting to import a named pipe, Unix socket, or device file. Importing a path from /dev or /var/run. A file manager or script provides a path to a non-regular file.

Related errors


AI-assisted analysis of stablyai/orca@1136503c6a (2026-08-12). Data as JSON: /api/errors/4554d70b262e7283. Report an issue: GitHub.