eyaltoledano/claude-task-master · error

UPDATE_SUBTASK_CORE_ERROR

UPDATE_SUBTASK_CORE_ERROR

Error message

error.message || 'Unknown error updating subtask'

What it means

Catch-all in updateSubtaskByIdDirect's inner try: any exception thrown while performing the update (file I/O, JSON parse, core updateSubtask failure) is converted into an UPDATE_SUBTASK_CORE_ERROR result with error.message. The finally block restores logging state if silent mode was enabled. It indicates the update attempt itself failed, distinct from validation or not-found outcomes.

Source

Thrown at mcp-server/src/core/direct-functions/update-subtask-by-id.js:140

			return {
				success: true,
				data: {
					message: `Successfully updated subtask with ID ${subtaskIdStr}`,
					subtaskId: subtaskIdStr,
					parentId: parentId,
					subtask: coreResult.updatedSubtask,
					tasksPath,
					useResearch,
					telemetryData: coreResult.telemetryData,
					tagInfo: coreResult.tagInfo
				}
			};
		} catch (error) {
			logWrapper.error(`Error updating subtask by ID: ${error.message}`);
			return {
				success: false,
				error: {
					code: 'UPDATE_SUBTASK_CORE_ERROR',
					message: error.message || 'Unknown error updating subtask'
				}
			};
		} finally {
			if (!wasSilent && isSilentMode()) {
				disableSilentMode();
			}
		}
	} catch (error) {
		logWrapper.error(
			`Setup error in updateSubtaskByIdDirect: ${error.message}`
		);
		if (isSilentMode()) disableSilentMode();
		return {
			success: false,
			error: {
				code: 'DIRECT_FUNCTION_SETUP_ERROR',
				message: error.message || 'Unknown setup error'

View on GitHub (pinned to c0c98d367c)

Solutions

  1. Read error.message in the result to get the underlying cause.
  2. Validate tasks.json parses (e.g. `node -e "JSON.parse(require('fs').readFileSync(path))"`).
  3. Check file permissions on the tasks file and its directory.
  4. Ensure no other process is concurrently rewriting tasks.json during the update.

Example fix

// before
// tasks.json has a trailing comma -> parse throws
{ "tasks": [ ... ], }
// after
{ "tasks": [ ... ] }
Defensive patterns

Strategy: try-catch

Validate before calling

try { JSON.parse(fs.readFileSync(tasksJsonPath, 'utf8')); } catch (e) { throw new Error(`tasks.json malformed: ${e.message}`); }
fs.accessSync(tasksJsonPath, fs.constants.W_OK); // throws if not writable

Type guard

function isResultOk(r) { return r !== null && typeof r === 'object' && r.success === true; }

Try / catch

const res = await updateSubtaskByIdDirect(args);
if (!res.success && res.error.code === 'UPDATE_SUBTASK_CORE_ERROR') {
  console.error('Update failed:', res.error.message);
  // check file parse, permissions, concurrent writers
}

Prevention

When it happens

Trigger: tasks.json unreadable or malformed, permission denied writing the file, the core updateSubtask call throwing on storage errors, or concurrent modification corrupting the read-modify-write cycle.

Common situations: File locked by another process/IDE sync, running the MCP server as a user without write access to .taskmaster/, hand-edited tasks.json with a syntax error.

Related errors


AI-assisted analysis of eyaltoledano/claude-task-master@c0c98d367c (2026-08-29). Data as JSON: /api/errors/894c7025b126dbcb. Report an issue: GitHub.