{"record":{"id":"535e75aa32cfd56c","repo":"eyaltoledano/claude-task-master","slug":"file-not-found-535e75","errorCode":"FILE_NOT_FOUND","errorMessage":"${error.message}","messagePattern":"\\$\\{error\\.message\\}","errorType":"error_code","errorClass":null,"httpStatus":null,"severity":"error","filePath":"mcp-server/src/core/direct-functions/parse-prd.js","lineNumber":72,"sourceCode":"\t\treturn {\n\t\t\tsuccess: false,\n\t\t\terror: {\n\t\t\t\tcode: 'MISSING_ARGUMENT',\n\t\t\t\tmessage: 'projectRoot is required.'\n\t\t\t}\n\t\t};\n\t}\n\n\t// Resolve input path using path utilities\n\tlet inputPath;\n\tif (inputArg) {\n\t\ttry {\n\t\t\tinputPath = resolvePrdPath({ input: inputArg, projectRoot }, session);\n\t\t} catch (error) {\n\t\t\tlogWrapper.error(`Error resolving PRD path: ${error.message}`);\n\t\t\treturn {\n\t\t\t\tsuccess: false,\n\t\t\t\terror: { code: 'FILE_NOT_FOUND', message: error.message }\n\t\t\t};\n\t\t}\n\t} else {\n\t\tlogWrapper.error('parsePRDDirect called without input path');\n\t\treturn {\n\t\t\tsuccess: false,\n\t\t\terror: { code: 'MISSING_ARGUMENT', message: 'Input path is required' }\n\t\t};\n\t}\n\n\t// Resolve output path - use new path utilities for default\n\tconst outputPath = outputArg\n\t\t? path.isAbsolute(outputArg)\n\t\t\t? outputArg\n\t\t\t: path.resolve(projectRoot, outputArg)\n\t\t: resolveProjectPath(TASKMASTER_TASKS_FILE, args) ||\n\t\t\tpath.resolve(projectRoot, TASKMASTER_TASKS_FILE);\n","sourceCodeStart":54,"sourceCodeEnd":90,"githubUrl":"https://github.com/eyaltoledano/claude-task-master/blob/c0c98d367c55296bfe69e65680625b6db437af02/mcp-server/src/core/direct-functions/parse-prd.js#L54-L90","documentation":"When an `input` argument is provided, parsePRDDirect resolves it via resolvePrdPath (parse-prd.js:66-74). If that resolver throws — typically because the given relative path cannot be resolved to an existing PRD under the project's expected locations — the exception is reported as FILE_NOT_FOUND with the resolver's message.","triggerScenarios":"Passing an `input` path that resolvePrdPath cannot find: a relative path that doesn't exist relative to projectRoot or the .taskmaster/docs locations, or a nonexistent absolute path that the resolver validates before returning.","commonSituations":"Typos in the PRD filename; passing a path relative to the shell's cwd instead of projectRoot; moving/renaming the PRD after generation; running the tool from a different directory than expected so relative resolution lands elsewhere.","solutions":["Read `error.message` — it contains the path resolution failure detail from resolvePrdPath.","Pass an absolute path to the PRD file to bypass relative-path ambiguity.","Verify the file exists relative to `projectRoot`, not your current working directory.","Check the conventional locations (e.g. .taskmaster/docs/ or scripts/prd.txt) if relying on name-only resolution."],"exampleFix":"// before\nawait parsePRDDirect({ projectRoot: '/proj', input: 'prd.txt' }, log); // resolved relative to /proj, file not there\n\n// after\nawait parsePRDDirect({ projectRoot: '/proj', input: '/proj/docs/prd.txt' }, log);","handlingStrategy":"validation","validationCode":"const path = require('path');\nconst fs = require('fs');\nfunction prdInputResolvable(input, projectRoot) {\n  const abs = path.isAbsolute(input) ? input : path.resolve(projectRoot, input);\n  return fs.existsSync(abs);\n}","typeGuard":"function isResolvableInput(args) {\n  return typeof args?.input === 'string' && args.input.trim().length > 0;\n}","tryCatchPattern":"const result = await parsePRDDirect({ projectRoot, input }, log);\nif (!result.success && result.error?.code === 'FILE_NOT_FOUND') {\n  console.error('PRD path could not be resolved:', result.error.message);\n}","preventionTips":["Prefer absolute paths for the input argument.","Resolve relative paths against projectRoot, not the shell cwd.","Keep the PRD in a stable location like .taskmaster/docs/.","Check the resolver's message for the path it attempted."],"tags":["mcp","file-not-found","path-resolution","prd"],"backgroundTag":"file-not-found","analyzedSha":"c0c98d367c55296bfe69e65680625b6db437af02","analyzedAt":"2026-08-29T02:56:26.071Z","schemaVersion":2},"datasetVersion":"2026-08-29T07:17:48.351Z"}