{"record":{"id":"1ed0f234842f5299","repo":"eyaltoledano/claude-task-master","slug":"failed-to-initialize-services-error-as-error","errorCode":null,"errorMessage":"Failed to initialize services: ${(error as Error).message}","messagePattern":"Failed to initialize services: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"apps/cli/src/commands/export.command.ts","lineNumber":128,"sourceCode":"\t * Initialize the TmCore and PromptService\n\t */\n\tprivate async initializeServices(): Promise<void> {\n\t\tif (this.taskMasterCore) {\n\t\t\treturn;\n\t\t}\n\n\t\ttry {\n\t\t\tconst projectRoot = getProjectRoot();\n\n\t\t\t// Initialize TmCore\n\t\t\tthis.taskMasterCore = await createTmCore({\n\t\t\t\tprojectPath: projectRoot\n\t\t\t});\n\n\t\t\t// Initialize PromptService for upgrade prompts\n\t\t\tthis.promptService = new PromptService(projectRoot);\n\t\t} catch (error) {\n\t\t\tthrow new Error(\n\t\t\t\t`Failed to initialize services: ${(error as Error).message}`\n\t\t\t);\n\t\t}\n\t}\n\n\t/**\n\t * Execute the export command\n\t */\n\tprivate async executeExport(options?: any): Promise<void> {\n\t\ttry {\n\t\t\t// Ensure user is authenticated (will prompt and trigger OAuth if not)\n\t\t\tconst authResult = await ensureAuthenticated({\n\t\t\t\tactionName: 'export tasks to Hamster'\n\t\t\t});\n\n\t\t\tif (!authResult.authenticated) {\n\t\t\t\tif (authResult.cancelled) {\n\t\t\t\t\tthis.lastResult = {","sourceCodeStart":110,"sourceCodeEnd":146,"githubUrl":"https://github.com/eyaltoledano/claude-task-master/blob/c0c98d367c55296bfe69e65680625b6db437af02/apps/cli/src/commands/export.command.ts#L110-L146","documentation":"copyTag checks the raw tagged data for a key matching sourceName and throws if absent, since there is nothing to copy. Tags are top-level keys in the tagged tasks data, so an unknown name simply doesn't exist.","triggerScenarios":"Calling copyTag with a sourceName that was never created, or with a typo/case mismatch against an existing tag key (keys are case-sensitive).","commonSituations":"Listing tags with `task-master tags` and misspelling the name; referencing a tag deleted earlier or existing only in another project's tasks.json.","solutions":["Run `task-master tags` (or inspect data.tags) to list valid source tag names","Fix the spelling/casing of sourceName to match the existing tag key","Create the source tag first (createTag) before copying"],"exampleFix":"// before\nawait copyTag(tasksPath, 'in-progres', 'done');\n// after\nawait copyTag(tasksPath, 'in-progress', 'done');","handlingStrategy":"validation","validationCode":"const data = JSON.parse(fs.readFileSync(tasksPath, 'utf8'));\nconst tags = Object.keys(data.tags || data).filter(k => k !== 'tasks');\nif (!tags.includes(sourceName)) throw new Error(`Unknown source tag: ${sourceName}. Available: ${tags.join(', ')}`);","typeGuard":null,"tryCatchPattern":"try {\n  await copyTag(tasksPath, source, target);\n} catch (e) {\n  if (e.message.includes('does not exist')) {\n    throw new Error(`Tag \"${source}\" not found. Run 'task-master tags' to list valid tags.`);\n  }\n  throw e;\n}","preventionTips":["List existing tags (task-master tags) before scripted copies","Copy-paste tag names instead of retyping them","Remember tag keys are case-sensitive"],"tags":["validation","tag-management"],"backgroundTag":"tag-not-found","analyzedSha":"c0c98d367c55296bfe69e65680625b6db437af02","analyzedAt":"2026-08-29T02:56:26.071Z","schemaVersion":2},"datasetVersion":"2026-08-29T07:17:48.351Z"}