{"record":{"id":"d8fa02abcddd158f","repo":"mastra-ai/mastra","slug":"sandbox-provider-sandbox-provider-does-not-su-d8fa02","errorCode":null,"errorMessage":"Sandbox provider \"${sandbox.provider}\" does not support executeCommand, which is required for sandbox deploys.","messagePattern":"Sandbox provider \"(.+?)\" does not support executeCommand, which is required for sandbox deploys\\.","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"deployers/sandbox/src/shared.ts","lineNumber":58,"sourceCode":"\n/** Single-quote a value for POSIX shells. */\nexport function shellQuote(value: string): string {\n  return `'${value.replace(/'/g, `'\\\\''`)}'`;\n}\n\n/** Run a shell script string inside the sandbox and throw on failure. */\nexport async function runInSandbox(\n  sandbox: WorkspaceSandbox,\n  script: string,\n  opts?: {\n    allowFailure?: boolean;\n    timeout?: number;\n    /** Safe description used in error messages instead of the script itself. */\n    label?: string;\n  },\n): Promise<{ stdout: string; stderr: string; exitCode: number }> {\n  if (!sandbox.executeCommand) {\n    throw new Error(\n      `Sandbox provider \"${sandbox.provider}\" does not support executeCommand, which is required for sandbox deploys.`,\n    );\n  }\n  // Run via `sh -c` (argv style): providers pass `command` straight to their\n  // exec API as an executable, so a raw script string with spaces would fail.\n  const result = await sandbox.executeCommand(\n    'sh',\n    ['-c', script],\n    opts?.timeout ? { timeout: opts.timeout } : undefined,\n  );\n  if (!result.success && !opts?.allowFailure) {\n    // Never echo the full script back: it can contain secrets (env values)\n    // or entire base64 upload chunks. Use the label or a bounded excerpt.\n    const what = opts?.label ?? truncate(script, 120);\n    throw new Error(\n      `Command failed inside sandbox (exit ${result.exitCode}): ${what}\\n${truncate(result.stderr || result.stdout, 4_000)}`,\n    );\n  }","sourceCodeStart":40,"sourceCodeEnd":76,"githubUrl":"https://github.com/mastra-ai/mastra/blob/75dd419e613fe9c39f846ffc500716141b74fda6/deployers/sandbox/src/shared.ts#L40-L76","documentation":"runInSandbox is the single choke point for all shell commands in a sandbox deploy. The WorkspaceSandbox contract makes executeCommand optional; if the provider did not implement it, no command can run and the library fails fast with the provider name in the message.","triggerScenarios":"Calling deployToSandbox (or anything that routes through runInSandbox: markerCheck, uploadFile, killPreviousServer, launchServer) with a sandbox object whose `executeCommand` is undefined.","commonSituations":"Using a custom or legacy provider that only implements file ops; hand-rolled WorkspaceSandbox objects; version upgrades where a provider has not yet added executeCommand support.","solutions":["Switch to a sandbox provider that implements executeCommand (e.g. the official providers for your target runtime).","If the provider is custom, implement `executeCommand` on your WorkspaceSandbox (run via sh -c, return {stdout, stderr, success/exitCode}).","Use a non-sandbox deployer if the target truly cannot execute commands."],"exampleFix":"// before\nconst sandbox: WorkspaceSandbox = { provider: 'my-legacy', id: 'sbx_1' };\n// after\nconst sandbox: WorkspaceSandbox = { provider: 'my-legacy', id: 'sbx_1', executeCommand: async (cmd, opts) => { /* exec via provider API */ } };","handlingStrategy":"validation","validationCode":"if (typeof sandbox.executeCommand !== 'function') throw new Error(`Provider ${sandbox.provider} cannot run sandbox deploys`);","typeGuard":"function supportsExec(s: WorkspaceSandbox): s is WorkspaceSandbox & Required<Pick<WorkspaceSandbox, 'executeCommand'>> {\n  return typeof s.executeCommand === 'function';\n}","tryCatchPattern":null,"preventionTips":["Type-check sandbox objects at construction: executeCommand must be a function","Never round-trip sandbox objects through JSON (functions are dropped)","Prefer first-party providers; pin provider package versions with the deployer"],"tags":["sandbox","capability","deploy"],"backgroundTag":"sandbox-execute-command-unsupported","analyzedSha":"75dd419e613fe9c39f846ffc500716141b74fda6","analyzedAt":"2026-08-30T00:15:31.844Z","schemaVersion":2},"datasetVersion":"2026-08-30T03:17:51.788Z"}