{"record":{"id":"6f51da74aff95ae4","repo":"n8n-io/n8n","slug":"n8n-sandbox-service-url-is-required-for-sandbox-pr","errorCode":null,"errorMessage":"N8N_SANDBOX_SERVICE_URL is required for sandbox provider \"n8n-sandbox\". Set it to the service URL.","messagePattern":"N8N_SANDBOX_SERVICE_URL is required for sandbox provider \"n8n-sandbox\"\\. Set it to the service URL\\.","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/@n8n/instance-ai/evaluations/harness/sandbox-config.ts","lineNumber":69,"sourceCode":"\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',\n\t\t\tdaytonaApiUrl,\n\t\t\tdaytonaApiKey,\n\t\t\ttimeout,\n\t\t\tcreateTimeoutSeconds,\n\t\t\t...(image ? { image } : {}),\n\t\t\t...(namePrefix ? { namePrefix } : {}),\n\t\t};\n\t}\n\n\tif (provider === 'n8n-sandbox') {\n\t\tconst serviceUrl = env.N8N_SANDBOX_SERVICE_URL;\n\t\tif (!serviceUrl) {\n\t\t\tthrow new Error(\n\t\t\t\t'N8N_SANDBOX_SERVICE_URL is required for sandbox provider \"n8n-sandbox\". Set it to the service URL.',\n\t\t\t);\n\t\t}\n\t\tconst apiKey = env.N8N_SANDBOX_SERVICE_API_KEY;\n\t\treturn {\n\t\t\tenabled: true,\n\t\t\tprovider: 'n8n-sandbox',\n\t\t\tserviceUrl,\n\t\t\t...(apiKey ? { apiKey } : {}),\n\t\t\ttimeout,\n\t\t};\n\t}\n\n\tconst exhaustiveProvider: never = provider;\n\tthrow new Error(\n\t\t`Invalid sandbox provider \"${String(exhaustiveProvider)}\". Set N8N_INSTANCE_AI_SANDBOX_PROVIDER to one of: ${VALID_PROVIDERS.join(', ')}.`,\n\t);\n}","sourceCodeStart":51,"sourceCodeEnd":87,"githubUrl":"https://github.com/n8n-io/n8n/blob/5ac6606e81f67bb9534255570cd4e86fd8101eee/packages/@n8n/instance-ai/evaluations/harness/sandbox-config.ts#L51-L87","documentation":"Thrown by resolveSandboxConfig when provider is 'n8n-sandbox' (the default) but N8N_SANDBOX_SERVICE_URL is not set. The n8n-sandbox provider needs the service URL of the running sandbox microservice to forward build/exec requests.","triggerScenarios":"Default provider is used but the sandbox service URL env var was never configured; the service moved and the URL was not updated; the variable is set in docker-compose but not passed through to the eval process.","commonSituations":"Running the eval harness locally for the first time without configuring the sandbox service; deploying to a new environment and forgetting this var; the sandbox service was scaled to a new host.","solutions":["Set N8N_SANDBOX_SERVICE_URL to the sandbox service base URL (e.g. http://sandbox-service:8080).","Ensure the sandbox service is reachable from the eval process (DNS/network).","If you intended to use Daytona instead, set N8N_INSTANCE_AI_SANDBOX_PROVIDER=daytona and provide DAYTONA_*."],"exampleFix":"# before — default provider, no service URL\n# N8N_SANDBOX_SERVICE_URL unset\n\n# after\nexport N8N_SANDBOX_SERVICE_URL=http://sandbox-service:8080","handlingStrategy":"validation","validationCode":"function n8nSandboxConfigComplete(env: NodeJS.ProcessEnv): boolean {\n  const provider = env.N8N_INSTANCE_AI_SANDBOX_PROVIDER ?? 'n8n-sandbox';\n  return provider !== 'n8n-sandbox' || !!env.N8N_SANDBOX_SERVICE_URL;\n}\n\nif (!n8nSandboxConfigComplete(process.env)) {\n  throw new Error('N8N_SANDBOX_SERVICE_URL missing for n8n-sandbox provider');\n}","typeGuard":"null","tryCatchPattern":"try {\n  resolveSandboxConfig(process.env);\n} catch (e) {\n  if (e instanceof Error && /N8N_SANDBOX_SERVICE_URL is required/.test(e.message)) {\n    // set the URL or switch provider, then retry\n  }\n  throw e;\n}","preventionTips":["Default the service URL in dev config templates.","Document the sandbox service deployment alongside this var.","Add a connectivity check (TCP/HTTP) for the URL at startup."],"tags":["configuration","env-vars","sandbox","n8n-sandbox"],"backgroundTag":null,"analyzedSha":"5ac6606e81f67bb9534255570cd4e86fd8101eee","analyzedAt":"2026-08-12T05:26:35.080Z","schemaVersion":2},"datasetVersion":"2026-08-13T04:17:16.726Z"}