{"record":{"id":"27395eef1f228b85","repo":"eyaltoledano/claude-task-master","slug":"source-tag-copyfromtag-not-found-or-has-no-ta","errorCode":null,"errorMessage":"Source tag \"${copyFromTag}\" not found or has no tasks","messagePattern":"Source tag \"(.+?)\" not found or has no tasks","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"scripts/modules/task-manager/tag-management.js","lineNumber":149,"sourceCode":"\t\t\t\tif (key !== '_rawTaggedData' && key !== 'tag') {\n\t\t\t\t\trawData[key] = value;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Check if tag already exists\n\t\tif (rawData[tagName]) {\n\t\t\tthrow new Error(`Tag \"${tagName}\" already exists`);\n\t\t}\n\n\t\t// Determine source for copying tasks (only if explicitly requested)\n\t\tlet sourceTasks = [];\n\t\tif (copyFromCurrent || copyFromTag) {\n\t\t\tconst sourceTag = copyFromTag || getCurrentTag(projectRoot);\n\t\t\tsourceTasks = getTasksForTag(rawData, sourceTag);\n\n\t\t\tif (copyFromTag && sourceTasks.length === 0) {\n\t\t\t\tlogFn.warn(`Source tag \"${copyFromTag}\" not found or has no tasks`);\n\t\t\t}\n\n\t\t\tlogFn.info(`Copying ${sourceTasks.length} tasks from tag \"${sourceTag}\"`);\n\t\t} else {\n\t\t\tlogFn.info('Creating empty tag (no tasks copied)');\n\t\t}\n\n\t\t// Create the new tag structure in raw data\n\t\trawData[tagName] = {\n\t\t\ttasks: [...sourceTasks], // Create a copy of the tasks array\n\t\t\tmetadata: {\n\t\t\t\tcreated: new Date().toISOString(),\n\t\t\t\tupdated: new Date().toISOString(),\n\t\t\t\tdescription:\n\t\t\t\t\tdescription || `Tag created on ${new Date().toLocaleDateString()}`\n\t\t\t}\n\t\t};\n","sourceCodeStart":131,"sourceCodeEnd":167,"githubUrl":"https://github.com/eyaltoledano/claude-task-master/blob/c0c98d367c55296bfe69e65680625b6db437af02/scripts/modules/task-manager/tag-management.js#L131-L167","documentation":"This warning is emitted by createTag when a copy source tag is explicitly specified via copyFromTag but resolving it with getTasksForTag yields zero tasks. It means the named tag does not exist in tasks.json or exists but holds no tasks, so the new tag will be created empty. It is a warning, not a throw; tag creation proceeds.","triggerScenarios":"Calling createTag (or the 'task-master add-tag <name> --from-tag <tag>' CLI path) with a copyFromTag value that was never created, was deleted, is misspelled, or whose task list is empty.","commonSituations":"Typo in the source tag name (tags are case-sensitive strings in tasks.json); referencing a tag from another project/branch whose tasks.json lacks it; copying from a freshly created empty tag; stale docs or scripts referencing renamed tags.","solutions":["List existing tags with 'task-master tags' and confirm the exact source tag name exists and has tasks.","Fix the copyFromTag argument spelling/casing before calling createTag.","If an empty source is intentional, omit copyFromTag (or accept the warning) — the tag is still created with zero tasks.","Verify you are operating on the correct project root so rawData actually contains the tag.","Use copyFromCurrent: true instead if you meant to copy the currently active tag's tasks."],"exampleFix":"// before\nawait createTag(rawData, 'new-tag', projectRoot, { copyFromTag: 'backlog ' });\n// after\nawait createTag(rawData, 'new-tag', projectRoot, { copyFromTag: 'backlog' });","handlingStrategy":"validation","validationCode":"const tags = getTagNames(rawData); // or read tasks.json and inspect .tags\nconst src = 'backlog';\nconst sourceTasks = getTasksForTag(rawData, src);\nif (!tags.includes(src) || sourceTasks.length === 0) {\n  throw new Error(`Source tag \"${src}\" not found or has no tasks`);\n}","typeGuard":"function isValidSourceTag(rawData, tag) {\n  return Boolean(rawData?.tags?.[tag]) &&\n    Array.isArray(rawData.tags[tag].tasks) &&\n    rawData.tags[tag].tasks.length > 0;\n}","tryCatchPattern":null,"preventionTips":["Run 'task-master tags' to verify tag names before copying.","Treat tag names as case-sensitive exact strings; keep them in one config.","Skip copyFromTag when the source may legitimately be empty.","Add a preflight check that the source tag has >= 1 task before createTag."],"tags":["tagging","validation","task-management"],"backgroundTag":"source-tag-not-found","analyzedSha":"c0c98d367c55296bfe69e65680625b6db437af02","analyzedAt":"2026-08-29T02:56:26.071Z","schemaVersion":2},"datasetVersion":"2026-08-29T07:17:48.351Z"}