{"record":{"id":"efc4772acf1e7e27","repo":"eyaltoledano/claude-task-master","slug":"tag-oldtag-not-found-file-doesn-t-exist","errorCode":null,"errorMessage":"Tag ${oldTag} not found - file doesn't exist","messagePattern":"Tag (.+?) not found - file doesn't exist","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/tm-core/src/modules/storage/adapters/file-storage/file-storage.ts","lineNumber":790,"sourceCode":"\t\t\t\t\t}\n\t\t\t\t} else if (oldTag === 'master') {\n\t\t\t\t\t// Convert standard format to legacy when renaming master\n\t\t\t\t\tconst masterTasks = existingData.tasks || [];\n\t\t\t\t\tconst masterMetadata = existingData.metadata || {};\n\n\t\t\t\t\treturn {\n\t\t\t\t\t\t[newTag]: {\n\t\t\t\t\t\t\ttasks: masterTasks,\n\t\t\t\t\t\t\tmetadata: { ...masterMetadata, tags: [newTag] }\n\t\t\t\t\t\t}\n\t\t\t\t\t};\n\t\t\t\t} else {\n\t\t\t\t\tthrow new Error(`Tag ${oldTag} not found in standard format`);\n\t\t\t\t}\n\t\t\t});\n\t\t} catch (error: any) {\n\t\t\tif (error.code === 'ENOENT') {\n\t\t\t\tthrow new Error(`Tag ${oldTag} not found - file doesn't exist`);\n\t\t\t}\n\t\t\tthrow error;\n\t\t}\n\t}\n\n\t/**\n\t * Copy a tag within the single tasks.json file\n\t */\n\tasync copyTag(sourceTag: string, targetTag: string): Promise<void> {\n\t\tconst tasks = await this.loadTasks(sourceTag);\n\n\t\tif (tasks.length === 0) {\n\t\t\tthrow new Error(`Source tag ${sourceTag} not found or has no tasks`);\n\t\t}\n\n\t\tawait this.saveTasks(tasks, targetTag);\n\t}\n","sourceCodeStart":772,"sourceCodeEnd":808,"githubUrl":"https://github.com/eyaltoledano/claude-task-master/blob/c0c98d367c55296bfe69e65680625b6db437af02/packages/tm-core/src/modules/storage/adapters/file-storage/file-storage.ts#L772-L808","documentation":"FileStorage.renameTag throws this when the underlying tasks file for the tag being renamed does not exist on disk (an ENOENT from file read/write operations, re-thrown as a descriptive error). The library cannot rename a tag whose tasks file is missing.","triggerScenarios":"Calling renameTag(oldTag, newTag) when oldTag has no tasks.json data file (or the tasks file itself is absent), e.g. renaming a tag that was never created or was already renamed.","commonSituations":"Typo in the tag name passed to renameTag; renaming a tag deleted by another process; running renameTag before initializeProject created the tasks file; stale tag references after a manual file move.","solutions":["Verify the tag exists first with listTags or getTasks(oldTag) before renaming","Correct the tag name spelling in the renameTag call","Create the tag first (createTag or saveTasks with the tag) if it should exist","Run project initialization so the tasks file exists"],"exampleFix":"// before\nawait storage.renameTag('backlog', 'todo');\n// after\nconst tags = await storage.listTags();\nif (!tags.includes('backlog')) throw new Error(`Tag 'backlog' does not exist`);\nawait storage.renameTag('backlog', 'todo');","handlingStrategy":"validation","validationCode":"const tags = await storage.listTags();\nif (!tags.includes(oldTag)) {\n  throw new Error(`renameTag aborted: tag '${oldTag}' does not exist`);\n}\nawait storage.renameTag(oldTag, newTag);","typeGuard":null,"tryCatchPattern":"try {\n  await storage.renameTag(oldTag, newTag);\n} catch (e) {\n  if (e instanceof TaskMasterError || /not found - file doesn't exist/.test(e.message)) {\n    // tag/file missing: surface actionable message\n    throw new Error(`Tag '${oldTag}' does not exist; create it first`);\n  }\n  throw e;\n}","preventionTips":["Call listTags() before rename/copy operations to validate tag names","Centralize tag names as constants instead of string literals","Run project initialization before storage operations in scripts","Handle ENOENT-derived errors explicitly when scripting tag renames"],"tags":["file-system","tags","not-found"],"backgroundTag":"tag-not-found","analyzedSha":"c0c98d367c55296bfe69e65680625b6db437af02","analyzedAt":"2026-08-29T02:56:26.071Z","schemaVersion":2},"datasetVersion":"2026-08-29T07:17:48.351Z"}