mastra-ai/mastra · error · Error
No deploys found for linked Studio project ${linkedProject.n
Error message
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`. What it means
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.
Source
Thrown at packages/cli/src/commands/studio/deploy-suggestions.ts:17
import * as p from '@clack/prompts';
import { withPollingRetries } from '../../utils/polling.js';
import { getCurrentOrgId, getToken, validateOrgAccess } from '../auth/credentials.js';
import { pollForDiagnosis, printDeploySuggestions } from '../deploy-suggestions.js';
import { fetchDeployDiagnosis, fetchProjects, startDeployDiagnosis } from './platform-api.js';
import type { Project } from './platform-api.js';
import { loadProjectConfig } from './project-config.js';
function getLatestProjectDeploy(projects: Project[], linkedProjectId?: string) {
const linkedProject = linkedProjectId ? projects.find(project => project.id === linkedProjectId) : null;
if (linkedProject) {
if (linkedProject.latestDeployId) {
return { deployId: linkedProject.latestDeployId, projectId: linkedProject.id, projectName: linkedProject.name };
}
throw new Error(
`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\`.`,
);
}
if (linkedProjectId) {
throw new Error(
`Linked Studio project ${linkedProjectId} was not found in this organization. Re-link your project or pass a deploy ID explicitly.`,
);
}
const latestProject = projects
.filter(project => project.latestDeployId)
.sort((left, right) => {
const leftTime = left.latestDeployCreatedAt ? Date.parse(left.latestDeployCreatedAt) : 0;
const rightTime = right.latestDeployCreatedAt ? Date.parse(right.latestDeployCreatedAt) : 0;
return rightTime - leftTime;
})[0];
View on GitHub (pinned to 75dd419e61)
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.
Example fix
// before mastra studio deploy suggestions // after mastra studio deploy suggestions <deploy-id>
Defensive patterns
Strategy: validation
Validate before calling
const projects = await fetchProjects(token, orgId);
const linked = projects.find(p => p.id === projectConfig?.projectId);
if (linked && !linked.latestDeployId) {
console.error(`Project ${linked.name} has no deploys yet. Run 'mastra studio deploy' first.`);
} Try / catch
try {
const dep = await resolveDeployId(args, ctx);
} catch (err) {
if ((err as Error).message.includes('No deploys found for linked Studio project')) {
console.error('Deploy the project first: `mastra studio deploy` (or pass a deploy ID).');
return;
}
throw err;
} Prevention
- 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.
When it happens
Trigger: 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.
Common situations: 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.
Related errors
- No previous studio deploy found. Pass a deploy ID or deploy
- 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
- .mastra/output/index.mjs not found — did the build succeed?
AI-assisted analysis of mastra-ai/mastra@75dd419e61 (2026-08-30).
Data as JSON: /api/errors/784fa0c5fb555929.
Report an issue: GitHub.