stablyai/orca · error · Error

${name} exited before readiness: ${containerLogs.stdout}${co

Error message

${name} exited before readiness:
${containerLogs.stdout}${containerLogs.stderr}

What it means

Thrown by waitForReady in run-headless-linux-pairing-docker.mjs when docker inspect reports the container is no longer running ({{.State.Running}} === 'false') before a complete ready contract has appeared in its logs. The container started but crashed/exited during startup; the final logs are appended for diagnosis.

Source

Thrown at config/scripts/run-headless-linux-pairing-docker.mjs:290

  containers.add(name)
  const stdout = await waitForReady(name, startupTimeoutMs)
  return { name, stdout }
}

async function waitForReady(name, startupTimeoutMs) {
  const deadline = Date.now() + startupTimeoutMs
  while (Date.now() < deadline) {
    const logResult = docker(['logs', name], { allowFailure: true })
    const stdout = `${logResult.stdout}${logResult.stderr}`
    if (hasCompleteReadyContract(stdout)) {
      return stdout
    }
    const running = docker(['inspect', '-f', '{{.State.Running}}', name], {
      allowFailure: true
    }).stdout.trim()
    if (running === 'false') {
      const containerLogs = docker(['logs', name], { allowFailure: true })
      throw new Error(
        `${name} exited before readiness:\n${containerLogs.stdout}${containerLogs.stderr}`
      )
    }
    await new Promise((resolveWait) => setTimeout(resolveWait, 100))
  }
  const logResult = docker(['logs', name], { allowFailure: true })
  throw new Error(
    `${name} did not emit readiness within ${startupTimeoutMs}ms:\n${logResult.stdout}${logResult.stderr}`
  )
}

function hasCompleteReadyContract(stdout) {
  if (
    stdout.includes('Orca server ready\n') &&
    (stdout.includes('\nPairing URL: ') || stdout.includes('\nPairing guidance: '))
  ) {
    return true
  }

View on GitHub (pinned to 1136503c6a)

Solutions

  1. Read the appended containerLogs in the message to find the actual crash (AppRun error, missing lib, OOM).
  2. Run docker run --rm <image> manually with the same -e/-v flags to reproduce interactively.
  3. Verify image.tag and the artifact volume mount, and that ORCA_TEST_APPIMAGE points at a valid AppImage inside /artifacts.
  4. Ensure the image has the runtime deps the AppImage needs (Xvfb, libnss, etc.).

Example fix

// before
docker(['run', '-d', '--name', name, image.tag, launch])
// after
docker(['logs', name], { allowFailure: true }) // inspect the crash first
// then fix the missing runtime dep in the Dockerfile / AppImage path
Defensive patterns

Strategy: try-catch

Validate before calling

function runningContainer(name) {
  return docker(['inspect', '-f', '{{.State.Running}}', name], { allowFailure: true }).stdout.trim() === 'true'
}
// before expecting readiness, sanity-check the image and artifact path
if (!existsSync(appPath)) throw new Error(`AppImage missing: ${appPath}`)

Type guard

function hasCompleteReadyContract(stdout) {
  return (
    (stdout.includes('Orca server ready\n') &&
      (stdout.includes('\nPairing URL: ') || stdout.includes('\nPairing guidance: '))) ||
    readyJsonObjects(stdout).length > 0
  )
}

Try / catch

try {
  await waitForReady(name, startupTimeoutMs)
} catch (err) {
  const logs = docker(['logs', name], { allowFailure: true })
  stopContainer(name)
  // err.message already embeds logs; surface to CI artifact
  throw err
}

Prevention

When it happens

Trigger: The paired Linux container (started via docker run with ORCA_KEEP_RUNNING=1 and an AppImage) exits non-zero before emitting 'Orca server ready' plus a Pairing URL/guidance or a valid orca_server_ready JSON object.

Common situations: Wrong/missing AppImage path (ORCA_TEST_APPIMAGE), missing Xvfb/display deps in the image, a crash in the squashfs-root AppRun, a port conflict on ORCA_SERVE_PORT, an out-of-memory kill, or a bad image tag.

Related errors


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