{"record":{"id":"bae6a6743782fe70","repo":"eyaltoledano/claude-task-master","slug":"project-root-override-path-does-not-exist-resol","errorCode":null,"errorMessage":"Project root override path does not exist: ${resolvedOverride}","messagePattern":"Project root override path does not exist: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/task-master.js","lineNumber":232,"sourceCode":"\t\tfor (const defaultPath of defaultPaths) {\n\t\t\tconst fullPath = path.isAbsolute(defaultPath)\n\t\t\t\t? defaultPath\n\t\t\t\t: path.join(basePath || process.cwd(), defaultPath);\n\t\t\tif (fs.existsSync(fullPath)) {\n\t\t\t\treturn fullPath;\n\t\t\t}\n\t\t}\n\n\t\treturn null;\n\t};\n\n\tconst paths = {};\n\n\t// Project Root\n\tif (overrides.projectRoot) {\n\t\tconst resolvedOverride = path.resolve(overrides.projectRoot);\n\t\tif (!fs.existsSync(resolvedOverride)) {\n\t\t\tthrow new Error(\n\t\t\t\t`Project root override path does not exist: ${resolvedOverride}`\n\t\t\t);\n\t\t}\n\n\t\tconst hasTaskmasterDir = fs.existsSync(\n\t\t\tpath.join(resolvedOverride, TASKMASTER_DIR)\n\t\t);\n\t\tconst hasLegacyConfig = fs.existsSync(\n\t\t\tpath.join(resolvedOverride, LEGACY_CONFIG_FILE)\n\t\t);\n\n\t\tif (!hasTaskmasterDir && !hasLegacyConfig) {\n\t\t\tthrow new Error(\n\t\t\t\t`Project root override is not a valid taskmaster project: ${resolvedOverride}`\n\t\t\t);\n\t\t}\n\n\t\tpaths.projectRoot = resolvedOverride;","sourceCodeStart":214,"sourceCodeEnd":250,"githubUrl":"https://github.com/eyaltoledano/claude-task-master/blob/c0c98d367c55296bfe69e65680625b6db437af02/src/task-master.js#L214-L250","documentation":"initTaskMaster() accepts a projectRoot override and strictly validates it: the resolved path must exist on disk. Unlike default root detection (which searches upward for markers), an explicit override is trusted but verified — pointing it at a nonexistent or mistyped directory fails immediately with the resolved absolute path in the message.","triggerScenarios":"taskMaster({ projectRoot: './my-proj' }) where my-proj doesn't exist or is misspelled; projectRoot read from env/config pointing at a deleted or renamed directory; running on CI where the checkout path differs from the configured root; relative path resolved against an unexpected cwd.","commonSituations":"Typo in the path (e.g. ./projets instead of ./projects); project moved/renamed after config was written; Docker/CI containers mounting the repo at a different path than local config assumes.","solutions":["Correct the projectRoot value to an existing directory (the error shows the resolved absolute path to compare against).","Verify the directory exists: ls <resolvedPath> or fs.existsSync in a script.","Remove the override to let initTaskMaster auto-detect the root by searching for taskmaster markers.","Use an absolute path in CI/containers to avoid cwd-relative surprises."],"exampleFix":"// before\nconst tm = taskMaster({ projectRoot: '../my-projet' }); // typo\n// after\nconst tm = taskMaster({ projectRoot: '/abs/path/to/my-project' });","handlingStrategy":"validation","validationCode":"function assertProjectRoot(root) {\n  const resolved = path.resolve(root);\n  if (!fs.existsSync(resolved) || !fs.statSync(resolved).isDirectory()) {\n    throw new Error(`projectRoot override does not exist: ${resolved}`);\n  }\n}\nassertProjectRoot(cfg.projectRoot);","typeGuard":null,"tryCatchPattern":"try {\n  const tm = taskMaster({ projectRoot: cfg.projectRoot });\n} catch (err) {\n  if (err.message.startsWith('Project root override path does not exist')) {\n    console.warn(err.message, '— falling back to auto-detection');\n    const tm = taskMaster(); // no override\n  } else {\n    throw err;\n  }\n}","preventionTips":["Use absolute paths for projectRoot, especially in CI/containers.","Validate the directory exists before passing it as an override.","Omit the override when the cwd already is the project root.","Regenerate config when projects move or are renamed.","Echo path.resolve(projectRoot) in debug logging to compare against the error's resolved path."],"tags":["configuration","path-resolution","filesystem","validation"],"backgroundTag":"file-not-found","analyzedSha":"c0c98d367c55296bfe69e65680625b6db437af02","analyzedAt":"2026-08-29T02:56:26.071Z","schemaVersion":2},"datasetVersion":"2026-08-29T07:17:48.351Z"}