{"record":{"id":"ab7784aa92400998","repo":"eyaltoledano/claude-task-master","slug":"internal-error-ab7784","errorCode":"INTERNAL_ERROR","errorMessage":"Failed to initialize TmCore","messagePattern":"Failed to initialize TmCore","errorType":"error_code","errorClass":"TaskMasterError","httpStatus":null,"severity":"critical","filePath":"packages/tm-core/src/tm-core.ts","lineNumber":201,"sourceCode":"\t\t\tthis._integration = new IntegrationDomain(this._configManager);\n\t\t\tthis._loop = new LoopDomain(this._configManager);\n\n\t\t\t// Initialize domains that need async setup\n\t\t\tawait this._tasks.initialize();\n\n\t\t\t// Wire up cross-domain dependencies\n\t\t\t// WorkflowDomain needs TasksDomain for status updates\n\t\t\tthis._workflow.setTasksDomain(this._tasks);\n\n\t\t\t// Log successful initialization\n\t\t\tthis._logger.info('TmCore initialized successfully');\n\t\t} catch (error) {\n\t\t\t// Log error if logger is available\n\t\t\tif (this._logger) {\n\t\t\t\tthis._logger.error('Failed to initialize TmCore:', error);\n\t\t\t}\n\n\t\t\tthrow new TaskMasterError(\n\t\t\t\t'Failed to initialize TmCore',\n\t\t\t\tERROR_CODES.INTERNAL_ERROR,\n\t\t\t\t{ operation: 'initialize' },\n\t\t\t\terror as Error\n\t\t\t);\n\t\t}\n\t}\n\n\t/**\n\t * Get project root path\n\t */\n\tget projectPath(): string {\n\t\treturn this._projectPath;\n\t}\n\n\t/**\n\t * Close and cleanup resources\n\t * Releases file locks and other storage resources","sourceCodeStart":183,"sourceCodeEnd":219,"githubUrl":"https://github.com/eyaltoledano/claude-task-master/blob/c0c98d367c55296bfe69e65680625b6db437af02/packages/tm-core/src/tm-core.ts#L183-L219","documentation":"A wrapper error thrown when TmCore.initialize() fails for any internal reason (dependency construction, service wiring, config loading, etc.). The original error is attached as the `cause` and the failure is logged via the configured logger, so the outer TaskMasterError (code INTERNAL_ERROR) is generic while the root cause lives on the error object.","triggerScenarios":"Any exception inside initialize()'s try block — e.g. a domain service constructor throws, config files are unreadable, or a module dependency fails to instantiate during TmCore.create().","commonSituations":"Corrupt or missing project config, filesystem permission problems, a broken custom adapter/service injected via options, or bugs in a newly upgraded tm-core version.","solutions":["Inspect error.cause (the 4th TaskMasterError arg) and the logger output ('Failed to initialize TmCore:') for the real root cause.","Verify the project directory and its Task Master config files are readable and valid.","Check that any custom options/adapters passed to TmCore.create() are valid instances.","Reproduce with a minimal TmCore.create({ projectPath }) call to isolate the failing subsystem, then upgrade or file an issue if it's a library bug."],"exampleFix":"// before\ntry { const tm = await TmCore.create(opts); } catch (e) { console.log(e.message); } // generic only\n// after\ntry { const tm = await TmCore.create(opts); }\ncatch (e) {\n  console.error(e.message, e.cause ?? e); // root cause of init failure\n}","handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"import { TaskMasterError } from '@tm/core';\ntry {\n  const tmCore = await TmCore.create({ projectPath });\n} catch (e) {\n  if (e instanceof TaskMasterError && e.code === 'INTERNAL_ERROR') {\n    console.error('TmCore init failed:', e.cause ?? e); // surface root cause\n  } else throw e;\n}","preventionTips":["Always inspect error.cause on TaskMasterError for the real failure.","Enable the TmCore logger so init failures are logged with detail.","Keep project config files valid and readable; test TmCore.create() early in app startup.","Pin tm-core versions and read upgrade notes for changed init requirements."],"tags":["initialization","internal-error","wrapping"],"backgroundTag":"initialization-failed","analyzedSha":"c0c98d367c55296bfe69e65680625b6db437af02","analyzedAt":"2026-08-29T02:56:26.071Z","schemaVersion":2},"datasetVersion":"2026-08-29T07:17:48.351Z"}