mastra-ai/mastra · error · HTTPException
Version with id ${from} not found
Error message
Version with id ${from} not found What it means
This 404 is thrown by the scorer-versions copy-configuration handler when `scorerStore.getVersion(from)` returns no version for the `from` version id supplied in the request. The server validates that both source and target versions exist before copying configuration between scorer versions. It means the referenced version id does not exist in the scorer storage.
Source
Thrown at packages/server/src/server/handlers/scorer-versions.ts:469
tags: ['Scorer Versions'],
handler: async ({ mastra, scorerId, from, to, requestContext }) => {
try {
const storage = mastra.getStorage();
if (!storage) {
throw new HTTPException(500, { message: 'Storage is not configured' });
}
const scorerStore = await storage.getStore('scorerDefinitions');
if (!scorerStore) {
throw new HTTPException(500, { message: 'Scorer definitions storage domain is not available' });
}
const scorer = await scorerStore.getById(scorerId);
assertStoredResourceScope(scorer, await getStoredResourceScope(mastra, requestContext));
const fromVersion = await scorerStore.getVersion(from);
if (!fromVersion) {
throw new HTTPException(404, { message: `Version with id ${from} not found` });
}
if (fromVersion.scorerDefinitionId !== scorerId) {
throw new HTTPException(404, {
message: `Version with id ${from} not found for scorer ${scorerId}`,
});
}
const toVersion = await scorerStore.getVersion(to);
if (!toVersion) {
throw new HTTPException(404, { message: `Version with id ${to} not found` });
}
if (toVersion.scorerDefinitionId !== scorerId) {
throw new HTTPException(404, {
message: `Version with id ${to} not found for scorer ${scorerId}`,
});
}
const fromConfig = extractConfigFromVersion(View on GitHub (pinned to 75dd419e61)
Solutions
- List the scorer's versions via the scorers API/storage to confirm the correct `from` version id exists.
- Check that you are connected to the storage backend (database) that actually contains the version.
- Correct the `from` id in your request payload or URL.
- If the version was deleted, recreate it or pick an existing version as the source.
Example fix
// before
await fetch(`/api/scorers/${scorerId}/versions/copy`, { method: 'POST', body: JSON.stringify({ from: 'stale-version-id', to: currentVersionId }) });
// after
const versions = await fetch(`/api/scorers/${scorerId}/versions`).then(r => r.json());
const from = versions[0].id; // use a version id that actually exists
await fetch(`/api/scorers/${scorerId}/versions/copy`, { method: 'POST', body: JSON.stringify({ from, to: currentVersionId }) }); Defensive patterns
Strategy: validation
Validate before calling
const versions = await fetch(`/api/scorers/${scorerId}/versions`).then(r => r.json());
if (!versions.some(v => v.id === fromId)) throw new Error(`from version ${fromId} does not exist for ${scorerId}`); Try / catch
try {
await copyScorerVersionConfig({ scorerId, from, to });
} catch (e) {
if (e instanceof MastraClientError && e.status === 404) {
console.error(`Version '${from}' not found; fetch valid versions and retry with an existing id.`);
} else throw e;
} Prevention
- Always resolve version ids dynamically from the versions list endpoint rather than hard-coding them.
- Keep per-environment version ids in config, not shared constants.
- Log the scorerId alongside version ids to avoid cross-scorer mixups.
When it happens
Trigger: Calling the scorer version config-copy endpoint with a `from` version id that was never created, was deleted, or belongs to another Mastra instance/storage backend.
Common situations: Copy-pasting a stale version id from logs or an old database; switching environments (dev vs prod storage) where version ids differ; typos in the version UUID; using a version id from a deleted scorer definition.
Related errors
- Version with id ${to} not found
- Model "${modelId}" is not available. Available models: ${ids
- ACP connection is not initialized
- Model "${this.options.model}" is not available. Available mo
- ClaudeSDKAgent resumeData must include either sessionId or c
AI-assisted analysis of mastra-ai/mastra@75dd419e61 (2026-08-30).
Data as JSON: /api/errors/8fef0af4361706bf.
Report an issue: GitHub.