{"record":{"id":"58fe2b32ee507c17","repo":"mastra-ai/mastra","slug":"filesystemskillsstorage-skill-with-id-id-not-f","errorCode":null,"errorMessage":"FilesystemSkillsStorage: skill with id ${id} not found","messagePattern":"FilesystemSkillsStorage: skill with id (.+?) not found","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"packages/core/src/storage/domains/skills/filesystem.ts","lineNumber":76,"sourceCode":"    const versionId = crypto.randomUUID();\n    await this.createVersion({\n      id: versionId,\n      skillId: skill.id,\n      versionNumber: 1,\n      ...snapshotConfig,\n      changedFields: Object.keys(snapshotConfig),\n      changeMessage: 'Initial version',\n    });\n\n    return structuredClone(entity);\n  }\n\n  async update(input: StorageUpdateSkillInput): Promise<StorageSkillType> {\n    const { id, ...updates } = input;\n\n    const existing = await this.helpers.getById(id);\n    if (!existing) {\n      throw new Error(`FilesystemSkillsStorage: skill with id ${id} not found`);\n    }\n\n    const { authorId, visibility, activeVersionId, status, ...rawConfigFields } = updates;\n\n    // Filter out undefined keys: callers may spread partial snapshots into\n    // update() and rely on \"omit = no change\" semantics. Without this, an\n    // undefined value would clobber the latest version's populated field\n    // when spread into newConfig below.\n    const configFields: Record<string, unknown> = {};\n    for (const [key, value] of Object.entries(rawConfigFields)) {\n      if (value !== undefined) configFields[key] = value;\n    }\n\n    // Config field names from StorageSkillSnapshotType\n    const configFieldNames = [\n      'name',\n      'description',\n      'instructions',","sourceCodeStart":58,"sourceCodeEnd":94,"githubUrl":"https://github.com/mastra-ai/mastra/blob/75dd419e613fe9c39f846ffc500716141b74fda6/packages/core/src/storage/domains/skills/filesystem.ts#L58-L94","documentation":"FilesystemSkillsStorage.update first loads the skill by id and throws when no skill file matching that id exists on disk. Update is not upsert: you can only update skills that were previously created in the filesystem storage directory.","triggerScenarios":"Calling update({ id, ... }) for an id that was never created, was deleted, or whose backing file is missing/renamed on disk; a typo'd or stale id from another environment.","commonSituations":"Pointing storage at a different base directory than where skills were created (env misconfiguration); id mismatch after a rename or re-seed; calling update before create in a setup script.","solutions":["Create the skill first (or use an upsert pattern: check getById, then create if missing).","Verify the id is correct and exists via getById/getList before updating.","Confirm the filesystem storage is configured with the correct base directory / env vars so the skill file is visible.","Restore the missing skill file or re-seed skills in the target directory."],"exampleFix":"// before\nawait storage.update({ id: 'my-skill', status: 'active' }); // throws if missing\n// after\nconst existing = await storage.getById('my-skill');\nif (!existing) {\n  await storage.create({ skill: { id: 'my-skill', ...defaults } });\n}\nawait storage.update({ id: 'my-skill', status: 'active' });","handlingStrategy":"validation","validationCode":"const existing = await storage.getById(id);\nif (!existing) throw new Error(`skill ${id} does not exist; create it first`);","typeGuard":"async function skillExists(storage: FilesystemSkillsStorage, id: string): Promise<boolean> {\n  return (await storage.getById(id)) != null;\n}","tryCatchPattern":"try {\n  return await storage.update(input);\n} catch (e) {\n  if (e instanceof Error && e.message.includes('not found')) {\n    return storage.create({ skill: { ...input, ...defaults } as StorageCreateSkillInput });\n  }\n  throw e;\n}","preventionTips":["Implement updates as upsert (check getById first).","Verify storage base-directory configuration so the skill files resolve.","Keep ids in sync across environments; don't hardcode ids from other datasets.","Re-seed or restore skill files after external directory modifications."],"tags":["storage","filesystem","not-found","skills"],"backgroundTag":"resource-not-found","analyzedSha":"75dd419e613fe9c39f846ffc500716141b74fda6","analyzedAt":"2026-08-30T00:15:31.844Z","schemaVersion":2},"datasetVersion":"2026-08-30T03:17:51.788Z"}