{"record":{"id":"427a774706b09fe6","repo":"mastra-ai/mastra","slug":"sandbox-provider-sandbox-provider-does-not-su-427a77","errorCode":null,"errorMessage":"Sandbox provider \"${sandbox.provider}\" does not support networking (public port URLs), which is required for sandbox deploys.","messagePattern":"Sandbox provider \"(.+?)\" does not support networking \\(public port URLs\\), which is required for sandbox deploys\\.","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"deployers/sandbox/src/engine.ts","lineNumber":68,"sourceCode":"    env = {},\n    studio = false,\n    healthCheckPath = '/api',\n    healthCheckTimeoutMs = 60_000,\n    healthCheckIntervalMs = 1_000,\n    installCommand = 'npm install --omit=dev',\n    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","sourceCodeStart":50,"sourceCodeEnd":86,"githubUrl":"https://github.com/mastra-ai/mastra/blob/75dd419e613fe9c39f846ffc500716141b74fda6/deployers/sandbox/src/engine.ts#L50-L86","documentation":"Sandbox deploys need public port URLs to route traffic to the running Mastra server. deployToSandbox checks supportsNetworking(sandbox) after starting the sandbox and refuses to continue when the provider implementation lacks the networking capability (no networking.getPortUrl support).","triggerScenarios":"Calling deployToSandbox with a sandbox provider object that does not implement networking (e.g. a local/exec-only provider) — the feature-detection helper supportsNetworking returns false.","commonSituations":"Using a provider built for local development only with the remote deploy engine; switching deploy targets from cloud to a minimal custom provider; older/custom provider integrations predating the networking API.","solutions":["Use a networking-capable provider for sandbox deploys","Implement the networking capability (networking.getPortUrl) in your custom provider","Declare ports in the provider config so URLs can be exposed","Route local-only sandboxes through a different deploy path (not deployToSandbox)"],"exampleFix":"// before\nconst sandbox = new ExecOnlySandbox();\nawait deployToSandbox(sandbox, options);\n// after\nconst sandbox = new CloudSandbox({ ports: [8788] });\nawait deployToSandbox(sandbox, options);","handlingStrategy":"type-guard","validationCode":"// check capability before deploying\nif (typeof sandbox.networking?.getPortUrl !== 'function') {\n  console.warn('provider cannot expose public URLs; use a networking-capable sandbox');\n}","typeGuard":"function supportsNetworking(s: Sandbox): s is Sandbox & Required<Pick<Sandbox, 'networking'>> {\n  return typeof (s as any).networking?.getPortUrl === 'function';\n}","tryCatchPattern":null,"preventionTips":["Use cloud sandbox providers for remote deploys","Implement networking in custom providers before adopting deployToSandbox","Feature-check providers in a startup assertion"],"tags":["sandbox","networking","capability","deployment"],"backgroundTag":"provider-capability-unsupported","analyzedSha":"75dd419e613fe9c39f846ffc500716141b74fda6","analyzedAt":"2026-08-30T00:15:31.844Z","schemaVersion":2},"datasetVersion":"2026-08-30T03:17:51.788Z"}