{"record":{"id":"9d65fad5977ee322","repo":"mastra-ai/mastra","slug":"sandbox-provider-sandbox-provider-does-not-su-9d65fa","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/engine.ts","lineNumber":74,"sourceCode":"    logger = noopLogger,\n  } = options;\n\n  if (!existsSync(join(dir, 'index.mjs'))) {\n    throw new Error(`No index.mjs found in \"${dir}\" — did the build succeed?`);\n  }\n\n  // 1. Start (providers handle create-or-resume by identity, e.g. sandbox name).\n  logger.info(`Starting ${sandbox.provider} sandbox...`);\n  await sandbox.start?.();\n\n  if (!supportsNetworking(sandbox)) {\n    throw new Error(\n      `Sandbox provider \"${sandbox.provider}\" does not support networking (public port URLs), ` +\n        `which is required for sandbox deploys.`,\n    );\n  }\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\n  const url = await sandbox.networking.getPortUrl(port);\n  if (!url) {\n    throw new Error(\n      `Sandbox provider \"${sandbox.provider}\" did not expose a public URL for port ${port}. ` +\n        `Make sure the port is declared when constructing the sandbox (e.g. \\`ports: [${port}]\\`).`,\n    );\n  }\n\n  // Default the remote dir to $HOME/mastra-app — home directories persist\n  // across snapshot stop/resume (unlike /tmp), so wakes find the app intact.\n  const remoteDir = await resolveRemoteDir(sandbox, options.remoteDir);\n\n  const mergedEnv = { ...env };\n  if (studio && mergedEnv.MASTRA_STUDIO_PATH === undefined) {","sourceCodeStart":56,"sourceCodeEnd":92,"githubUrl":"https://github.com/mastra-ai/mastra/blob/75dd419e613fe9c39f846ffc500716141b74fda6/deployers/sandbox/src/engine.ts#L56-L92","documentation":"deployToSandbox requires the provider to support executeCommand to run install/start commands inside the sandbox. After the networking check passes, the engine verifies sandbox.executeCommand exists; a provider without it cannot deploy.","triggerScenarios":"deployToSandbox is called with a sandbox object whose executeCommand method is undefined — feature check `if (!sandbox.executeCommand)` fires.","commonSituations":"Custom or mock sandbox implementations missing executeCommand; providers that only support start/stop (e.g. pure URL proxies); passing the wrong object type as the first argument.","solutions":["Use a provider implementation that supports executeCommand","Implement executeCommand(cmd, opts) in a custom provider (run a shell command inside the sandbox)","Double-check you are passing a Sandbox instance, not a client or config object"],"exampleFix":"// before\nawait deployToSandbox(urlProxySandbox, opts); // no executeCommand\n// after\nawait deployToSandbox(fullCloudSandbox, opts); // implements executeCommand","handlingStrategy":"type-guard","validationCode":"if (typeof sandbox.executeCommand !== 'function') {\n  console.warn('provider cannot run commands; sandbox deploys require executeCommand');\n}","typeGuard":"function supportsExecuteCommand(s: Sandbox): s is Sandbox & Required<Pick<Sandbox, 'executeCommand'>> {\n  return typeof (s as any).executeCommand === 'function';\n}","tryCatchPattern":null,"preventionTips":["Use providers that implement executeCommand for sandbox deploys","For custom providers, implement executeCommand before enabling deploy","Validate the sandbox object type at the call site"],"tags":["sandbox","capability","execute-command","deployment"],"backgroundTag":"provider-capability-unsupported","analyzedSha":"75dd419e613fe9c39f846ffc500716141b74fda6","analyzedAt":"2026-08-30T00:15:31.844Z","schemaVersion":2},"datasetVersion":"2026-08-30T08:17:16.595Z"}