{"record":{"id":"0a4a116a8fa27181","repo":"eyaltoledano/claude-task-master","slug":"update-tasks-core-error","errorCode":"UPDATE_TASKS_CORE_ERROR","errorMessage":"error.message || 'Unknown error updating tasks'","messagePattern":"error\\.message \\|\\| 'Unknown error updating tasks'","errorType":"error_code","errorClass":null,"httpStatus":null,"severity":"error","filePath":"mcp-server/src/core/direct-functions/update-tasks.js","lineNumber":124,"sourceCode":"\t\t\tlogWrapper.error(\n\t\t\t\t'Core updateTasks function did not return a successful structure.'\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: 'CORE_FUNCTION_ERROR',\n\t\t\t\t\tmessage:\n\t\t\t\t\t\tresult?.message ||\n\t\t\t\t\t\t'Core function failed to update tasks or returned unexpected result.'\n\t\t\t\t}\n\t\t\t};\n\t\t}\n\t} catch (error) {\n\t\tlogWrapper.error(`Error executing core updateTasks: ${error.message}`);\n\t\treturn {\n\t\t\tsuccess: false,\n\t\t\terror: {\n\t\t\t\tcode: 'UPDATE_TASKS_CORE_ERROR',\n\t\t\t\tmessage: error.message || 'Unknown error updating tasks'\n\t\t\t}\n\t\t};\n\t} finally {\n\t\tdisableSilentMode(); // Ensure silent mode is disabled\n\t}\n}\n","sourceCodeStart":106,"sourceCodeEnd":132,"githubUrl":"https://github.com/eyaltoledano/claude-task-master/blob/c0c98d367c55296bfe69e65680625b6db437af02/mcp-server/src/core/direct-functions/update-tasks.js#L106-L132","documentation":"Catch-all for exceptions thrown during the core updateTasks call (after silent mode is enabled). Any thrown error — JSON parse failure, filesystem error, unhandled provider exception — becomes an UPDATE_TASKS_CORE_ERROR result with the error's message, and silent mode is disabled in finally.","triggerScenarios":"Core updateTasks throws instead of returning gracefully: unreadable/corrupt tasks.json, permission errors writing the file, an AI SDK throwing on network/auth failure, or a bug inside task-manager.","commonSituations":"tasks.json contains invalid JSON; tasks.json is read-only or locked by another process; missing API key causing the provider SDK to throw; network timeouts during long AI operations.","solutions":["Read the wrapped error.message to identify the root cause","Validate tasks.json is parseable JSON and writable by the process","Check AI provider credentials (API key env vars) and connectivity","Re-run after fixing; the finally block guarantees silent mode is reset so logging works on the next call"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"import { accessSync, constants, readFileSync } from 'fs';\nfunction tasksFileHealthy(p) {\n  try { accessSync(p, constants.W_OK); JSON.parse(readFileSync(p, 'utf8')); return true; } catch { return false; }\n}","typeGuard":null,"tryCatchPattern":"const result = await updateTasksDirect(args, log);\nif (!result.success && result.error.code === 'UPDATE_TASKS_CORE_ERROR') {\n  console.error(`updateTasks threw: ${result.error.message}`);\n  // check tasks.json validity/permissions and AI provider creds, then retry\n}","preventionTips":["Validate tasks.json parses and is writable before bulk updates","Ensure AI provider API keys are present in the MCP server env","Handle transient provider failures with bounded retries/backoff","The finally block resets silent mode — rely on normal logging after failures to diagnose"],"tags":["core-function","error-wrapping","mcp"],"backgroundTag":"core-function-failed","analyzedSha":"c0c98d367c55296bfe69e65680625b6db437af02","analyzedAt":"2026-08-29T02:56:26.071Z","schemaVersion":2},"datasetVersion":"2026-08-29T07:17:48.351Z"}