{"record":{"id":"784fa0c5fb555929","repo":"mastra-ai/mastra","slug":"no-deploys-found-for-linked-studio-project-linke","errorCode":null,"errorMessage":"No deploys found for linked Studio project ${linkedProject.name}. The suggestions command helps debug failed deployments, and you can run it after a deployment fails with `mastra studio deploy suggestions <deploy-id>` or `mastra studio deploy suggestions`.","messagePattern":"No deploys found for linked Studio project (.+?)\\. The suggestions command helps debug failed deployments, and you can run it after a deployment fails with `mastra studio deploy suggestions <deploy-id>` or `mastra studio deploy suggestions`\\.","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/cli/src/commands/studio/deploy-suggestions.ts","lineNumber":17,"sourceCode":"import * as p from '@clack/prompts';\n\nimport { withPollingRetries } from '../../utils/polling.js';\nimport { getCurrentOrgId, getToken, validateOrgAccess } from '../auth/credentials.js';\nimport { pollForDiagnosis, printDeploySuggestions } from '../deploy-suggestions.js';\nimport { fetchDeployDiagnosis, fetchProjects, startDeployDiagnosis } from './platform-api.js';\nimport type { Project } from './platform-api.js';\nimport { loadProjectConfig } from './project-config.js';\n\nfunction getLatestProjectDeploy(projects: Project[], linkedProjectId?: string) {\n  const linkedProject = linkedProjectId ? projects.find(project => project.id === linkedProjectId) : null;\n  if (linkedProject) {\n    if (linkedProject.latestDeployId) {\n      return { deployId: linkedProject.latestDeployId, projectId: linkedProject.id, projectName: linkedProject.name };\n    }\n\n    throw new Error(\n      `No deploys found for linked Studio project ${linkedProject.name}. The suggestions command helps debug failed deployments, and you can run it after a deployment fails with \\`mastra studio deploy suggestions <deploy-id>\\` or \\`mastra studio deploy suggestions\\`.`,\n    );\n  }\n\n  if (linkedProjectId) {\n    throw new Error(\n      `Linked Studio project ${linkedProjectId} was not found in this organization. Re-link your project or pass a deploy ID explicitly.`,\n    );\n  }\n\n  const latestProject = projects\n    .filter(project => project.latestDeployId)\n    .sort((left, right) => {\n      const leftTime = left.latestDeployCreatedAt ? Date.parse(left.latestDeployCreatedAt) : 0;\n      const rightTime = right.latestDeployCreatedAt ? Date.parse(right.latestDeployCreatedAt) : 0;\n      return rightTime - leftTime;\n    })[0];\n","sourceCodeStart":1,"sourceCodeEnd":35,"githubUrl":"https://github.com/mastra-ai/mastra/blob/75dd419e613fe9c39f846ffc500716141b74fda6/packages/cli/src/commands/studio/deploy-suggestions.ts#L1-L35","documentation":"Thrown by getLatestProjectDeploy when the project linked in the Studio config has no `latestDeployId` — i.e., the linked Studio project exists but has never completed a deploy. The message also advertises the `mastra studio deploy suggestions` command for debugging failed deployments.","triggerScenarios":"Running `mastra studio deploy suggestions` (or any command resolving the latest deploy) when projectConfig.projectId links to a real project whose latestDeployId is null/undefined — typically because the project was created but its first deployment never ran or never succeeded.","commonSituations":"Linking a brand-new Studio project before the first deploy; the very first deploy failing so no deploy ID is recorded; organization switches leaving a stale link to an empty project.","solutions":["Run `mastra studio deploy suggestions` to debug why the deployment failed, or re-run `mastra studio deploy` to create the first deploy.","Pass an explicit deploy ID to the command: `mastra studio deploy suggestions <deploy-id>`.","Confirm the linked project in your config is the intended one; re-link if necessary.","Check the platform dashboard — the project may show a failed first deployment with logs."],"exampleFix":"// before\nmastra studio deploy suggestions\n// after\nmastra studio deploy suggestions <deploy-id>","handlingStrategy":"validation","validationCode":"const projects = await fetchProjects(token, orgId);\nconst linked = projects.find(p => p.id === projectConfig?.projectId);\nif (linked && !linked.latestDeployId) {\n  console.error(`Project ${linked.name} has no deploys yet. Run 'mastra studio deploy' first.`);\n}","typeGuard":null,"tryCatchPattern":"try {\n  const dep = await resolveDeployId(args, ctx);\n} catch (err) {\n  if ((err as Error).message.includes('No deploys found for linked Studio project')) {\n    console.error('Deploy the project first: `mastra studio deploy` (or pass a deploy ID).');\n    return;\n  }\n  throw err;\n}","preventionTips":["Always run the first `mastra studio deploy` before invoking suggestions/logs commands.","Run `mastra studio deploy suggestions` right after a failed deploy to get targeted hints.","Confirm your linked project is the one you actually deployed.","Keep an explicit deploy ID handy for troubleshooting without project resolution."],"tags":["cli","studio","deploy","missing-deploy"],"backgroundTag":"no-deployments-found","analyzedSha":"75dd419e613fe9c39f846ffc500716141b74fda6","analyzedAt":"2026-08-30T00:15:31.844Z","schemaVersion":2},"datasetVersion":"2026-08-30T08:17:16.595Z"}