{"record":{"id":"8315de199bd57436","repo":"paperclipai/paperclip","slug":"timed-out-checking-working-directory-on-remote-tar","errorCode":null,"errorMessage":"Timed out checking working directory on remote target: \"${cwd}\"","messagePattern":"Timed out checking working directory on remote target: \"(.+?)\"","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/adapter-utils/src/execution-target.ts","lineNumber":1007,"sourceCode":"  if (!cwd.startsWith(\"/\")) {\n    throw new Error(`Working directory must be an absolute POSIX path on the remote target: \"${cwd}\"`);\n  }\n\n  const quoted = shellQuote(cwd);\n  const script = createIfMissing\n    ? `mkdir -p ${quoted} && [ -d ${quoted} ]`\n    : `[ -d ${quoted} ]`;\n\n  const result = await runAdapterExecutionTargetShellCommand(runId, target, script, {\n    cwd: target.kind === \"remote\" ? target.remoteCwd : cwd,\n    env: options.env,\n    timeoutSec: options.timeoutSec ?? 15,\n    graceSec: options.graceSec ?? 5,\n    onLog: options.onLog,\n  });\n\n  if (result.timedOut) {\n    throw new Error(`Timed out checking working directory on remote target: \"${cwd}\"`);\n  }\n  if ((result.exitCode ?? 1) !== 0) {\n    const detail = (result.stderr || result.stdout || \"\").trim();\n    if (createIfMissing) {\n      throw new Error(\n        `Could not create working directory \"${cwd}\" on remote target${detail ? `: ${detail}` : \".\"}`,\n      );\n    }\n    throw new Error(\n      `Working directory does not exist on remote target: \"${cwd}\"${detail ? ` (${detail})` : \"\"}`,\n    );\n  }\n}\n\nexport function adapterExecutionTargetSessionIdentity(\n  target: AdapterExecutionTarget | null | undefined,\n): Record<string, unknown> | null {\n  if (!target || target.kind === \"local\") return null;","sourceCodeStart":989,"sourceCodeEnd":1025,"githubUrl":"https://github.com/paperclipai/paperclip/blob/67001ec6eb96ae601aa27bc91d9b2415d665334a/packages/adapter-utils/src/execution-target.ts#L989-L1025","documentation":"Thrown by ensureAdapterExecutionTargetDirectory when the shell command that checks or creates the working directory on a remote target times out. The command is either `mkdir -p <cwd> && [ -d <cwd> ]` (createIfMissing) or `[ -d <cwd> ]`, run with a 15s default timeout and 5s grace period.","triggerScenarios":"Calling ensureAdapterExecutionTargetDirectory(runId, target, cwd, options) with a remote target; runAdapterExecutionTargetShellCommand returns { timedOut: true } for the directory check script.","commonSituations":"The remote SSH connection or sandbox exec channel is stalled; the filesystem is on a slow network mount (NFS) causing the stat to hang; the sandbox lease expired; the SSH session is waiting on a password prompt or host-key verification.","solutions":["Increase the options.timeoutSec above the default 15s if the remote filesystem is slow.","Verify the SSH/sandbox connection is healthy and not blocked on interactive prompts.","Check if the remote filesystem is an NFS or fuse mount that could hang on directory operations.","Ensure the sandbox lease is still active."],"exampleFix":null,"handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":"try {\n  await ensureAdapterExecutionTargetDirectory(runId, target, cwd, options);\n} catch (err) {\n  if (err instanceof Error && err.message.includes(\"Timed out checking working directory\")) {\n    // Remote may be transiently slow — retry with a longer timeout\n    await ensureAdapterExecutionTargetDirectory(runId, target, cwd, { ...options, timeoutSec: 60 });\n  } else {\n    throw err;\n  }\n}","preventionTips":["Set options.timeoutSec above 15s for slow remote filesystems.","Verify SSH connections are non-interactive (no password/host-key prompts).","Monitor remote host latency and resource availability."],"tags":["timeout","remote","execution-target","adapter-utils"],"backgroundTag":null,"analyzedSha":"67001ec6eb96ae601aa27bc91d9b2415d665334a","analyzedAt":"2026-08-12T12:05:45.408Z","schemaVersion":2},"datasetVersion":"2026-08-12T18:17:37.767Z"}