{"record":{"id":"1581eb253fb6b873","repo":"plandex-ai/plandex","slug":"error-reading-plandexignore-file-s","errorCode":null,"errorMessage":"error reading .plandexignore file: %s","messagePattern":"error reading \\.plandexignore file: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"app/cli/fs/paths.go","lineNumber":359,"sourceCode":"\treturn &types.ProjectPaths{\n\t\tActivePaths:    activePaths,\n\t\tAllPaths:       allPaths,\n\t\tActiveDirs:     activeDirs,\n\t\tAllDirs:        allDirs,\n\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}","sourceCodeStart":341,"sourceCodeEnd":377,"githubUrl":"https://github.com/plandex-ai/plandex/blob/e2d772072efadbe41d2946d97d79be55532dbab5/app/cli/fs/paths.go#L341-L377","documentation":"GetPlandexIgnore loads and compiles the .plandexignore file for a directory. If the file exists (os.Stat succeeds) but ignore.CompileIgnoreFile fails to parse it, this error wraps the underlying parse error and aborts path resolution in GetPaths.","triggerScenarios":"A .plandexignore file exists in the project directory but its contents cannot be parsed/compiled by the ignore library (malformed pattern syntax, unreadable permissions causing read failure during compile).","commonSituations":"Hand-edited .plandexignore with invalid glob syntax (e.g. unterminated bracket patterns); file with weird encoding or binary content; filesystem permission changes after the Stat succeeded.","solutions":["Fix the invalid pattern syntax in .plandexignore (check the wrapped err message for the offending line)","Temporarily rename/move .plandexignore to confirm it is the cause","Check file permissions and encoding (save as plain UTF-8 text)","If the wrapped error is transient I/O, re-run after resolving the filesystem issue"],"exampleFix":"// before (.plandexignore)\n!**/[unclosed\n// after\n!**/node_modules\n!**/dist","handlingStrategy":"validation","validationCode":"ignorePath := filepath.Join(dir, \".plandexignore\")\nif _, err := os.Stat(ignorePath); err == nil {\n    if data, rerr := os.ReadFile(ignorePath); rerr != nil {\n        return rerr\n    } else if err := validateIgnorePatterns(string(data)); err != nil {\n        return fmt.Errorf(\"invalid .plandexignore: %w\", err)\n    }\n}","typeGuard":null,"tryCatchPattern":"ignored, err := GetPlandexIgnore(dir)\nif err != nil {\n    var perr *fs.PathError\n    if errors.As(err, &perr) { /* handle I/O failure */ }\n    return fmt.Errorf(\"plandexignore unavailable: %w\", err)\n}","preventionTips":["Validate ignore patterns after every manual edit of .plandexignore","Keep the file plain UTF-8 text with no binary garbage","Commit a known-good .plandexignore so teammates don't hand-craft broken globs","Watch for ignore-library version changes that alter accepted syntax"],"tags":["filesystem","ignore-file","parse-error"],"backgroundTag":"ignore-file-parse-error","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"}