{"record":{"id":"f3e528e1955ee6c9","repo":"eyaltoledano/claude-task-master","slug":"parent-task-with-id-parentid-not-found-please","errorCode":null,"errorMessage":"Parent task with ID ${parentId} not found. Please verify the task ID and try again.","messagePattern":"Parent task with ID (.+?) not found\\. Please verify the task ID and try again\\.","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"scripts/modules/task-manager/update-subtask-by-id.js","lineNumber":157,"sourceCode":"\n\t\tconst [parentIdStr, subtaskIdStr] = subtaskId.split('.');\n\t\tconst parentId = parseInt(parentIdStr, 10);\n\t\tconst subtaskIdNum = parseInt(subtaskIdStr, 10);\n\n\t\tif (\n\t\t\tNumber.isNaN(parentId) ||\n\t\t\tparentId <= 0 ||\n\t\t\tNumber.isNaN(subtaskIdNum) ||\n\t\t\tsubtaskIdNum <= 0\n\t\t) {\n\t\t\tthrow new Error(\n\t\t\t\t`Invalid subtask ID format: ${subtaskId}. Both parent ID and subtask ID must be positive integers.`\n\t\t\t);\n\t\t}\n\n\t\tconst parentTask = data.tasks.find((task) => task.id === parentId);\n\t\tif (!parentTask) {\n\t\t\tthrow new Error(\n\t\t\t\t`Parent task with ID ${parentId} not found. Please verify the task ID and try again.`\n\t\t\t);\n\t\t}\n\n\t\tif (!parentTask.subtasks || !Array.isArray(parentTask.subtasks)) {\n\t\t\tthrow new Error(`Parent task ${parentId} has no subtasks.`);\n\t\t}\n\n\t\tconst subtaskIndex = parentTask.subtasks.findIndex(\n\t\t\t(st) => st.id === subtaskIdNum\n\t\t);\n\t\tif (subtaskIndex === -1) {\n\t\t\tthrow new Error(\n\t\t\t\t`Subtask with ID ${subtaskId} not found. Please verify the subtask ID and try again.`\n\t\t\t);\n\t\t}\n\n\t\tconst subtask = parentTask.subtasks[subtaskIndex];","sourceCodeStart":139,"sourceCodeEnd":175,"githubUrl":"https://github.com/eyaltoledano/claude-task-master/blob/c0c98d367c55296bfe69e65680625b6db437af02/scripts/modules/task-manager/update-subtask-by-id.js#L139-L175","documentation":"The parent ID parsed from the dotted subtask ID is looked up in data.tasks; if no task with that ID exists the function throws with a user-facing hint. Unlike 410/411 this happens after file and format validation, so the data loaded fine but the parent ID is wrong.","triggerScenarios":"Calling updateSubtaskById('99.1', ...) when task 99 does not exist; using a parent ID from a different tag; typos in the parent portion of the ID.","commonSituations":"Stale IDs after renumbering or pruning tasks, copying subtask IDs between projects, per-tag task lists where the parent only exists in another tag.","solutions":["Run 'task-master list' and confirm the parent task ID","Check the active tag matches the one containing the parent task","Correct the parent portion of the dotted ID"],"exampleFix":"// before\nawait updateSubtaskById('99.1', prompt, options); // no task 99\n// after\nif (!data.tasks.some(t => t.id === 99)) throw new Error('Parent 99 missing; run task-master list');\nawait updateSubtaskById('5.1', prompt, options);","handlingStrategy":"validation","validationCode":"const parentId = Number(String(subtaskId).split('.')[0]);\nif (!data.tasks.some(t => t.id === parentId)) {\n  throw new Error(`Parent task ${parentId} not found`);\n}","typeGuard":"function parentExists(tasks, subtaskId) {\n  const pid = Number(String(subtaskId).split('.')[0]);\n  return tasks.some(t => t.id === pid);\n}","tryCatchPattern":"try {\n  await updateSubtaskById(subtaskId, prompt, options);\n} catch (err) {\n  if (err.message.startsWith('Parent task with ID') && err.message.includes('not found')) {\n    console.error('Verify the parent ID and tag with task-master list');\n  } else throw err;\n}","preventionTips":["Confirm parent IDs with task-master list before updates","Check the active tag — parent IDs are tag-scoped","Refresh IDs after pruning or renumbering tasks"],"tags":["lookup-failure","task-management"],"backgroundTag":"task-not-found","analyzedSha":"c0c98d367c55296bfe69e65680625b6db437af02","analyzedAt":"2026-08-29T02:56:26.071Z","schemaVersion":2},"datasetVersion":"2026-08-29T07:17:48.351Z"}