paperclipai/paperclip · error

PAPERCLIP_K8S_BACKEND must be "job" or "sandbox-cr" (got "${

Error message

PAPERCLIP_K8S_BACKEND must be "job" or "sandbox-cr" (got "${backend}").

What it means

Backend guard in parseExecutionPolicyBootstrapEnv: PAPERCLIP_K8S_BACKEND is set but is neither 'job' nor 'sandbox-cr'. Rejected at bootstrap so an unknown Kubernetes execution backend never reaches environment provisioning.

Source

Thrown at server/src/services/execution-policy-bootstrap.ts:90

): ExecutionPolicyBootstrap | null {
  const raw = env.PAPERCLIP_EXECUTION_MODE?.trim();
  if (!raw || raw === "any") return null;
  if (raw !== "kubernetes") {
    throw new Error(
      `PAPERCLIP_EXECUTION_MODE must be "kubernetes" or "any" (got "${raw}").`,
    );
  }

  const kubernetesConfig: KubernetesEnvironmentConfigInput = {
    // inCluster defaults to false (matches the plugin schema default); an
    // in-cluster cloud deployment sets PAPERCLIP_K8S_IN_CLUSTER=true.
    inCluster: parseBool(env.PAPERCLIP_K8S_IN_CLUSTER) ?? false,
  };

  const backend = env.PAPERCLIP_K8S_BACKEND?.trim();
  if (backend) {
    if (backend !== "job" && backend !== "sandbox-cr") {
      throw new Error(
        `PAPERCLIP_K8S_BACKEND must be "job" or "sandbox-cr" (got "${backend}").`,
      );
    }
    kubernetesConfig.backend = backend;
  }

  const egressMode = env.PAPERCLIP_K8S_EGRESS_MODE?.trim();
  if (egressMode) {
    if (egressMode !== "cilium" && egressMode !== "standard") {
      throw new Error(
        `PAPERCLIP_K8S_EGRESS_MODE must be "cilium" or "standard" (got "${egressMode}").`,
      );
    }
    kubernetesConfig.egressMode = egressMode;
  }

  const runtimeClassName = env.PAPERCLIP_K8S_RUNTIME_CLASS_NAME?.trim();
  if (runtimeClassName) kubernetesConfig.runtimeClassName = runtimeClassName;

View on GitHub (pinned to 120ae5428f)

Solutions

  1. Set PAPERCLIP_K8S_BACKEND to "job" or "sandbox-cr".
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at server/src/services/execution-policy-bootstrap.ts:90 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/2b1e834b77b24832. Report an issue: GitHub.