mastra-ai/mastra · error
No versions found for skill ${id}
Error message
No versions found for skill ${id} What it means
When FilesystemSkillsStorage.update detects a config-field change, it creates a new version derived from the latest existing version. If the skill exists but has no versions at all (corrupt or partially-written state), there is no base to copy from, so it throws this error.
Source
Thrown at packages/core/src/storage/domains/skills/filesystem.ts:127
const updatedEntity: StorageSkillType = {
...existing,
...(authorId !== undefined && { authorId }),
...(visibility !== undefined && { visibility }),
...(activeVersionId !== undefined && { activeVersionId }),
...(status !== undefined && { status: status as StorageSkillType['status'] }),
updatedAt: new Date(),
};
// Auto-set status to 'published' when activeVersionId is set without explicit status
if (activeVersionId !== undefined && status === undefined) {
updatedEntity.status = 'published';
}
// If config fields are being updated, create a new version
if (hasConfigUpdate) {
const latestVersion = await this.getLatestVersion(id);
if (!latestVersion) {
throw new Error(`No versions found for skill ${id}`);
}
const {
id: _versionId,
skillId: _skillId,
versionNumber: _versionNumber,
changedFields: _changedFields,
changeMessage: _changeMessage,
createdAt: _createdAt,
...latestConfig
} = latestVersion;
const newConfig = {
...latestConfig,
...configFields,
};
const changedFields = configFieldNames.filter(View on GitHub (pinned to 75dd419e61)
Solutions
- Recreate the skill (delete and re-create) so an initial version is written.
- Manually restore/repair the missing version file(s) in the storage directory.
- Update only metadata fields (authorId, visibility, activeVersionId, status) instead of config fields until a version exists.
- Check disk health/write process for the partial-write that dropped the versions.
Example fix
// before
await storage.update({ id: 'my-skill', instructions: 'new' }); // throws: no versions
// after
await storage.create({ skill: { id: 'my-skill', instructions: 'new', ...rest } }); // fresh skill+version Defensive patterns
Strategy: validation
Validate before calling
const latest = await storage.getLatestVersion(id);
if (!latest) throw new Error(`skill ${id} has no version history; recreate it`); Type guard
async function hasVersionHistory(storage: FilesystemSkillsStorage, id: string): Promise<boolean> {
return (await storage.getLatestVersion(id)) != null;
} Try / catch
try {
return await storage.update(input);
} catch (e) {
if (e instanceof Error && e.message.startsWith('No versions found for skill')) {
logger.error(`skill ${id} has corrupt/missing version history; recreate required`);
return null;
}
throw e;
} Prevention
- Always create skills through the storage API so an initial version is written.
- Do not hand-edit or prune the storage version directories.
- Only update metadata fields on skills you suspect lack versions.
- Monitor/repair partial writes after crashes or disk issues.
When it happens
Trigger: Calling update with any config field set on a skill whose version directory on disk is empty or missing — e.g. the skill record was created manually without an initial version, files were deleted externally, or a partial write/crash left no versions.
Common situations: Hand-editing or cleaning the storage directory; interrupted writes leaving skill metadata without versions; importing skills metadata without version files.
Related errors
- No versions found for skill ${id}
- FilesystemSkillsStorage: skill with id ${id} not found
- [FilesystemStorage] resourceId must not be empty.
- ENOENT: no such file or directory: ${path}
- Skill with id ${skill.id} already exists
AI-assisted analysis of mastra-ai/mastra@75dd419e61 (2026-08-30).
Data as JSON: /api/errors/ee611acd965421c6.
Report an issue: GitHub.