stablyai/orca · warning · Error
ETIMEDOUT
ETIMEDOUT
Error message
Timed out running ${command} What it means
Thrown by withPreflightTimeout (preflight-command-exec.ts:20-42) when a preflight command does not settle within PREFLIGHT_COMMAND_TIMEOUT_MS (5000 ms). It races the command promise against a setTimeout; on timeout it rejects with an Error carrying code 'ETIMEDOUT'. The timeout.unref() call (line 32) means the timer does not keep the Node event loop alive. Used by execLocalPreflightCommand and execCommandInWsl to probe tools like git --version before relying on them.
Source
Thrown at src/main/ipc/preflight-command-exec.ts:28
const execFileAsync = promisify(execFile)
export const PREFLIGHT_COMMAND_TIMEOUT_MS = 5000
const WSL_COMMAND_PATH_SENTINEL = '__ORCA_PREFLIGHT_COMMAND_PATH__'
export type PreflightCommandResult = { stdout: string; stderr: string }
export function shellQuote(value: string): string {
return `'${value.replace(/'/g, "'\\''")}'`
}
async function withPreflightTimeout<T>(command: string, commandPromise: Promise<T>): Promise<T> {
let timeout: ReturnType<typeof setTimeout> | null = null
try {
return await Promise.race([
commandPromise,
new Promise<never>((_resolve, reject) => {
timeout = setTimeout(() => {
const error = Object.assign(new Error(`Timed out running ${command}`), {
code: 'ETIMEDOUT'
})
reject(error)
}, PREFLIGHT_COMMAND_TIMEOUT_MS)
if (typeof timeout.unref === 'function') {
timeout.unref()
}
})
])
} finally {
if (timeout) {
clearTimeout(timeout)
}
}
}
export async function execLocalPreflightCommand(
command: string,
args: string[]View on GitHub (pinned to 1136503c6a)
Solutions
- Run the failing command manually in a terminal with 'time' to confirm it is slow or interactive, then fix the root cause (e.g. disable an interactive credential prompt).
- For WSL, ensure the distro is already running (wsl --list --running) to avoid cold-start latency.
- Add exemptions for the toolchain in privilege-management/antivirus software.
- If the command is inherently slow on this host, the preflight is working as designed — treat the tool as unavailable for preflight purposes (callers fall back).
- Note execFileAsync also has its own timeout=PREFLIGHT_COMMAND_TIMEOUT_MS (line 51), so the child is killed at 5s regardless.
Defensive patterns
Strategy: try-catch
Type guard
function isPreflightTimeout(e: unknown): e is Error & { code: 'ETIMEDOUT' } {
return e instanceof Error && (e as { code?: string }).code === 'ETIMEDOUT'
} Try / catch
try {
await execLocalPreflightCommand(cmd, args)
} catch (e) {
if (isPreflightTimeout(e)) {
// tool is effectively unavailable for preflight; fall back to a non-preflight path or report unavailable
} else throw e
} Prevention
- Treat preflight as advisory — its callers (isCommandAvailable, isCommandOnPath) already swallow errors and return false, so let them.
- Keep WSL distros warm to avoid cold-start latency under the 5s budget.
- Add toolchain paths to antivirus/EDR exemptions to avoid per-spawn gating.
When it happens
Trigger: A preflight probe such as 'git --version' or a WSL path lookup script hangs past 5 seconds: the executable prompts for input, is gated by privilege-management software (the file references this at preflight-command-exec.ts:85-89), waits on a slow network mount, or the WSL distro is slow to start.
Common situations: Privilege-management/corporate EDR gating each process spawn; a slow WSL cold start; a git credential helper blocking on a keychain prompt; an antivirus scanning the spawned binary; a hung NFS/Home directory path on PATH resolution.
Understand the failure class
- Timeouts: ETIMEDOUT, deadlines, and hung requests — what actually expires when a request times out.
Related errors
- Timed out waiting for ${description}
- ETIMEDOUT
- [plain-node-entry-guard] daemon-entry.js did not exit within
- Benchmark workload exceeded the ${maxWorkloadOverrunMs}ms sa
- Timed out polling renderer diagnostics after ${pollTimeoutMs
AI-assisted analysis of stablyai/orca@1136503c6a (2026-08-12).
Data as JSON: /api/errors/7f2cd33eebfc062a.
Report an issue: GitHub.