{"record":{"id":"54846528c458315c","repo":"mastra-ai/mastra","slug":"no-deploys-found-for-linked-server-project-proje","errorCode":null,"errorMessage":"No deploys found for linked Server project ${project.name}. The suggestions command helps debug failed deployments, and you can run it after a deployment fails with `mastra server deploy suggestions <deploy-id>` or `mastra server deploy suggestions`.","messagePattern":"No deploys found for linked Server project (.+?)\\. The suggestions command helps debug failed deployments, and you can run it after a deployment fails with `mastra server deploy suggestions <deploy-id>` or `mastra server deploy suggestions`\\.","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"packages/cli/src/commands/server/deploy-suggestions.ts","lineNumber":20,"sourceCode":"\nimport { withPollingRetries } from '../../utils/polling.js';\nimport { pollForDiagnosis, printDeploySuggestions } from '../deploy-suggestions.js';\nimport { resolveAuth, resolveProjectId } from './env.js';\nimport { fetchServerDeployDiagnosis, fetchServerProjectDetail, startServerDeployDiagnosis } from './platform-api.js';\n\nasync function resolveDeployId(\n  token: string,\n  orgId: string,\n  deployId?: string,\n): Promise<{ deployId: string; projectId?: string }> {\n  if (deployId) {\n    return { deployId };\n  }\n\n  const projectId = await resolveProjectId({}, { token, orgId });\n  const { project } = await fetchServerProjectDetail(token, orgId, projectId);\n  if (!project.latestDeployId) {\n    throw new Error(\n      `No deploys found for linked Server project ${project.name}. The suggestions command helps debug failed deployments, and you can run it after a deployment fails with \\`mastra server deploy suggestions <deploy-id>\\` or \\`mastra server deploy suggestions\\`.`,\n    );\n  }\n\n  p.log.info(`Using latest deploy: ${project.latestDeployId}${project.name ? ` (${project.name})` : ''}`);\n  return { deployId: project.latestDeployId, projectId };\n}\n\nfunction buildLogsUrl(orgId: string, projectId: string | undefined, deployId: string): string | undefined {\n  if (!projectId) return undefined;\n  return `https://projects.mastra.ai/orgs/${orgId}/server/projects/${projectId}/deploys/${deployId}`;\n}\n\nexport async function serverSuggestionsAction(deployId: string | undefined, opts: { org?: string }) {\n  p.intro('mastra server deploy suggestions');\n  try {\n    const { token, orgId } = await resolveAuth(opts.org);\n    const resolved = await resolveDeployId(token, orgId, deployId);","sourceCodeStart":2,"sourceCodeEnd":38,"githubUrl":"https://github.com/mastra-ai/mastra/blob/75dd419e613fe9c39f846ffc500716141b74fda6/packages/cli/src/commands/server/deploy-suggestions.ts#L2-L38","documentation":"`resolveDeployId` needs a deploy id to show deployment suggestions. When no explicit deploy id was passed, it falls back to the linked Server project's latestDeployId; if the project has never been deployed, the CLI throws this guidance error pointing at the suggestions command and required workflow.","triggerScenarios":"Running `mastra server deploy suggestions` with no deploy-id argument, while the authenticated org's linked project has latestDeployId === null/undefined (no deployments exist yet).","commonSituations":"Running the suggestions command on a brand-new project before its first deploy; querying the wrong org/project that has no deploys; API returning a project without deployment history.","solutions":["Deploy the project first with `mastra server deploy`, then rerun suggestions","Pass an explicit deploy id: `mastra server deploy suggestions <deploy-id>`","Verify you are linked to the correct project/org (`mastra server link` or equivalent)"],"exampleFix":"// before\nmastra server deploy suggestions   # project never deployed\n// after\nmastra server deploy               # create a deployment\nmastra server deploy suggestions   # or: suggestions <deploy-id>","handlingStrategy":"validation","validationCode":"const project = await fetchServerProjectDetail(token, orgId, projectId);\nif (!project.latestDeployId) {\n  console.error('Project has no deployments yet — run `mastra server deploy` first.');\n  process.exit(1);\n}","typeGuard":"const hasDeploys = (p: { latestDeployId?: string | null }): p is { latestDeployId: string } =>\n  typeof p.latestDeployId === 'string' && p.latestDeployId.length > 0;","tryCatchPattern":"try {\n  await showDeploySuggestions();\n} catch (e) {\n  if ((e as Error).message.startsWith('No deploys found')) {\n    console.error('Deploy first, or pass an explicit deploy id.');\n  } else throw e;\n}","preventionTips":["Deploy at least once before asking for suggestions","Confirm you are linked to the intended project/org","Pass the deploy id explicitly in scripts/CI","Verify org selection before troubleshooting deployments"],"tags":["cli","deploy","server","api"],"backgroundTag":"resource-not-found","analyzedSha":"75dd419e613fe9c39f846ffc500716141b74fda6","analyzedAt":"2026-08-30T00:15:31.844Z","schemaVersion":2},"datasetVersion":"2026-08-30T03:17:51.788Z"}