eyaltoledano/claude-task-master · error · TaskMasterError

MISSING_CONFIGURATION

MISSING_CONFIGURATION

Error message

Organization ID is required for export. Use "tm context org" to select one.

What it means

exportTasks() resolves the target organization from options.orgId or the current context (context?.orgId). If neither is set, it throws TaskMasterError with code MISSING_CONFIGURATION because the export API needs to know which organization owns the brief. The message points to `tm context org` as the remediation command.

Source

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

		const isAuthenticated = await this.authManager.hasValidSession();
		// Validate authentication
		if (!isAuthenticated) {
			throw new TaskMasterError(
				'Authentication required for export',
				ERROR_CODES.AUTHENTICATION_ERROR
			);
		}

		// Get current context
		const context = await this.authManager.getContext();

		// Determine org and brief IDs
		const orgId = options.orgId || context?.orgId;
		const briefId = options.briefId || context?.briefId;

		// Validate we have necessary IDs
		if (!orgId) {
			throw new TaskMasterError(
				'Organization ID is required for export. Use "tm context org" to select one.',
				ERROR_CODES.MISSING_CONFIGURATION
			);
		}

		if (!briefId) {
			throw new TaskMasterError(
				'Brief ID is required for export. Use "tm context brief" or provide --brief flag.',
				ERROR_CODES.MISSING_CONFIGURATION
			);
		}

		// Get tasks from the specified or active tag
		const activeTag = this.configManager.getActiveTag();
		const tag = options.tag || activeTag;

		// Always read tasks from local file storage for export
		// (we're exporting local tasks to a remote brief)

View on GitHub (pinned to c0c98d367c)

Solutions

  1. Run `tm context org` to select an organization, then retry the export.
  2. Pass orgId explicitly: exportTasks({ orgId: '<org-id>', briefId, ... }).
  3. Verify the current context (`tm context show`) — it may have been reset after logout or config deletion.
  4. If exporting via a brief ID/URL, use exportFromBriefInput() which resolves the org from the brief automatically.

Example fix

// before
await exportService.exportTasks({ briefId: 'b-123' });
// after
await exportService.exportTasks({ orgId: 'org-456', briefId: 'b-123' });
// or select once via CLI: tm context org
Defensive patterns

Strategy: validation

Validate before calling

const context = await tmCore.context.get();
const orgId = options.orgId ?? context?.orgId;
if (!orgId) {
  throw new Error('No org selected — run `tm context org` or pass orgId');
}
await exportService.exportTasks({ ...options, orgId });

Try / catch

try {
  await exportService.exportTasks(options);
} catch (e) {
  if (e instanceof TaskMasterError && e.code === ERROR_CODES.MISSING_CONFIGURATION) {
    console.error(e.message); // includes the `tm context org` remediation hint
    return;
  }
  throw e;
}

Prevention

When it happens

Trigger: Calling exportTasks() without options.orgId while the current context has no orgId selected (never ran `tm context org`, or context was cleared/reset).

Common situations: New machine or fresh clone where context was never initialized; multiple organizations and none selected; scripting the export programmatically and omitting orgId in the options object.

Related errors


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