eyaltoledano/claude-task-master · error
CORE_FUNCTION_ERROR
CORE_FUNCTION_ERROR
Error message
${error.message} What it means
Generic failure wrapper in expandAllTasksDirect: any exception thrown by the underlying core expandAllTasks function (file I/O errors, parse errors, dependency issues) is caught and re-wrapped as a structured CORE_FUNCTION_ERROR whose message is the original exception message. The actual root cause is whatever appears in message.
Source
Thrown at mcp-server/src/core/direct-functions/expand-all-tasks.js:110
details: {
expandedCount: result.expandedCount,
failedCount: result.failedCount,
skippedCount: result.skippedCount,
tasksToExpand: result.tasksToExpand
},
telemetryData: result.telemetryData // Pass the aggregated object
}
};
} catch (error) {
// Log the error using the MCP logger
log.error(`Error during core expandAllTasks execution: ${error.message}`);
// Optionally log stack trace if available and debug enabled
// if (error.stack && log.debug) { log.debug(error.stack); }
return {
success: false,
error: {
code: 'CORE_FUNCTION_ERROR', // Or a more specific code if possible
message: error.message
}
};
} finally {
disableSilentMode(); // IMPORTANT: Ensure silent mode is always disabled
}
}
View on GitHub (pinned to c0c98d367c)
Solutions
- Read error.message in the response — it contains the underlying cause; fix that directly.
- Validate tasks.json parses: run 'node -e "JSON.parse(require(\'fs\').readFileSync(path))"'.
- Run 'task-master validate-dependencies' (or equivalent) to repair dependency problems.
- Restore a clean tasks file from backup and retry; update the MCP server/core to matching versions.
Example fix
// before
// message: 'Unexpected token } in JSON at position 412' — corrupted tasks.json
// after
// fix the JSON (or regenerate: task-master parse-prd / restore backup), then retry
await expandAllTasksDirect({ tasksJsonPath, research: false }); Defensive patterns
Strategy: try-catch
Validate before calling
const fs = require('fs');
function tasksFileParses(p) {
try {
const data = JSON.parse(fs.readFileSync(p, 'utf8'));
return Array.isArray(data.tasks);
} catch { return false; }
} Type guard
function isCoreFunctionError(res) {
return res && res.success === false && res.error?.code === 'CORE_FUNCTION_ERROR';
} Try / catch
const res = await expandAllTasksDirect(args);
if (isCoreFunctionError(res)) {
console.error('expand-all failed:', res.error.message); // root cause
// retry after fixing the underlying issue reported in message
} Prevention
- Always read res.error.message — it carries the underlying exception text.
- Validate tasks.json parses and has a tasks array before expanding.
- Run dependency validation before mass expansion to avoid core failures.
- Keep the MCP server and task-master core versions in sync.
When it happens
Trigger: Any uncaught exception inside the core expand-all logic: corrupted or unreadable tasks.json (JSON parse error), permission denied on the file, missing dependency tasks, or a bug in the core function. Reaches the caller whenever the try block throws.
Common situations: tasks.json edited manually with a syntax error; file locked by another process; circular or dangling dependencies confusing the expansion; version mismatch between MCP server and task file schema.
Related errors
- INVALID_TASKS_FILE
- Failed to parse JSON response: ${parseError.message}. Respon
- CONFIG_ERROR
- Invalid JSON in file ${filePath}: ${error.message}
- Corrupted JSON in ${filePath}: ${err.message}. File contains
AI-assisted analysis of eyaltoledano/claude-task-master@c0c98d367c (2026-08-29).
Data as JSON: /api/errors/1a864c41ce646903.
Report an issue: GitHub.