{"record":{"id":"d9360821c7170333","repo":"paperclipai/paperclip","slug":"timed-out-while-installing-the-adapter-runtime-com","errorCode":null,"errorMessage":"Timed out while installing the adapter runtime command via: ${installCommand}","messagePattern":"Timed out while installing the adapter runtime command via: (.+?)","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/adapter-utils/src/execution-target.ts","lineNumber":945,"sourceCode":"        env: input.env,\n        timeoutSec: input.timeoutSec,\n        graceSec: input.graceSec,\n      },\n    );\n    if (!recheck.timedOut && recheck.exitCode === 0) {\n      if (input.onLog) {\n        const reason = result.timedOut ? \"timed out\" : `exited ${result.exitCode ?? \"?\"}`;\n        await input.onLog(\n          \"stderr\",\n          `[paperclip] Install command ${reason} (${installCommand}) but ${detectCommand} is on PATH; continuing.\\n`,\n        );\n      }\n      return;\n    }\n  }\n\n  if (result.timedOut) {\n    throw new Error(`Timed out while installing the adapter runtime command via: ${installCommand}`);\n  }\n  throw new Error(`Failed to install the adapter runtime command via: ${installCommand}`);\n}\n\nexport async function ensureAdapterExecutionTargetFile(\n  runId: string,\n  target: AdapterExecutionTarget | null | undefined,\n  filePath: string,\n  options: AdapterExecutionTargetShellOptions,\n): Promise<void> {\n  await runAdapterExecutionTargetShellCommand(\n    runId,\n    target,\n    `mkdir -p ${shellQuote(path.posix.dirname(filePath))} && : > ${shellQuote(filePath)}`,\n    options,\n  );\n}\n","sourceCodeStart":927,"sourceCodeEnd":963,"githubUrl":"https://github.com/paperclipai/paperclip/blob/67001ec6eb96ae601aa27bc91d9b2415d665334a/packages/adapter-utils/src/execution-target.ts#L927-L963","documentation":"Thrown by ensureAdapterExecutionTargetRuntimeCommandInstalled when the install command for an adapter runtime CLI times out AND the binary is still not detectable on PATH afterward. The function first tries the install command, then if it failed or timed out, re-checks with `command -v <detectCommand>`; if that recheck also fails (or no detectCommand is configured), it throws this timeout variant.","triggerScenarios":"Calling ensureAdapterExecutionTargetRuntimeCommandInstalled with target.transport === 'sandbox', a non-empty installCommand, and either no detectCommand or a detectCommand that also fails the `command -v` recheck. The underlying runAdapterExecutionTargetShellCommand for installCommand returned { timedOut: true }.","commonSituations":"The install command runs `npm install -g` or similar against a slow/unreachable registry from inside the sandbox; the install timeoutSec is too short for large installs; the sandbox has no network egress to the package registry; the install command hangs waiting for user input.","solutions":["Increase timeoutSec on the ensureAdapterExecutionTargetRuntimeCommandInstalled input to accommodate slow installs.","Pre-install the runtime CLI in the sandbox image so the install step is unnecessary.","Ensure the sandbox network allowlist permits egress to the package registry used by the install command.","Make the install command non-interactive (e.g. add --yes / --non-interactive flags)."],"exampleFix":"// before\nawait ensureAdapterExecutionTargetRuntimeCommandInstalled({\n  runId,\n  target,\n  installCommand: \"npm install -g @scope/cli\",\n  detectCommand: \"mycli\",\n  cwd,\n  env,\n  timeoutSec: 30,\n});\n// after\nawait ensureAdapterExecutionTargetRuntimeCommandInstalled({\n  runId,\n  target,\n  installCommand: \"npm install -g @scope/cli --no-fund --no-audit\",\n  detectCommand: \"mycli\",\n  cwd,\n  env,\n  timeoutSec: 180,\n});","handlingStrategy":"validation","validationCode":"// Validate install command and timeout before calling\nfunction validateInstallConfig(input: { installCommand?: string | null; timeoutSec?: number; detectCommand?: string | null }): string | null {\n  if (!input.installCommand?.trim()) return \"installCommand is required for sandbox targets\";\n  if ((input.timeoutSec ?? 0) < 60) return \"timeoutSec should be at least 60s for sandbox installs\";\n  if (!input.detectCommand?.trim()) return \"detectCommand is recommended to recover from transient install failures\";\n  return null;\n}","typeGuard":null,"tryCatchPattern":"try {\n  await ensureAdapterExecutionTargetRuntimeCommandInstalled(input);\n} catch (err) {\n  if (err instanceof Error && err.message.includes(\"Timed out while installing\")) {\n    logger.error(`Install timed out: ${err.message}. Consider pre-baking the CLI into the image.`);\n  }\n  throw err;\n}","preventionTips":["Pre-install the adapter CLI in the sandbox image to eliminate runtime install entirely.","Set timeoutSec generously (120s+) for npm/pip global installs.","Ensure the sandbox network allowlist permits egress to the package registry.","Always provide a detectCommand so transient install failures can be recovered."],"tags":["sandbox","timeout","install","execution-target","adapter-utils"],"backgroundTag":null,"analyzedSha":"67001ec6eb96ae601aa27bc91d9b2415d665334a","analyzedAt":"2026-08-12T12:05:45.408Z","schemaVersion":2},"datasetVersion":"2026-08-12T18:17:37.767Z"}