mastra-ai/mastra · error
No deploys found for linked Server project ${project.name}.
Error message
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`. What it means
`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.
Source
Thrown at packages/cli/src/commands/server/deploy-suggestions.ts:20
import { withPollingRetries } from '../../utils/polling.js';
import { pollForDiagnosis, printDeploySuggestions } from '../deploy-suggestions.js';
import { resolveAuth, resolveProjectId } from './env.js';
import { fetchServerDeployDiagnosis, fetchServerProjectDetail, startServerDeployDiagnosis } from './platform-api.js';
async function resolveDeployId(
token: string,
orgId: string,
deployId?: string,
): Promise<{ deployId: string; projectId?: string }> {
if (deployId) {
return { deployId };
}
const projectId = await resolveProjectId({}, { token, orgId });
const { project } = await fetchServerProjectDetail(token, orgId, projectId);
if (!project.latestDeployId) {
throw new Error(
`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\`.`,
);
}
p.log.info(`Using latest deploy: ${project.latestDeployId}${project.name ? ` (${project.name})` : ''}`);
return { deployId: project.latestDeployId, projectId };
}
function buildLogsUrl(orgId: string, projectId: string | undefined, deployId: string): string | undefined {
if (!projectId) return undefined;
return `https://projects.mastra.ai/orgs/${orgId}/server/projects/${projectId}/deploys/${deployId}`;
}
export async function serverSuggestionsAction(deployId: string | undefined, opts: { org?: string }) {
p.intro('mastra server deploy suggestions');
try {
const { token, orgId } = await resolveAuth(opts.org);
const resolved = await resolveDeployId(token, orgId, deployId);View on GitHub (pinned to 75dd419e61)
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)
Example fix
// before mastra server deploy suggestions # project never deployed // after mastra server deploy # create a deployment mastra server deploy suggestions # or: suggestions <deploy-id>
Defensive patterns
Strategy: validation
Validate before calling
const project = await fetchServerProjectDetail(token, orgId, projectId);
if (!project.latestDeployId) {
console.error('Project has no deployments yet — run `mastra server deploy` first.');
process.exit(1);
} Type guard
const hasDeploys = (p: { latestDeployId?: string | null }): p is { latestDeployId: string } =>
typeof p.latestDeployId === 'string' && p.latestDeployId.length > 0; Try / catch
try {
await showDeploySuggestions();
} catch (e) {
if ((e as Error).message.startsWith('No deploys found')) {
console.error('Deploy first, or pass an explicit deploy id.');
} else throw e;
} Prevention
- 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
When it happens
Trigger: 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).
Common situations: 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.
Understand the failure class
Background: 'Could not be found', 'does not exist', 'not found in database': the resource-not-found family when an ID, slug, key, or URI lookup comes back empty — this error's family across 20 libraries.
Related errors
- detail
- ${message}: ${status}
- You have no organizations. Please create one at ${MASTRA_STU
- Found ${projects.length} existing project(s) in this organiz
- Could not determine project name from package.json. Use --pr
AI-assisted analysis of mastra-ai/mastra@75dd419e61 (2026-08-30).
Data as JSON: /api/errors/54846528c458315c.
Report an issue: GitHub.