{"record":{"id":"984fdba88af49bfa","repo":"eyaltoledano/claude-task-master","slug":"source-tag-sourcetag-not-found","errorCode":null,"errorMessage":"Source tag ${sourceTag} not found","messagePattern":"Source tag (.+?) not found","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/tm-core/src/modules/storage/adapters/api-storage.ts","lineNumber":812,"sourceCode":"\t\t\tthrow new TaskMasterError(\n\t\t\t\t'Failed to rename tag via API',\n\t\t\t\tERROR_CODES.STORAGE_ERROR,\n\t\t\t\t{ operation: 'renameTag', oldTag, newTag },\n\t\t\t\terror as Error\n\t\t\t);\n\t\t}\n\t}\n\n\t/**\n\t * Copy a tag\n\t */\n\tasync copyTag(sourceTag: string, targetTag: string): Promise<void> {\n\t\tawait this.ensureInitialized();\n\n\t\ttry {\n\t\t\tconst sourceData = this.tagsCache.get(sourceTag);\n\t\t\tif (!sourceData) {\n\t\t\t\tthrow new Error(`Source tag ${sourceTag} not found`);\n\t\t\t}\n\n\t\t\t// Create new tag with copied data\n\t\t\tconst targetData = { ...sourceData, name: targetTag };\n\t\t\tawait this.repository.createTag(this.projectId, targetData);\n\n\t\t\t// Update cache\n\t\t\tthis.tagsCache.set(targetTag, targetData);\n\t\t} catch (error) {\n\t\t\tthrow new TaskMasterError(\n\t\t\t\t'Failed to copy tag via API',\n\t\t\t\tERROR_CODES.STORAGE_ERROR,\n\t\t\t\t{ operation: 'copyTag', sourceTag, targetTag },\n\t\t\t\terror as Error\n\t\t\t);\n\t\t}\n\t}\n","sourceCodeStart":794,"sourceCodeEnd":830,"githubUrl":"https://github.com/eyaltoledano/claude-task-master/blob/c0c98d367c55296bfe69e65680625b6db437af02/packages/tm-core/src/modules/storage/adapters/api-storage.ts#L794-L830","documentation":"A plain Error (later wrapped by 'Failed to copy tag via API') thrown by ApiStorage.copyTag when sourceTag is not present in the local tagsCache. The copy uses cached source data as the template, so a missing source tag aborts before any API call.","triggerScenarios":"Calling storage.copyTag(sourceTag, targetTag) where sourceTag was never created in this session, the tagsCache was not loaded/refreshed, or the source tag exists only in another project/brief context.","commonSituations":"Copy-pasting a script between projects with different tag sets, typos in the source tag name, cache stale relative to remote (tag created elsewhere), or wrong projectId bound to the storage instance.","solutions":["Confirm the source tag exists via getTags and use the exact name.","Refresh the tags cache (re-initialize storage or the cache-loading path) before copying.","Correct the projectId/brief context so storage points at the project containing the source tag.","Fix any tag-name casing or typo mismatch."],"exampleFix":"// before\nawait storage.copyTag('in-progess', 'in-progress-copy'); // source typo\n// after\nconst tags = await storage.getTags();\nconst src = tags.find(t => t.name === 'in-progess');\nif (!src) throw new Error('Source tag missing; available: ' + tags.map(t => t.name).join(', '));\nawait storage.copyTag(src.name, 'in-progress-copy');","handlingStrategy":"validation","validationCode":"const tags = await storage.getTags();\nif (!tags.some(t => t.name === sourceTag)) {\n  throw new Error(`Cannot copy: source tag '${sourceTag}' does not exist`);\n}","typeGuard":null,"tryCatchPattern":"try {\n  await storage.copyTag(sourceTag, targetTag);\n} catch (e) {\n  if (String(e.cause ?? e.message).includes('not found')) {\n    console.warn(`Source tag '${sourceTag}' missing; refresh cache and verify name.`);\n    return;\n  }\n  throw e;\n}","preventionTips":["List tags and pick the source by exact match before copying.","Refresh the tags cache when the process runs longer than a typical session.","Confirm the projectId/brief context matches the project that owns the source tag."],"tags":["tag","not-found","cache","copy"],"backgroundTag":"resource-not-found","analyzedSha":"c0c98d367c55296bfe69e65680625b6db437af02","analyzedAt":"2026-08-29T02:56:26.071Z","schemaVersion":2},"datasetVersion":"2026-08-29T07:17:48.351Z"}