{"record":{"id":"a40cdfb26ff5f84c","repo":"n8n-io/n8n","slug":"failed-to-create-sandbox-workspace-directory-pa","errorCode":null,"errorMessage":"Failed to create sandbox workspace directory \"${path}\": ${getErrorMessage(error)}; command fallback failed: ${getErrorMessage(fallbackError)}","messagePattern":"Failed to create sandbox workspace directory \"(.+?)\": (.+?); command fallback failed: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"packages/@n8n/instance-ai/src/workspace/sandbox-setup.ts","lineNumber":357,"sourceCode":"}\n\ntype WorkspaceFilesystem = NonNullable<SandboxWorkspace['filesystem']>;\n\nasync function createWorkspaceDirectory(\n\tworkspace: SandboxWorkspace,\n\tfilesystem: WorkspaceFilesystem,\n\tpath: string,\n): Promise<void> {\n\ttry {\n\t\tawait filesystem.mkdir(path, { recursive: true });\n\t} catch (error) {\n\t\ttry {\n\t\t\tconst result = await runInSandbox(workspace, `mkdir -p '${escapeSingleQuotes(path)}'`);\n\t\t\tif (result.exitCode === 0) return;\n\n\t\t\tthrow new Error(result.stderr || `mkdir exited with code ${result.exitCode}`);\n\t\t} catch (fallbackError) {\n\t\t\tthrow new Error(\n\t\t\t\t`Failed to create sandbox workspace directory \"${path}\": ${getErrorMessage(error)}; command fallback failed: ${getErrorMessage(fallbackError)}`,\n\t\t\t);\n\t\t}\n\t}\n}\n\nasync function writeWorkspaceFile(\n\tworkspace: SandboxWorkspace,\n\tfilesystem: WorkspaceFilesystem,\n\tpath: string,\n\tcontent: string | Buffer,\n): Promise<void> {\n\ttry {\n\t\tawait filesystem.writeFile(path, content, { recursive: true });\n\t} catch (error) {\n\t\ttry {\n\t\t\tawait writeFileViaSandbox(workspace, path, content);\n\t\t} catch (fallbackError) {","sourceCodeStart":339,"sourceCodeEnd":375,"githubUrl":"https://github.com/n8n-io/n8n/blob/5ac6606e81f67bb9534255570cd4e86fd8101eee/packages/@n8n/instance-ai/src/workspace/sandbox-setup.ts#L339-L375","documentation":"Error \"Failed to create sandbox workspace directory \"${path}\": ${getErrorMessage(error)}; command fallback failed: ${getErrorMessage(fallbackError)}\" thrown in n8n-io/n8n.","triggerScenarios":"Thrown at packages/@n8n/instance-ai/src/workspace/sandbox-setup.ts:357 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"5ac6606e81f67bb9534255570cd4e86fd8101eee","analyzedAt":"2026-08-12T05:26:35.080Z","schemaVersion":2},"datasetVersion":"2026-08-12T13:17:24.610Z"}