paperclipai/paperclip · error

Daytona resource settings require image-backed sandbox creat

Error message

Daytona resource settings require image-backed sandbox creation; default sandbox creation cannot override CPU, memory, disk, or GPU.

What it means

Thrown by validateRuntimeResourceRequest at sandbox creation when the driver config carries a resource request (CPU/memory/disk/GPU) but neither config.image nor config.snapshot is set. Daytona only allows resource overrides for image-backed (or snapshot) sandbox creation; the default sandbox creation path cannot apply them.

Source

Thrown at packages/plugins/sandbox-providers/daytona/src/plugin.ts:779

// The workspace remote dir is the confinement root for native file sync. It is
// recorded on the lease metadata at acquire/resume time; require it so a sync can
// never run without a concrete root to confine every sandbox path against.
function resolveSyncRemoteDir(lease: { metadata?: Record<string, unknown> | null }): string {
  const remoteCwd = lease.metadata?.remoteCwd;
  if (typeof remoteCwd === "string" && remoteCwd.trim().length > 0) {
    return remoteCwd.trim();
  }
  throw new Error("Daytona file sync requires a workspace remote dir on the lease metadata.");
}

async function createSandbox(
  params: PluginEnvironmentAcquireLeaseParams | PluginEnvironmentProbeParams | PluginEnvironmentStartInteractiveSetupParams,
  config: DaytonaDriverConfig,
  options: { purpose?: string } = {},
): Promise<Sandbox> {
  const resourceRequestError = validateRuntimeResourceRequest(config);
  if (resourceRequestError) {
    throw new Error(resourceRequestError);
  }
  const client = createDaytonaClient(config);
  const createParams = buildCreateParams(config, buildSandboxLabels({
    companyId: params.companyId,
    environmentId: params.environmentId,
    runId: "runId" in params ? params.runId : undefined,
    setupSessionId: "sessionId" in params ? params.sessionId : undefined,
    purpose: options.purpose,
    reuseLease: config.reuseLease,
  }));
  const sandbox = await client.create(createParams, {
    timeout: toTimeoutSeconds(config.timeoutMs),
  });
  return sandbox;
}

// ─── Per-lease started-sandbox handle cache ──────────────────────────────────
// Memoize the started Daytona `Sandbox` handle so repeated exec/sync/resume/

View on GitHub (pinned to 67001ec6eb)

Solutions

  1. Set config.image (or config.snapshot) so resource overrides apply to image-backed creation.
  2. Or remove the CPU/memory/disk/GPU fields from the driver config if default sandbox creation is intended.
  3. Audit the environment driver config to ensure resource fields and image are consistent.

Example fix

// before: resources without image
config = { cpuCores: 4, memoryMb: 8192 }
// after: image-backed so resources apply
config = { image: 'myimg:latest', cpuCores: 4, memoryMb: 8192 }
Defensive patterns

Strategy: validation

Validate before calling

function resourceConfigIsValid(config: { image?: string | null; snapshot?: string | null; cpuCores?: number; memoryMb?: number; diskGb?: number; gpu?: unknown }): boolean {
  const hasResource = config.cpuCores != null || config.memoryMb != null || config.diskGb != null || config.gpu != null;
  return !hasResource || Boolean(config.image || config.snapshot);
}

Prevention

When it happens

Trigger: createSandbox is called with a DaytonaDriverConfig that has hasResourceRequest true (cpuCores/memoryMb/diskGb/gpu enabled) while config.image and config.snapshot are both unset, triggering validateRuntimeResourceRequest to return the error string.

Common situations: Operator sets cpuCores/memoryMb/diskMb/gpu in the environment driver config but does not set an image (expecting Daytona defaults); leftover resource settings after switching from image to default; config template copied without clearing resources.

Related errors


AI-assisted analysis of paperclipai/paperclip@67001ec6eb (2026-08-12). Data as JSON: /api/errors/58d04efd977614a2. Report an issue: GitHub.