paperclipai/paperclip · error

Sandbox ${namespace}/${name} failed: ${mapped.reason ?? (fai

Error message

Sandbox ${namespace}/${name} failed: ${mapped.reason ?? (failedCondition?.reason as string) ?? "unknown reason"} — ${mapped.message ?? (failedCondition?.message as string) ?? ""}

What it means

Error "Sandbox ${namespace}/${name} failed: ${mapped.reason ?? (failedCondition?.reason as string) ?? "unknown reason"} — ${mapped.message ?? (failedCondition?.message as string) ?? ""}" thrown in paperclipai/paperclip.

Source

Thrown at packages/plugins/sandbox-providers/kubernetes/src/sandbox-cr-orchestrator.ts:281

      namespace,
      plural: SANDBOX_PLURAL,
      name,
    }) as Record<string, unknown>;

    const status = (cr.status as Record<string, unknown>) ?? {};
    // agent-sandbox v1alpha1 uses status.conditions[type=Ready,status=True],
    // not status.phase. Fall back to phase for forward-compat.
    const conditions = Array.isArray(status.conditions) ? status.conditions as Array<Record<string, unknown>> : [];
    const readyCondition = conditions.find((c) => c.type === "Ready");
    const failedCondition = conditions.find((c) => c.type === "Failed" || (c.type === "Ready" && c.status === "False" && typeof c.reason === "string" && /failed/i.test(c.reason)));
    const phase = (status.phase as string) ?? "";

    if (readyCondition?.status === "True" || phase === "Ready") {
      return mapSandboxPhase(cr);
    }
    if (failedCondition?.status === "True" || phase === "Failed") {
      const mapped = mapSandboxPhase(cr);
      throw new Error(
        `Sandbox ${namespace}/${name} failed: ${mapped.reason ?? (failedCondition?.reason as string) ?? "unknown reason"} — ${mapped.message ?? (failedCondition?.message as string) ?? ""}`,
      );
    }
    if (phase === "Terminating") {
      // A Sandbox being torn down will never transition to Ready. Polling
      // until the deadline would burn the full timeoutMs (potentially
      // 30+ minutes) before throwing a generic timeout. Fail fast instead
      // so the caller can surface a clear "the lease is being released"
      // error and decide whether to retry against a fresh Sandbox.
      throw new Error(
        `Sandbox ${namespace}/${name} is Terminating — cannot wait for Ready`,
      );
    }
    // Pending — keep polling
    await sleep(pollMs);
  }

  throw new SandboxCrTimeoutError(namespace, name, opts.timeoutMs);

View on GitHub (pinned to 120ae5428f)

Solutions

  1. Inspect the reported reason/message and the sandbox CR events in the namespace; fix the failing condition.

When it happens

Trigger: Thrown at packages/plugins/sandbox-providers/kubernetes/src/sandbox-cr-orchestrator.ts:281 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of paperclipai/paperclip@120ae5428f (2026-08-18). Data as JSON: /api/errors/3aa36b9758f5dbb3. Report an issue: GitHub.