{"record":{"id":"c98c4951ddba08e4","repo":"plandex-ai/plandex","slug":"failed-to-get-project-paths-v-c98c49","errorCode":null,"errorMessage":"failed to get project paths: %v","messagePattern":"failed to get project paths: (.+?)","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"app/cli/lib/context_load.go","lineNumber":211,"sourceCode":"\t\t\t\tfor _, path := range toLoadMapPaths {\n\t\t\t\t\tif !cachedMapPaths[path] {\n\t\t\t\t\t\tuncachedMapPaths = append(uncachedMapPaths, path)\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tuncachedMapPaths = toLoadMapPaths\n\t\t\t}\n\n\t\t\ttoLoadMapPaths = uncachedMapPaths\n\t\t\tinputFilePaths = toLoadMapPaths\n\t\t}\n\n\t\tif len(inputFilePaths) > 0 {\n\t\t\tbaseDir := fs.GetBaseDirForFilePaths(inputFilePaths)\n\n\t\t\tpaths, err := fs.GetProjectPaths(baseDir)\n\t\t\tif err != nil {\n\t\t\t\tonErr(fmt.Errorf(\"failed to get project paths: %v\", err))\n\t\t\t}\n\n\t\t\tif !params.ForceSkipIgnore {\n\t\t\t\tvar filteredPaths []string\n\t\t\t\tfor _, inputFilePath := range inputFilePaths {\n\t\t\t\t\tif _, ok := paths.ActivePaths[inputFilePath]; !ok {\n\t\t\t\t\t\tignored, reason, err := fs.IsIgnored(paths, inputFilePath, baseDir)\n\t\t\t\t\t\tif err != nil {\n\t\t\t\t\t\t\tonErr(fmt.Errorf(\"failed to check if %s is ignored: %v\", inputFilePath, err))\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif ignored {\n\t\t\t\t\t\t\tignoredPaths[inputFilePath] = reason\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\tfilteredPaths = append(filteredPaths, inputFilePath)\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tinputFilePaths = filteredPaths","sourceCodeStart":193,"sourceCodeEnd":229,"githubUrl":"https://github.com/plandex-ai/plandex/blob/e2d772072efadbe41d2946d97d79be55532dbab5/app/cli/lib/context_load.go#L193-L229","documentation":"MustLoadContext derives a base directory from the input file paths and calls fs.GetProjectPaths to enumerate project paths (respecting .gitignore etc.); this error means that local filesystem walk failed. It happens before any server calls for those paths, so it's purely a local project-root/ignore-file problem.","triggerScenarios":"fs.GetProjectPaths(baseDir) returns an error — baseDir does not exist or is unreadable, .gitignore/.plandexignore can't be parsed/read, or permission errors walking the tree.","commonSituations":"Loading files from a directory that was moved/deleted; running the CLI outside the project root with relative paths; malformed .gitignore causing the ignore parser to fail; unreadable subdirectory due to permissions.","solutions":["Run from the project root or pass paths relative to it and confirm the directory exists","Fix or remove malformed .gitignore/.plandexignore files","Check read permissions on the base directory (ls -la)","Re-run with --skip-ignore/-f if ignore-file parsing is the blocker"],"exampleFix":"// before\npaths, err := fs.GetProjectPaths(baseDir)\nif err != nil {\n\tonErr(fmt.Errorf(\"failed to get project paths: %v\", err))\n}\n// after\nif _, statErr := os.Stat(baseDir); statErr != nil {\n\tonErr(fmt.Errorf(\"project directory %s not accessible: %v\", baseDir, statErr))\n}\npaths, err := fs.GetProjectPaths(baseDir)\nif err != nil {\n\tonErr(fmt.Errorf(\"failed to get project paths: %w\", err))\n}","handlingStrategy":"validation","validationCode":"// validate the base dir before enumerating paths\nbaseDir := fs.GetBaseDirForFilePaths(inputFilePaths)\nif fi, err := os.Stat(baseDir); err != nil || !fi.IsDir() {\n\treturn fmt.Errorf(\"project directory %s missing or not a directory\", baseDir)\n}","typeGuard":"// Go: verify GetProjectPaths result before use\nfunc projectPathsValid(p *fs.ProjectPaths) bool {\n\treturn p != nil && p.ActivePaths != nil\n}","tryCatchPattern":"// Go: wrap with actionable context\npaths, err := fs.GetProjectPaths(baseDir)\nif err != nil {\n\treturn fmt.Errorf(\"failed to get project paths for %s (check dir exists and ignore files parse): %w\", baseDir, err)\n}","preventionTips":["Run from the project root or use absolute paths","Validate .gitignore/.plandexignore syntax after editing","Fix directory permissions before loading","Skip nonexistent directories from load scripts"],"tags":["filesystem","gitignore","cli","local"],"backgroundTag":"gitignore-parse-failed","analyzedSha":"e2d772072efadbe41d2946d97d79be55532dbab5","analyzedAt":"2026-09-05T20:56:53.631Z","contentChangedAt":"2026-09-05T20:56:53.631Z","schemaVersion":2},"datasetVersion":"2026-09-12T22:17:10.623Z"}