eyaltoledano/claude-task-master · error
REMOVE_TASK_ERROR
REMOVE_TASK_ERROR
Error message
result.error || 'Failed to remove tasks'
What it means
After passing pre-validation, removeTaskDirect delegates the actual removal to the core remove-task logic. If that core call reports success=false, the direct function forwards the core's error message under REMOVE_TASK_ERROR. This surfaces failures that happen during the removal itself (dependency checks, file writes, etc.).
Source
Thrown at mcp-server/src/core/direct-functions/remove-task.js:104
}
};
}
// Enable silent mode to prevent console logs from interfering with JSON response
enableSilentMode();
try {
// Call removeTask with proper context including tag
const result = await removeTask(tasksJsonPath, id, {
projectRoot,
tag
});
if (!result.success) {
return {
success: false,
error: {
code: 'REMOVE_TASK_ERROR',
message: result.error || 'Failed to remove tasks'
}
};
}
log.info(`Successfully removed ${result.removedTasks.length} task(s)`);
return {
success: true,
data: {
totalTasks: taskIdArray.length,
successful: result.removedTasks.length,
failed: taskIdArray.length - result.removedTasks.length,
removedTasks: result.removedTasks,
message: result.message,
tasksPath: tasksJsonPath,
tag
}View on GitHub (pinned to c0c98d367c)
Solutions
- Read the returned `message` — it is the underlying core error; fix the condition it describes (usually file permission or state issue)
- Check that tasks.json and its containing directories are writable by the process running the MCP server
- Retry after confirming no concurrent process (editor, CLI) is holding/rewriting tasks.json
- Upgrade task-master-ai if the message points to an internal core error; report the core error if it persists
Defensive patterns
Strategy: try-catch
Validate before calling
// Pre-check writability of the workspace before mutating calls
import { accessSync, constants } from 'fs';
try { accessSync(tasksJsonPath, constants.W_OK); } catch { throw new Error(`tasks.json is not writable: ${tasksJsonPath}`); } Try / catch
try {
const res = await client.callTool('remove_task', { id, projectRoot });
if (!res.success && res.error?.code === 'REMOVE_TASK_ERROR') {
// res.error.message carries the underlying core failure (permissions, concurrent write, etc.)
console.error(`Core removal failed: ${res.error.message}`);
}
} catch (e) {
console.error('remove_task failed:', e.message);
} Prevention
- Ensure the MCP server process has write access to .taskmaster and tasks.json
- Avoid running CLI and MCP mutations on the same tasks.json concurrently
- Keep tm-core and the MCP server versions in sync
- Back up tasks.json before bulk removals
When it happens
Trigger: The core removeTasks operation fails after id validation: filesystem write failures (read-only dir, permissions), errors thrown inside the core removal routine, or tag-scoped data mutations failing during the write-back.
Common situations: tasks.json is read-only or owned by another user; disk full; the file was modified concurrently between validation and write; projectRoot misconfigured so supporting state files cannot be written; a bug/regression in the core remove logic.
Related errors
AI-assisted analysis of eyaltoledano/claude-task-master@c0c98d367c (2026-08-29).
Data as JSON: /api/errors/72c88c8d0d275e11.
Report an issue: GitHub.