{"record":{"id":"19d51e0bebfdf68f","repo":"eyaltoledano/claude-task-master","slug":"source-file-not-found-item-from","errorCode":null,"errorMessage":"Source file not found: ${item.from}","messagePattern":"Source file not found: (.+?)","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"scripts/modules/task-manager/migrate.js","lineNumber":229,"sourceCode":"\t}\n\n\t// Create backup if requested\n\tif (options.backup) {\n\t\tconst backupDir = path.join(projectRoot, '.taskmaster-migration-backup');\n\t\tlog.info(`Creating backup in: ${backupDir}`);\n\t\tif (fs.existsSync(backupDir)) {\n\t\t\tfs.rmSync(backupDir, { recursive: true, force: true });\n\t\t}\n\t\tfs.mkdirSync(backupDir, { recursive: true });\n\t}\n\n\t// Migrate files\n\tfor (const item of migrationPlan) {\n\t\tconst fromPath = path.join(projectRoot, item.from);\n\t\tconst toPath = path.join(projectRoot, item.to);\n\n\t\tif (!fs.existsSync(fromPath)) {\n\t\t\tlog.warn(`Source file not found: ${item.from}`);\n\t\t\tcontinue;\n\t\t}\n\n\t\t// Create backup if requested\n\t\tif (options.backup) {\n\t\t\tconst backupPath = path.join(\n\t\t\t\tprojectRoot,\n\t\t\t\t'.taskmaster-migration-backup',\n\t\t\t\titem.from\n\t\t\t);\n\t\t\tconst backupDir = path.dirname(backupPath);\n\t\t\tif (!fs.existsSync(backupDir)) {\n\t\t\t\tfs.mkdirSync(backupDir, { recursive: true });\n\t\t\t}\n\t\t\tfs.copyFileSync(fromPath, backupPath);\n\t\t}\n\n\t\t// Ensure destination directory exists","sourceCodeStart":211,"sourceCodeEnd":247,"githubUrl":"https://github.com/eyaltoledano/claude-task-master/blob/c0c98d367c55296bfe69e65680625b6db437af02/scripts/modules/task-manager/migrate.js#L211-L247","documentation":"performMigration iterates the migration plan and copies each file. If a planned source path no longer exists on disk when the copy step runs, it warns and skips that item instead of crashing, keeping the rest of the migration intact.","triggerScenarios":"A migrationPlan item's 'from' path (relative to projectRoot) is missing at execution time — usually because the file was deleted/moved between analyzeMigrationNeeds and performMigration, or a plan item was hand-constructed with a wrong relative path.","commonSituations":"Running analyze and perform steps separately (e.g. via API) with filesystem changes in between; dry-run plan reviewed then files removed before applying; custom tooling generating the plan with incorrect paths.","solutions":["Verify the file exists at <projectRoot>/<item.from>; restore it or remove it from the migration plan.","Re-run the full migration (analyze + perform) in one pass so the plan matches the current filesystem.","If the file was intentionally deleted, ignore this warning — the rest of the migration continues."],"exampleFix":"// before\nconst plan = await analyzeMigrationNeeds(root);\nawait someDelay(); // file deleted in the meantime\nawait performMigration(root, plan);\n// after\nconst plan = await analyzeMigrationNeeds(root);\nawait performMigration(root, plan); // analyze and perform together","handlingStrategy":"try-catch","validationCode":"plan.forEach(item => {\n  if (!fs.existsSync(path.join(projectRoot, item.from))) {\n    console.warn(`Plan references missing file: ${item.from}`);\n  }\n});","typeGuard":null,"tryCatchPattern":"try {\n  await performMigration(projectRoot, plan, options);\n} catch (e) {\n  console.error('Migration failed:', e.message);\n  // restore from backup if options.backup was used\n}","preventionTips":["Run analyzeMigrationNeeds and performMigration back-to-back with no intervening file changes.","Avoid deleting/moving legacy files between planning and execution.","Always use the --backup option so skipped/failed items can be recovered."],"tags":["migration","filesystem","missing-file"],"backgroundTag":"file-not-found","analyzedSha":"c0c98d367c55296bfe69e65680625b6db437af02","analyzedAt":"2026-08-29T02:56:26.071Z","schemaVersion":2},"datasetVersion":"2026-08-29T07:17:48.351Z"}