{"record":{"id":"a66e860f9d95778c","repo":"n8n-io/n8n","slug":"daytona-api-url-is-required-for-sandbox-provider","errorCode":null,"errorMessage":"DAYTONA_API_URL is required for sandbox provider \"daytona\". Set it to e.g. https://app.daytona.io/api.","messagePattern":"DAYTONA_API_URL is required for sandbox provider \"daytona\"\\. Set it to e\\.g\\. https://app\\.daytona\\.io/api\\.","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/@n8n/instance-ai/evaluations/harness/sandbox-config.ts","lineNumber":38,"sourceCode":" */\nconst DEFAULT_DAYTONA_CREATE_TIMEOUT_SECONDS = 900;\nconst VALID_PROVIDERS: SandboxProvider[] = ['n8n-sandbox', 'daytona'];\n\nexport function resolveSandboxConfig(env: NodeJS.ProcessEnv): SandboxConfig {\n\tconst providerRaw = env.N8N_INSTANCE_AI_SANDBOX_PROVIDER ?? 'n8n-sandbox';\n\tif (!VALID_PROVIDERS.includes(providerRaw as SandboxProvider)) {\n\t\tthrow new Error(\n\t\t\t`Invalid sandbox provider \"${providerRaw}\". Set N8N_INSTANCE_AI_SANDBOX_PROVIDER to one of: ${VALID_PROVIDERS.join(', ')}.`,\n\t\t);\n\t}\n\tconst provider = providerRaw as SandboxProvider;\n\tconst timeout = parseTimeout(env.N8N_INSTANCE_AI_SANDBOX_TIMEOUT) ?? DEFAULT_TIMEOUT_MS;\n\n\tif (provider === 'daytona') {\n\t\tconst daytonaApiUrl = env.DAYTONA_API_URL;\n\t\tconst daytonaApiKey = env.DAYTONA_API_KEY;\n\t\tif (!daytonaApiUrl) {\n\t\t\tthrow new Error(\n\t\t\t\t'DAYTONA_API_URL is required for sandbox provider \"daytona\". Set it to e.g. https://app.daytona.io/api.',\n\t\t\t);\n\t\t}\n\t\tif (!daytonaApiKey) {\n\t\t\tthrow new Error(\n\t\t\t\t'DAYTONA_API_KEY is required for sandbox provider \"daytona\". Set the Daytona API key.',\n\t\t\t);\n\t\t}\n\t\tconst image = env.N8N_INSTANCE_AI_SANDBOX_IMAGE;\n\t\tconst namePrefix = env.N8N_INSTANCE_AI_SANDBOX_NAME_PREFIX;\n\t\tconst createTimeoutSeconds =\n\t\t\tparsePositiveInt(\n\t\t\t\tenv.N8N_INSTANCE_AI_SANDBOX_CREATE_TIMEOUT_SECONDS,\n\t\t\t\t'N8N_INSTANCE_AI_SANDBOX_CREATE_TIMEOUT_SECONDS',\n\t\t\t) ?? DEFAULT_DAYTONA_CREATE_TIMEOUT_SECONDS;\n\t\treturn {\n\t\t\tenabled: true,\n\t\t\tprovider: 'daytona',","sourceCodeStart":20,"sourceCodeEnd":56,"githubUrl":"https://github.com/n8n-io/n8n/blob/5ac6606e81f67bb9534255570cd4e86fd8101eee/packages/@n8n/instance-ai/evaluations/harness/sandbox-config.ts#L20-L56","documentation":"Thrown by resolveSandboxConfig when provider is 'daytona' but DAYTONA_API_URL is not set. The Daytona sandbox provider needs a base API URL (e.g. https://app.daytona.io/api) to provision sandboxes; the harness fails at startup rather than mid-run.","triggerScenarios":"Selecting the daytona provider via N8N_INSTANCE_AI_SANDBOX_PROVIDER=daytona without providing DAYTONA_API_URL; the variable is set in a different shell/env than the eval run.","commonSituations":"Local dev switching to daytona but forgetting the URL; CI secret injection skipped this var; the var was renamed in a config refactor.","solutions":["Set DAYTONA_API_URL to the Daytona API base, e.g. https://app.daytona.io/api.","Confirm the variable is exported in the same shell/process that runs the eval.","If you did not intend to use daytona, switch N8N_INSTANCE_AI_SANDBOX_PROVIDER back to 'n8n-sandbox'."],"exampleFix":"# before\nexport N8N_INSTANCE_AI_SANDBOX_PROVIDER=daytona\n# DAYTONA_API_URL unset\n\n# after\nexport N8N_INSTANCE_AI_SANDBOX_PROVIDER=daytona\nexport DAYTONA_API_URL=https://app.daytona.io/api","handlingStrategy":"validation","validationCode":"function daytonaConfigComplete(env: NodeJS.ProcessEnv): boolean {\n  return env.N8N_INSTANCE_AI_SANDBOX_PROVIDER === 'daytona' && !!env.DAYTONA_API_URL;\n}\n\nif (!daytonaConfigComplete(process.env)) {\n  throw new Error('DAYTONA_API_URL missing for daytona provider');\n}","typeGuard":"null","tryCatchPattern":"try {\n  resolveSandboxConfig(process.env);\n} catch (e) {\n  if (e instanceof Error && /DAYTONA_API_URL is required/.test(e.message)) {\n    // prompt operator to set DAYTONA_API_URL, then retry\n  }\n  throw e;\n}","preventionTips":["Use a single sourced env file for all daytona vars.","Assert required daytona vars in a startup self-check.","Keep daytona URL/key injection paired in secret managers."],"tags":["configuration","env-vars","sandbox","daytona"],"backgroundTag":null,"analyzedSha":"5ac6606e81f67bb9534255570cd4e86fd8101eee","analyzedAt":"2026-08-12T05:26:35.080Z","schemaVersion":2},"datasetVersion":"2026-08-13T04:17:16.726Z"}