eyaltoledano/claude-task-master · error

VALIDATION_ERROR

VALIDATION_ERROR

Error message

${error.message}

What it means

Catch-all return path of validateDependenciesDirect: any exception thrown while validating dependencies (after the file-exists check) is caught and re-packaged as a structured VALIDATION_ERROR whose message is the underlying error's message.

Source

Thrown at mcp-server/src/core/direct-functions/validate-dependencies.js:79

		disableSilentMode();

		return {
			success: true,
			data: {
				message: 'Dependencies validated successfully',
				tasksPath
			}
		};
	} catch (error) {
		// Make sure to restore normal logging even if there's an error
		disableSilentMode();

		log.error(`Error validating dependencies: ${error.message}`);
		return {
			success: false,
			error: {
				code: 'VALIDATION_ERROR',
				message: error.message
			}
		};
	}
}

View on GitHub (pinned to c0c98d367c)

Solutions

  1. Read the wrapped message (and server logs showing 'Error validating dependencies') to find the root cause
  2. Validate tasks.json is parseable JSON with a tasks array (jq . tasks.json)
  3. Check task IDs referenced in dependencies actually exist in the file
  4. Check file read permissions on tasks.json

Example fix

// before
{ "tasks": [ { "id": 1, "dependencies": [99] } ] }  // dangling dep id -> VALIDATION_ERROR
// after
{ "tasks": [ { "id": 1, "dependencies": [] } ] }
Defensive patterns

Strategy: try-catch

Validate before calling

const raw = fs.readFileSync(tasksPath, 'utf8');
const data = JSON.parse(raw); // throws early with a clearer parse error
if (!Array.isArray(data.tasks)) throw new Error('tasks.json must contain a tasks array');

Type guard

function isValidTasksFile(p: string): boolean {
  try { const d = JSON.parse(fs.readFileSync(p, 'utf8')); return Array.isArray(d.tasks); }
  catch { return false; }
}

Try / catch

const res = await validateDependenciesDirect({ tasksJsonPath });
if (!res.success && res.error?.code === 'VALIDATION_ERROR') {
  console.error('Dependency validation failed:', res.error.message);
}

Prevention

When it happens

Trigger: The core dependency validation logic throws — malformed JSON in tasks.json, tasks array missing/corrupt, unreadable file (permissions), or a bug in dependency graph traversal triggered by cyclic or self-referencing dependencies.

Common situations: Hand-edited tasks.json with invalid JSON; schema drift after a version upgrade; tasks referencing dependency IDs that don't exist; read-permission problems.

Understand the failure class

Background: Schema validation failed / invalid input schema: payload rejected because its shape doesn't match the expected schema — this error's family across 28 libraries.

Related errors


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