{"record":{"id":"58d04efd977614a2","repo":"paperclipai/paperclip","slug":"daytona-resource-settings-require-image-backed-san","errorCode":null,"errorMessage":"Daytona resource settings require image-backed sandbox creation; default sandbox creation cannot override CPU, memory, disk, or GPU.","messagePattern":"Daytona resource settings require image-backed sandbox creation; default sandbox creation cannot override CPU, memory, disk, or GPU\\.","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"packages/plugins/sandbox-providers/daytona/src/plugin.ts","lineNumber":779,"sourceCode":"// The workspace remote dir is the confinement root for native file sync. It is\n// recorded on the lease metadata at acquire/resume time; require it so a sync can\n// never run without a concrete root to confine every sandbox path against.\nfunction resolveSyncRemoteDir(lease: { metadata?: Record<string, unknown> | null }): string {\n  const remoteCwd = lease.metadata?.remoteCwd;\n  if (typeof remoteCwd === \"string\" && remoteCwd.trim().length > 0) {\n    return remoteCwd.trim();\n  }\n  throw new Error(\"Daytona file sync requires a workspace remote dir on the lease metadata.\");\n}\n\nasync function createSandbox(\n  params: PluginEnvironmentAcquireLeaseParams | PluginEnvironmentProbeParams | PluginEnvironmentStartInteractiveSetupParams,\n  config: DaytonaDriverConfig,\n  options: { purpose?: string } = {},\n): Promise<Sandbox> {\n  const resourceRequestError = validateRuntimeResourceRequest(config);\n  if (resourceRequestError) {\n    throw new Error(resourceRequestError);\n  }\n  const client = createDaytonaClient(config);\n  const createParams = buildCreateParams(config, buildSandboxLabels({\n    companyId: params.companyId,\n    environmentId: params.environmentId,\n    runId: \"runId\" in params ? params.runId : undefined,\n    setupSessionId: \"sessionId\" in params ? params.sessionId : undefined,\n    purpose: options.purpose,\n    reuseLease: config.reuseLease,\n  }));\n  const sandbox = await client.create(createParams, {\n    timeout: toTimeoutSeconds(config.timeoutMs),\n  });\n  return sandbox;\n}\n\n// ─── Per-lease started-sandbox handle cache ──────────────────────────────────\n// Memoize the started Daytona `Sandbox` handle so repeated exec/sync/resume/","sourceCodeStart":761,"sourceCodeEnd":797,"githubUrl":"https://github.com/paperclipai/paperclip/blob/67001ec6eb96ae601aa27bc91d9b2415d665334a/packages/plugins/sandbox-providers/daytona/src/plugin.ts#L761-L797","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","solutions":["Set config.image (or config.snapshot) so resource overrides apply to image-backed creation.","Or remove the CPU/memory/disk/GPU fields from the driver config if default sandbox creation is intended.","Audit the environment driver config to ensure resource fields and image are consistent."],"exampleFix":"// before: resources without image\nconfig = { cpuCores: 4, memoryMb: 8192 }\n// after: image-backed so resources apply\nconfig = { image: 'myimg:latest', cpuCores: 4, memoryMb: 8192 }","handlingStrategy":"validation","validationCode":"function resourceConfigIsValid(config: { image?: string | null; snapshot?: string | null; cpuCores?: number; memoryMb?: number; diskGb?: number; gpu?: unknown }): boolean {\n  const hasResource = config.cpuCores != null || config.memoryMb != null || config.diskGb != null || config.gpu != null;\n  return !hasResource || Boolean(config.image || config.snapshot);\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["When setting CPU/memory/disk/GPU in the driver config, also set image or snapshot.","Clear resource fields if you intend Daytona's default sandbox creation.","Validate the config shape before submitting to createSandbox."],"tags":["daytona","config","resources","sandbox-creation","validation"],"backgroundTag":null,"analyzedSha":"67001ec6eb96ae601aa27bc91d9b2415d665334a","analyzedAt":"2026-08-12T12:05:45.408Z","schemaVersion":2},"datasetVersion":"2026-08-12T18:17:37.767Z"}