eyaltoledano/claude-task-master · error

SET_STATUS_ERROR

SET_STATUS_ERROR

Error message

error.message || 'Unknown error setting task status'

What it means

Generic catch-all inside setTaskStatusDirect: any exception thrown by the inner status-update logic (path resolution, file read/write, core updateTaskStatus call) is caught and converted into a SET_STATUS_ERROR result carrying error.message. The finally block restores normal logging after silent mode. It tells you the status update failed for a reason other than input validation.

Source

Thrown at mcp-server/src/core/direct-functions/set-task-status.js:139

							nextSteps: nextResult.data.nextSteps
						};
					} else {
						log.warn(
							`Failed to retrieve next task: ${nextResult.error?.message || 'Unknown error'}`
						);
					}
				} catch (nextErr) {
					log.error(`Error retrieving next task: ${nextErr.message}`);
				}
			}

			return result;
		} catch (error) {
			log.error(`Error setting task status: ${error.message}`);
			return {
				success: false,
				error: {
					code: 'SET_STATUS_ERROR',
					message: error.message || 'Unknown error setting task status'
				}
			};
		} finally {
			// ALWAYS restore normal logging in finally block
			disableSilentMode();
		}
	} catch (error) {
		// Ensure silent mode is disabled if there was an uncaught error in the outer try block
		if (isSilentMode()) {
			disableSilentMode();
		}

		log.error(`Error setting task status: ${error.message}`);
		return {
			success: false,
			error: {
				code: 'SET_STATUS_ERROR',

View on GitHub (pinned to c0c98d367c)

Solutions

  1. Read error.message in the result — it carries the underlying cause; fix that root cause first.
  2. Confirm the tasksJsonPath/tool argument points at an existing, valid tasks.json.
  3. Use a valid status constant from the library (pending, done, in-progress, review, deferred, cancelled).
  4. Enable verbose logging or retry after disabling silent mode to get the full stack.

Example fix

// before
const tasksPath = './data/tasks.json'; // file does not exist
// after
const tasksPath = path.resolve(process.cwd(), '.taskmaster/tasks/tasks.json');
Defensive patterns

Strategy: try-catch

Validate before calling

if (!fs.existsSync(tasksPath)) throw new Error(`tasks.json not found at ${tasksPath}`);
JSON.parse(fs.readFileSync(tasksPath, 'utf8')); // throws on malformed JSON

Type guard

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

Try / catch

const res = await setTaskStatusDirect(args);
if (!res.success) {
  if (res.error.code === 'SET_STATUS_ERROR') {
    console.error('Status update failed:', res.error.message);
    // inspect path, file validity, status value
  }
}

Prevention

When it happens

Trigger: The core updateTaskStatus call throws: tasks.json path is wrong or the file is missing, JSON is malformed, the task ID does not resolve, or the status value is not in the allowed set and the core layer rejects it.

Common situations: Running the MCP server from a different working directory so the relative tasks path no longer resolves; a hand-edited tasks.json with invalid JSON; typo'd status values like 'completed' instead of 'done'.

Related errors


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