{"record":{"id":"7fffd23885c412ed","repo":"eyaltoledano/claude-task-master","slug":"analyze-report-missing","errorCode":"ANALYZE_REPORT_MISSING","errorMessage":"Analysis completed but no report file was created at the expected path.","messagePattern":"Analysis completed but no report file was created at the expected path\\.","errorType":"error_code","errorClass":null,"httpStatus":null,"severity":"error","filePath":"mcp-server/src/core/direct-functions/analyze-task-complexity.js","lineNumber":151,"sourceCode":"\t\t\t\terror: {\n\t\t\t\t\tcode: 'ANALYZE_CORE_ERROR',\n\t\t\t\t\tmessage: `Error running core complexity analysis: ${error.message}`\n\t\t\t\t}\n\t\t\t};\n\t\t} finally {\n\t\t\t// Always restore normal logging in finally block if we enabled silent mode\n\t\t\tif (!wasSilent && isSilentMode()) {\n\t\t\t\tdisableSilentMode();\n\t\t\t}\n\t\t}\n\n\t\t// --- Result Handling (remains largely the same) ---\n\t\t// Verify the report file was created (core function writes it)\n\t\tif (!fs.existsSync(resolvedOutputPath)) {\n\t\t\treturn {\n\t\t\t\tsuccess: false,\n\t\t\t\terror: {\n\t\t\t\t\tcode: 'ANALYZE_REPORT_MISSING', // Specific code\n\t\t\t\t\tmessage:\n\t\t\t\t\t\t'Analysis completed but no report file was created at the expected path.'\n\t\t\t\t}\n\t\t\t};\n\t\t}\n\n\t\tif (\n\t\t\t!coreResult ||\n\t\t\t!coreResult.report ||\n\t\t\ttypeof coreResult.report !== 'object'\n\t\t) {\n\t\t\tlog.error(\n\t\t\t\t'Core analysis function returned an invalid or undefined response.'\n\t\t\t);\n\t\t\treturn {\n\t\t\t\tsuccess: false,\n\t\t\t\terror: {\n\t\t\t\t\tcode: 'INVALID_CORE_RESPONSE',","sourceCodeStart":133,"sourceCodeEnd":169,"githubUrl":"https://github.com/eyaltoledano/claude-task-master/blob/c0c98d367c55296bfe69e65680625b6db437af02/mcp-server/src/core/direct-functions/analyze-task-complexity.js#L133-L169","documentation":"After the core analysis reports success, this function verifies the report file actually exists at resolvedOutputPath on disk. If the file was not written (silent write failure, wrong path, permission issue), it returns ANALYZE_REPORT_MISSING instead of returning a report.","triggerScenarios":"Core analysis completes without error but the report file is absent at outputPath — e.g. unwritable directory, outputPath pointing to a different location than where the core wrote, or core writing zero results without failing.","commonSituations":"Output directory deleted or not writable; relative vs absolute path mismatch between outputPath given to the tool and the core's working directory; read-only filesystem in containers.","solutions":["Confirm the outputPath directory exists and is writable (mkdir -p, chmod)","Use an absolute outputPath so it matches the core's write location","Re-run the analysis and check logs for core warnings about writing the report"],"exampleFix":"// before\nanalyze_project_complexity({ tasksJsonPath: p, outputPath: 'report.json' });\n// after\nconst out = path.resolve(p, '..', 'task-complexity-report.json');\nfs.mkdirSync(path.dirname(out), { recursive: true });\nanalyze_project_complexity({ tasksJsonPath: p, outputPath: out });","handlingStrategy":"validation","validationCode":"import fs from 'fs';\nimport path from 'path';\nconst out = path.resolve(args.outputPath);\nfs.mkdirSync(path.dirname(out), { recursive: true });\nfs.accessSync(path.dirname(out), fs.constants.W_OK);\nconst res = await analyzeTaskComplexityDirect({ ...args, outputPath: out });\nif (res.success && !fs.existsSync(out)) { /* treat as ANALYZE_REPORT_MISSING */ }","typeGuard":"function reportWritten(outputPath) {\n  try { return fs.statSync(outputPath).size > 0; } catch { return false; }\n}","tryCatchPattern":"const res = await analyzeTaskComplexityDirect(args);\nif (!res.success && res.error?.code === 'ANALYZE_REPORT_MISSING') {\n  // ensure output dir exists/writable, re-run once\n}","preventionTips":["Pre-create the output directory and check writability","Always pass absolute output paths","After any run, confirm the report file exists before reading it"],"tags":["mcp","filesystem","analysis"],"backgroundTag":"output-file-missing","analyzedSha":"c0c98d367c55296bfe69e65680625b6db437af02","analyzedAt":"2026-08-29T02:56:26.071Z","schemaVersion":2},"datasetVersion":"2026-08-29T07:17:48.351Z"}