{"record":{"id":"8f3b8d53ae8d6d19","repo":"plandex-ai/plandex","slug":"failed-to-get-the-directory-tree-s-v","errorCode":null,"errorMessage":"failed to get the directory tree %s: %v","messagePattern":"failed to get the directory tree (.+?): (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"app/cli/lib/context_update.go","lineNumber":607,"sourceCode":"\n\t\t\t\t// We collect paths from the existing map\n\t\t\t\tvar mapPaths []string\n\t\t\t\tfor path := range ctx.MapShas {\n\t\t\t\t\tmapPaths = append(mapPaths, path)\n\t\t\t\t}\n\n\t\t\t\t// Next, see if there are newly added files\n\t\t\t\tbaseDir := fs.GetBaseDirForFilePaths([]string{ctx.FilePath})\n\t\t\t\tflattenedPaths, err := ParseInputPaths(ParseInputPathsParams{\n\t\t\t\t\tFileOrDirPaths: []string{ctx.FilePath},\n\t\t\t\t\tBaseDir:        baseDir,\n\t\t\t\t\tProjectPaths:   projectPaths,\n\t\t\t\t\tLoadParams:     &types.LoadContextParams{Recursive: true},\n\t\t\t\t})\n\t\t\t\tif err != nil {\n\t\t\t\t\tmu.Lock()\n\t\t\t\t\tdefer mu.Unlock()\n\t\t\t\t\terrs = append(errs, fmt.Errorf(\"failed to get the directory tree %s: %v\", ctx.FilePath, err))\n\t\t\t\t\treturn\n\t\t\t\t}\n\n\t\t\t\tvar filtered []string\n\t\t\t\tif projectPaths != nil {\n\t\t\t\t\tfor _, p := range flattenedPaths {\n\t\t\t\t\t\tif _, ok := projectPaths.ActivePaths[p]; ok {\n\t\t\t\t\t\t\tfiltered = append(filtered, p)\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tflattenedPaths = filtered\n\t\t\t\t}\n\n\t\t\t\t// If a path was not already in the map, it's newly added\n\t\t\t\tfor _, p := range flattenedPaths {\n\t\t\t\t\tif _, ok := ctx.MapShas[p]; !ok {\n\t\t\t\t\t\tmapPaths = append(mapPaths, p)\n\t\t\t\t\t}","sourceCodeStart":589,"sourceCodeEnd":625,"githubUrl":"https://github.com/plandex-ai/plandex/blob/e2d772072efadbe41d2946d97d79be55532dbab5/app/cli/lib/context_update.go#L589-L625","documentation":"Same family as the directory-tree failure, but raised in a second code path that loads the tree recursively (LoadParams{Recursive:true}) with explicit projectPaths. ParseInputPaths returned an error while re-expanding a project directory-tree context. It indicates the recursive load of the tree root failed.","triggerScenarios":"ParseInputPaths with FileOrDirPaths [ctx.FilePath], ProjectPaths set, and LoadParams{Recursive:true} returns err during the project-tree goroutine — recursive traversal, ignore evaluation, or path resolution failed.","commonSituations":"Project root reconfigured to a path with unreadable subdirectories; ignore-file syntax errors newly introduced; recursive scan hitting a very deep symlink cycle; tree root deleted or renamed after context creation but before stat notice.","solutions":["Read the wrapped %v cause and fix the specific path/permission/ignore problem it names.","Correct the project paths configuration so all referenced dirs are valid and readable.","Remove and re-add the project tree context so it rebuilds against current paths.","Resolve symlink loops or exclude problematic directories via ignore rules."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"for _, dir := range projectDirs {\n    if fi, err := os.Stat(dir); err != nil || !fi.IsDir() {\n        return fmt.Errorf(\"project path %s invalid: %v\", dir, err)\n    }\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Verify project paths config points at existing, readable dirs","Test recursive traversal manually (find <root>) before refresh","Exclude generated/vendored dirs with ignore rules","Rebuild project tree contexts after reconfiguring project paths"],"tags":["filesystem","directory-tree","project-paths"],"backgroundTag":"directory-walk-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"}