eyaltoledano/claude-task-master · error
FILE_NOT_FOUND_ERROR
FILE_NOT_FOUND_ERROR
Error message
No complexity report found at ${reportPath}. Run 'analyze-complexity' first. What it means
After resolving the report path, the function loads the report data via the complexity analysis core. If no report object is found at the given path it returns FILE_NOT_FOUND_ERROR, telling the caller a complexity analysis has not been run (or the path is wrong). This is a guard against reading a nonexistent or empty report file.
Source
Thrown at mcp-server/src/core/direct-functions/complexity-report.js:57
const cacheKey = `complexityReport:${reportPath}`;
// Define the core action function to read the report
const coreActionFn = async () => {
try {
// Enable silent mode to prevent console logs from interfering with JSON response
enableSilentMode();
const report = readComplexityReport(reportPath);
// Restore normal logging
disableSilentMode();
if (!report) {
log.warn(`No complexity report found at ${reportPath}`);
return {
success: false,
error: {
code: 'FILE_NOT_FOUND_ERROR',
message: `No complexity report found at ${reportPath}. Run 'analyze-complexity' first.`
}
};
}
return {
success: true,
data: {
report,
reportPath
}
};
} catch (error) {
// Make sure to restore normal logging even if there's an error
disableSilentMode();
log.error(`Error reading complexity report: ${error.message}`);
return {View on GitHub (pinned to c0c98d367c)
Solutions
- Run 'task-master analyze-complexity' (or the analyze-complexity MCP tool) first to generate the report
- Verify the file exists at reportPath (ls .taskmaster/reports/) and that the filename matches exactly
- Ensure projectRoot and reportPath are consistent — resolve reportPath relative to the correct project root
- Regenerate the report if it was produced by an older schema/version and can no longer be parsed
Example fix
// before
await complexityReportDirect({ reportPath: '.taskmaster/reports/complex-report.json' });
// after
// 1) generate it first
await analyzeComplexityDirect({ projectRoot, model: 'sonnet' });
// 2) then read it
await complexityReportDirect({ reportPath: '.taskmaster/reports/complex-report.json', projectRoot }); Defensive patterns
Strategy: fallback
Validate before calling
const fs = require('fs'); if (!fs.existsSync(reportPath)) { /* run analyze-complexity first */ } Type guard
function reportExists(p) { try { return fs.statSync(p).isFile(); } catch { return false; } } Try / catch
const res = await complexityReportDirect({ reportPath }); if (!res.success && res.error.code === 'FILE_NOT_FOUND_ERROR') { await analyzeComplexity(); } Prevention
- Add analyze-complexity as a prerequisite step in CI
- Gitignore reports but regenerate them in setup scripts
- Keep reportPath in a shared config constant so it never drifts
When it happens
Trigger: reportPath points to a file that does not exist; the analyze-complexity tool was never run in this project; the report lives under a different projectRoot; the report file was deleted or moved after generation.
Common situations: Fresh clone of a repo where reports/ is gitignored; running complexity-report from the wrong working directory; renamed report path between tool versions; CI environments without prior analysis step.
Understand the failure class
Background: "File not found" and ENOENT errors: why libraries can't find a file that should exist — this error's family across 50 libraries.
Related errors
AI-assisted analysis of eyaltoledano/claude-task-master@c0c98d367c (2026-08-29).
Data as JSON: /api/errors/094b5bbe140dc4dd.
Report an issue: GitHub.