{"record":{"id":"69bc96b235ff06a6","repo":"stablyai/orca","slug":"name-did-not-emit-readiness-within-startuptim","errorCode":null,"errorMessage":"${name} did not emit readiness within ${startupTimeoutMs}ms:\n${logResult.stdout}${logResult.stderr}","messagePattern":"(.+?) did not emit readiness within (.+?)ms:\n(.+?)(.+?)","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"config/scripts/run-headless-linux-pairing-docker.mjs","lineNumber":297,"sourceCode":"  while (Date.now() < deadline) {\n    const logResult = docker(['logs', name], { allowFailure: true })\n    const stdout = `${logResult.stdout}${logResult.stderr}`\n    if (hasCompleteReadyContract(stdout)) {\n      return stdout\n    }\n    const running = docker(['inspect', '-f', '{{.State.Running}}', name], {\n      allowFailure: true\n    }).stdout.trim()\n    if (running === 'false') {\n      const containerLogs = docker(['logs', name], { allowFailure: true })\n      throw new Error(\n        `${name} exited before readiness:\\n${containerLogs.stdout}${containerLogs.stderr}`\n      )\n    }\n    await new Promise((resolveWait) => setTimeout(resolveWait, 100))\n  }\n  const logResult = docker(['logs', name], { allowFailure: true })\n  throw new Error(\n    `${name} did not emit readiness within ${startupTimeoutMs}ms:\\n${logResult.stdout}${logResult.stderr}`\n  )\n}\n\nfunction hasCompleteReadyContract(stdout) {\n  if (\n    stdout.includes('Orca server ready\\n') &&\n    (stdout.includes('\\nPairing URL: ') || stdout.includes('\\nPairing guidance: '))\n  ) {\n    return true\n  }\n  return readyJsonObjects(stdout).length > 0\n}\n\nfunction validateReady(logs, mode, expectedHost, options = {}) {\n  if (mode === 'human') {\n    assert(\n      (logs.match(/^Orca server ready$/gm) ?? []).length === 1,","sourceCodeStart":279,"sourceCodeEnd":315,"githubUrl":"https://github.com/stablyai/orca/blob/1136503c6a231a16dce8f921f6fadb63d181e8db/config/scripts/run-headless-linux-pairing-docker.mjs#L279-L315","documentation":"Thrown by waitForReady when the deadline (Date.now() + startupTimeoutMs) elapses while the container is still running but has not produced a complete ready contract in its logs. hasCompleteReadyContract never matched: it requires 'Orca server ready\\n' plus a Pairing URL/guidance line, or at least one orca_server_ready JSON object.","triggerScenarios":"Container stays alive past startupTimeoutMs but the app is slow to bind, ORCA_READY_JSON mode mismatch, or readiness output is going to a stream not captured, so hasCompleteReadyContract keeps returning false.","commonSituations":"Slow first boot (cold AppImage extraction), startupTimeoutMs too low, app waiting on a network/address that never resolves, ORCA_PAIRING_ADDRESS misconfigured so pairing guidance is never printed, logs buffered and not flushed.","solutions":["Increase startupTimeoutMs passed to waitForReady.","Inspect the appended logs to see how far startup progressed and which ready line is missing.","Confirm ORCA_PAIRING_ADDRESS/ORCA_SERVE_PORT and ORCA_READY_JSON match the mode expected by hasCompleteReadyContract.","Check for stdout buffering inside the container (use line-buffered output or stdbuf)."],"exampleFix":"// before\nconst stdout = await waitForReady(name, startupTimeoutMs)\n// after\nconst stdout = await waitForReady(name, startupTimeoutMs + 60_000)\n// and confirm ORCA_READY_JSON=1 when expecting JSON readiness","handlingStrategy":"retry","validationCode":"const startupTimeoutMs = Math.max(options.startupTimeoutMs ?? 60_000, 120_000)\n// pass the larger value into waitForReady so slow first boots are tolerated","typeGuard":"function isReady(stdout) { return hasCompleteReadyContract(stdout) }","tryCatchPattern":"let stdout\ntry {\n  stdout = await waitForReady(name, startupTimeoutMs)\n} catch (err) {\n  if (/did not emit readiness/.test(err.message)) {\n    stdout = await waitForReady(name, startupTimeoutMs + 60_000) // one bounded retry\n  } else {\n    throw err\n  }\n}","preventionTips":["Size startupTimeoutMs to the worst-case cold-boot time of the AppImage.","Match ORCA_READY_JSON to the readiness mode the test expects.","Use line-buffered output inside the container so readiness lines flush promptly."],"tags":["docker","timeout","readiness","linux","pairing"],"backgroundTag":null,"analyzedSha":"1136503c6a231a16dce8f921f6fadb63d181e8db","analyzedAt":"2026-08-12T23:15:58.167Z","schemaVersion":2},"datasetVersion":"2026-08-12T23:17:12.415Z"}