{"record":{"id":"f01b2c25e64d7707","repo":"mastra-ai/mastra","slug":"sandbox-provider-sandbox-provider-does-not-su","errorCode":null,"errorMessage":"Sandbox provider \"${sandbox.provider}\" does not support networking (public port URLs).","messagePattern":"Sandbox provider \"(.+?)\" does not support networking \\(public port URLs\\)\\.","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"deployers/sandbox/src/client/index.ts","lineNumber":118,"sourceCode":"    },\n    // Resolved lazily — reading logs requires a running sandbox anyway.\n    logs: async (lines?: number) => tailServerLog(sandbox, await resolveRemoteDir(sandbox, options.remoteDir), lines),\n  });\n\n  if (!wake) {\n    // Resolve without starting the sandbox (starting can resume billing).\n    const url = supportsNetworking(sandbox) ? await sandbox.networking.getPortUrl(port) : null;\n    if (!url) {\n      return handle(null, 'stopped');\n    }\n    const healthy = await waitForHealthy(url, { path: healthCheckPath, timeoutMs: 3_000, intervalMs: 1_000 });\n    return handle(url, healthy ? 'running' : 'stopped');\n  }\n\n  await sandbox.start?.();\n\n  if (!supportsNetworking(sandbox)) {\n    throw new Error(`Sandbox provider \"${sandbox.provider}\" does not support networking (public port URLs).`);\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  // Some providers (e.g. Vercel) restore the filesystem but not processes on\n  // resume, while others (e.g. E2B) resume processes too — relaunch the server\n  // from the recorded launch script only when it is not answering.\n  let healthy = await waitForHealthy(url, { path: healthCheckPath, timeoutMs: 3_000, intervalMs: 1_000 });\n  if (!healthy) {\n    const remoteDir = await resolveRemoteDir(sandbox, options.remoteDir);\n    await killPreviousServer(sandbox, remoteDir);\n    await launchServer(sandbox, remoteDir);\n    healthy = await waitForHealthy(url, { path: healthCheckPath, timeoutMs: healthCheckTimeoutMs, intervalMs: 1_000 });","sourceCodeStart":100,"sourceCodeEnd":136,"githubUrl":"https://github.com/mastra-ai/mastra/blob/75dd419e613fe9c39f846ffc500716141b74fda6/deployers/sandbox/src/client/index.ts#L100-L136","documentation":"getDeployment() resolves a sandbox and needs a publicly reachable port URL; this requires the sandbox provider to support networking. When supportsNetworking(sandbox) is false (the provider has no networking capability / getPortUrl), the library throws instead of failing later with an opaque undefined URL. It means the chosen sandbox provider cannot expose public port URLs at all.","triggerScenarios":"Calling getDeployment() for a sandbox whose provider lacks a networking capability — e.g. a local/in-process or exec-only provider — while requesting a port URL, after sandbox.start() succeeds.","commonSituations":"Switching a project from a cloud sandbox provider to a local provider (or vice versa) and forgetting the local one doesn't expose public URLs; constructing a custom provider without implementing networking.getPortUrl; tests using a mock provider without networking.","solutions":["Use a sandbox provider that supports networking (declares ports and implements networking.getPortUrl).","Declare the needed ports when constructing the sandbox (ports: [3000]) so a networking-capable provider can expose URLs.","If the provider intentionally has no networking, obtain the URL through that provider's own mechanism instead of getDeployment()'s port URL path.","Update the provider registration/config so sandbox.provider points at the intended networking-capable provider."],"exampleFix":"// before\nconst sandbox = createLocalSandbox({ provider: 'local' }); // no networking support\nawait getDeployment({ sandbox, port: 3000 });\n// after\nconst sandbox = createCloudSandbox({ provider: 'cloud', ports: [3000] });\nawait getDeployment({ sandbox, port: 3000 });","handlingStrategy":"validation","validationCode":"if (typeof (sandbox as any).networking?.getPortUrl !== 'function') {\n  throw new Error(`Provider \"${sandbox.provider}\" cannot expose public port URLs; choose a networking-capable provider`);\n}","typeGuard":"function supportsNetworking(sandbox: { networking?: unknown }): sandbox is typeof sandbox & { networking: { getPortUrl: (port: number) => Promise<string | undefined> } } {\n  return typeof (sandbox as any).networking?.getPortUrl === 'function';\n}","tryCatchPattern":"try {\n  const dep = await getDeployment({ sandbox, port });\n} catch (err) {\n  if ((err as Error).message.includes('does not support networking')) {\n    console.error(`Provider ${sandbox.provider} lacks public URLs; switch provider or use its native URL mechanism.`);\n  } else throw err;\n}","preventionTips":["Declare ports: [port] when constructing a sandbox so networking-capable providers can expose URLs.","Verify provider capabilities (supportsNetworking) at startup, before deploying.","When writing custom providers, implement the networking capability including getPortUrl.","Keep provider choice consistent across environments; document which providers support public URLs."],"tags":["sandbox","networking","provider","ports"],"backgroundTag":"provider-capability-unsupported","analyzedSha":"75dd419e613fe9c39f846ffc500716141b74fda6","analyzedAt":"2026-08-30T00:15:31.844Z","schemaVersion":2},"datasetVersion":"2026-08-30T03:17:51.788Z"}