eyaltoledano/claude-task-master · error

EXPORT_FAILED

EXPORT_FAILED

Error message

${errorMessage}

What it means

exportTasks wraps the actual export HTTP call (performExport) in a try/catch and converts any thrown error into a failed ExportResult with code EXPORT_FAILED and the underlying error's message. It is a catch-all: the real cause (network, HTTP status, transformation, auth refresh) is inside the message string, not a structured code.

Source

Thrown at packages/tm-core/src/modules/integration/services/export.service.ts:474

			return {
				success: true,
				taskCount: taskListResult.tasks.length,
				briefId,
				orgId,
				message: `Successfully exported ${taskListResult.tasks.length} task(s) to brief`
			};
		} catch (error) {
			const errorMessage =
				error instanceof Error ? error.message : String(error);

			return {
				success: false,
				taskCount: 0,
				briefId,
				orgId,
				error: {
					code: 'EXPORT_FAILED',
					message: errorMessage
				}
			};
		}
	}

	/**
	 * Export tasks from a brief ID or URL
	 */
	async exportFromBriefInput(briefInput: string): Promise<ExportResult> {
		// Extract brief ID from input
		const briefId = this.extractBriefId(briefInput);
		if (!briefId) {
			throw new TaskMasterError(
				'Invalid brief ID or URL provided',
				ERROR_CODES.VALIDATION_ERROR
			);
		}

View on GitHub (pinned to c0c98d367c)

Solutions

  1. Read result.error.message - it contains the underlying error; fix that root cause first.
  2. Re-run `tm auth` to refresh an expired session, then retry the export.
  3. Verify network reachability of the Hamster API host (proxy/firewall/VPN).
  4. Retry later if the message indicates a 5xx server error; check brief status in Hamster.
  5. Log the full result and report to maintainers if the message is opaque.

Example fix

const result = await exportService.exportTasks({ orgId, briefId });
if (!result.success) {
  console.error(`Export failed: ${result.error?.message}`); // root cause is embedded here
}
Defensive patterns

Strategy: try-catch

Validate before calling

const health = await fetch(apiBase + '/health');
if (!health.ok) throw new Error('API unreachable before export');

Type guard

function isExportFailed(r: ExportResult): r is ExportResult & { success: false; error: { code: 'EXPORT_FAILED'; message: string } } {
  return !r.success && r.error?.code === 'EXPORT_FAILED';
}

Try / catch

const result = await exportService.exportTasks(opts);
if (!result.success && result.error?.code === 'EXPORT_FAILED') {
  logger.error('export failed', { cause: result.error.message });
  // retry with backoff or surface result.error.message to the user
}

Prevention

When it happens

Trigger: performExport throws during task transformation or during the HTTP request to the Hamster export API - e.g. a 4xx/5xx response, network timeout, DNS failure, or an invalid task shape the API rejects.

Common situations: Server-side 500s while the brief is in a bad state, expired access tokens mid-request, corporate proxies blocking the API host, or tasks containing fields (long descriptions, invalid characters) the API rejects with 400.

Related errors


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