{"record":{"id":"43070808d5126b7c","repo":"plandex-ai/plandex","slug":"error-checking-for-plandexignore-file-s","errorCode":null,"errorMessage":"error checking for .plandexignore file: %s","messagePattern":"error checking for \\.plandexignore file: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"app/cli/fs/paths.go","lineNumber":364,"sourceCode":"\t\tPlandexIgnored: ignored,\n\t\tIgnoredPaths:   ignoredPaths,\n\t\tGitIgnoredDirs: gitIgnoredDirs,\n\t}, nil\n}\n\nfunc GetPlandexIgnore(dir string) (*ignore.GitIgnore, error) {\n\tignorePath := filepath.Join(dir, \".plandexignore\")\n\n\tif _, err := os.Stat(ignorePath); err == nil {\n\t\tignored, err := ignore.CompileIgnoreFile(ignorePath)\n\n\t\tif err != nil {\n\t\t\treturn nil, fmt.Errorf(\"error reading .plandexignore file: %s\", err)\n\t\t}\n\n\t\treturn ignored, nil\n\t} else if !os.IsNotExist(err) {\n\t\treturn nil, fmt.Errorf(\"error checking for .plandexignore file: %s\", err)\n\t}\n\n\treturn nil, nil\n}\n\nfunc GetBaseDirForContexts(contexts []*shared.Context) string {\n\tvar paths []string\n\n\tfor _, context := range contexts {\n\t\tif context.FilePath != \"\" {\n\t\t\tpaths = append(paths, context.FilePath)\n\t\t}\n\t}\n\n\treturn GetBaseDirForFilePaths(paths)\n}\n\nfunc GetBaseDirForFilePaths(paths []string) string {","sourceCodeStart":346,"sourceCodeEnd":382,"githubUrl":"https://github.com/plandex-ai/plandex/blob/e2d772072efadbe41d2946d97d79be55532dbab5/app/cli/fs/paths.go#L346-L382","documentation":"After Stat on .plandexignore returns a non-nil error, GetPlandexIgnore distinguishes 'not exist' (normal, returns nil) from any other Stat failure (permission denied, I/O error, path issues), which produces this wrapped error.","triggerScenarios":"os.Stat(.plandexignore) fails with an error other than fs.ErrNotExist — typically EACCES on a parent directory, ELOOP from a symlink cycle, or I/O errors on network filesystems.","commonSituations":"Running in a directory where a parent dir lost execute permission; .plandexignore is a broken symlink loop; NFS/NAS mounts returning stale file handles.","solutions":["Check permissions on the project directory and .plandexignore path (ls -la, fix with chmod/chown)","Remove or repair broken symlinks along the path","Run the CLI from a healthy local directory instead of a flaky network mount","Inspect the wrapped err to identify the exact syscall failure"],"exampleFix":"// before\nchmod 000 project/\n// after\nchmod 755 project/","handlingStrategy":"fallback","validationCode":"ignorePath := filepath.Join(dir, \".plandexignore\")\nif _, err := os.Stat(filepath.Dir(ignorePath)); err != nil {\n    return fmt.Errorf(\"project dir not accessible: %w\", err)\n}","typeGuard":null,"tryCatchPattern":"ignored, err := GetPlandexIgnore(dir)\nif err != nil {\n    log.Warn(\"continuing without .plandexignore\", \"err\", err)\n    ignored = nil // proceed with empty ignore rules\n}","preventionTips":["Keep project directories readable/executable by the running user","Avoid symlink loops inside the project tree","Don't run the CLI from stale network mounts","Test in a fresh clone when Stat errors appear mysteriously"],"tags":["filesystem","permissions","stat-error"],"backgroundTag":"permission-denied","analyzedSha":"e2d772072efadbe41d2946d97d79be55532dbab5","analyzedAt":"2026-09-05T20:56:53.631Z","contentChangedAt":"2026-09-05T20:56:53.631Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}