{"record":{"id":"7b37f543d8b6be4a","repo":"eyaltoledano/claude-task-master","slug":"task-taskid-not-found-7b37f5","errorCode":null,"errorMessage":"Task ${taskId} not found","messagePattern":"Task (.+?) not found","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"scripts/modules/task-manager/update-single-task-status.js","lineNumber":96,"sourceCode":"\t\t\t\t\t\tchalk.yellow(\n\t\t\t\t\t\t\t`All subtasks of parent task ${parentId} are now marked as done.`\n\t\t\t\t\t\t)\n\t\t\t\t\t);\n\t\t\t\t\tconsole.log(\n\t\t\t\t\t\tchalk.yellow(\n\t\t\t\t\t\t\t`Consider updating the parent task status with: task-master set-status --id=${parentId} --status=done`\n\t\t\t\t\t\t)\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t} else {\n\t\t// Handle regular task\n\t\tconst taskId = parseInt(taskIdInput, 10);\n\t\tconst task = data.tasks.find((t) => t.id === taskId);\n\n\t\tif (!task) {\n\t\t\tthrow new Error(`Task ${taskId} not found`);\n\t\t}\n\n\t\t// Update the task status\n\t\tconst oldStatus = task.status || 'pending';\n\t\ttask.status = newStatus;\n\n\t\tlog(\n\t\t\t'info',\n\t\t\t`Updated task ${taskId} status from '${oldStatus}' to '${newStatus}'`\n\t\t);\n\n\t\t// If marking as done, also mark all subtasks as done\n\t\tif (\n\t\t\t(newStatus.toLowerCase() === 'done' ||\n\t\t\t\tnewStatus.toLowerCase() === 'completed') &&\n\t\t\ttask.subtasks &&\n\t\t\ttask.subtasks.length > 0\n\t\t) {","sourceCodeStart":78,"sourceCodeEnd":114,"githubUrl":"https://github.com/eyaltoledano/claude-task-master/blob/c0c98d367c55296bfe69e65680625b6db437af02/scripts/modules/task-manager/update-single-task-status.js#L78-L114","documentation":"For non-dotted ID inputs, updateSingleTaskStatus parses the input as an integer and searches the top-level tasks array. It throws when no task with that numeric ID exists in the loaded data.","triggerScenarios":"setTaskStatus called with a plain numeric ID ('7') that is not in data.tasks; passing a string that parses to a different number than intended; referencing a task in a tag where it does not exist.","commonSituations":"Hardcoded IDs from documentation or an older task list, tasks deleted after a cleanup, or switching tags where task numbering differs.","solutions":["Run 'task-master list' to see current task IDs","Confirm the correct --tag/context is being used","Re-run with the exact numeric ID from the list output"],"exampleFix":"// before\nawait setTaskStatus('42', 'done', tasksPath); // task 42 deleted\n// after\nconst id = Number('42');\nif (!data.tasks.some(t => t.id === id)) {\n  console.error(`Task ${id} not found; run task-master list`);\n  process.exit(1);\n}\nawait setTaskStatus('42', 'done', tasksPath);","handlingStrategy":"validation","validationCode":"const id = Number(taskIdInput);\nif (!Number.isInteger(id) || !data.tasks.some(t => t.id === id)) {\n  throw new Error(`Task ${taskIdInput} not found`);\n}","typeGuard":"function taskExists(tasks, id) {\n  return tasks.some(t => t.id === Number(id));\n}","tryCatchPattern":"try {\n  await setTaskStatus(taskId, 'done', tasksPath);\n} catch (err) {\n  if (err.message === `Task ${taskId} not found`) {\n    console.error('Run task-master list to get valid IDs');\n  } else throw err;\n}","preventionTips":["Fetch current IDs with task-master list instead of hardcoding","Check the active tag — IDs are tag-scoped","Never reuse stale IDs from old scripts or docs"],"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"}