plandex-ai/plandex · error
failed to check if %s is ignored: %v
Error message
failed to check if %s is ignored: %v
What it means
For input paths not found in paths.ActivePaths, MustLoadContext calls fs.IsIgnored to determine whether ignore rules exclude the file; this error means that ignore check failed for the specific path (the path is interpolated into the message). It aborts the load since ignore status can't be determined.
Source
Thrown at app/cli/lib/context_load.go:220
toLoadMapPaths = uncachedMapPaths
inputFilePaths = toLoadMapPaths
}
if len(inputFilePaths) > 0 {
baseDir := fs.GetBaseDirForFilePaths(inputFilePaths)
paths, err := fs.GetProjectPaths(baseDir)
if err != nil {
onErr(fmt.Errorf("failed to get project paths: %v", err))
}
if !params.ForceSkipIgnore {
var filteredPaths []string
for _, inputFilePath := range inputFilePaths {
if _, ok := paths.ActivePaths[inputFilePath]; !ok {
ignored, reason, err := fs.IsIgnored(paths, inputFilePath, baseDir)
if err != nil {
onErr(fmt.Errorf("failed to check if %s is ignored: %v", inputFilePath, err))
}
if ignored {
ignoredPaths[inputFilePath] = reason
}
} else {
filteredPaths = append(filteredPaths, inputFilePath)
}
}
inputFilePaths = filteredPaths
}
if params.NamesOnly {
// "params.NamesOnly" => we create directory-tree contexts (ContextDirectoryTreeType)
// Partial skipping of subpaths
for _, inputFilePath := range inputFilePaths {
composite := strings.Join([]string{string(shared.ContextDirectoryTreeType), inputFilePath}, "|")
if existsByComposite[composite] != nil {View on GitHub (pinned to e2d772072e)
Solutions
- Fix the malformed/unreadable .gitignore or .plandexignore entry implicated in the wrapped error
- Check file and directory permissions for the reported path
- Remove broken symlinks from the project
- Use --skip-ignore/-f to bypass ignore checking if rules are known-good
Example fix
// before
ignored, reason, err := fs.IsIgnored(paths, inputFilePath, baseDir)
if err != nil {
onErr(fmt.Errorf("failed to check if %s is ignored: %v", inputFilePath, err))
}
// after
ignored, reason, err := fs.IsIgnored(paths, inputFilePath, baseDir)
if err != nil {
fmt.Fprintf(os.Stderr, "warning: could not check ignore status for %s: %v; including anyway\n", inputFilePath, err)
ignored = false
} Defensive patterns
Strategy: fallback
Validate before calling
// pre-check that the ignore files readable in the base dir
for _, f := range []string{".gitignore", ".plandexignore"} {
p := filepath.Join(baseDir, f)
if _, err := os.Stat(p); err == nil {
if fh, err := os.Open(p); err != nil { return fmt.Errorf("%s unreadable: %w", p, err) } else { fh.Close() }
}
} Type guard
// Go: distinguish ignore-decision from failure
func isIgnoredSafe(paths *fs.ProjectPaths, path, baseDir string) (ignored bool, ok bool) {
ig, reason, err := fs.IsIgnored(paths, path, baseDir)
if err != nil { return false, false }
_ = reason
return ig, true
} Try / catch
// Go: warn-and-include on ignore-check failure
ignored, reason, err := fs.IsIgnored(paths, inputFilePath, baseDir)
if err != nil {
log.Printf("warning: ignore check failed for %s (%v); including file", inputFilePath, err)
filteredPaths = append(filteredPaths, inputFilePath)
continue
} Prevention
- Lint .gitignore/.plandexignore for syntax errors after edits
- Remove symlinks pointing to inaccessible targets
- Keep ignore files world-readable within the project
- Use --skip-ignore only when rules are known-good
When it happens
Trigger: fs.IsIgnored(paths, inputFilePath, baseDir) returns an error — typically an unreadable or malformed ignore file (.gitignore/.plandexignore) referenced while evaluating the path, or a path/stat error on the file.
Common situations: Corrupt or syntactically broken .gitignore lines; ignore file without read permission; loading a path inside a directory the user can't read; symlinks pointing to inaccessible targets.
Related errors
- failed to get project paths: %v
- error getting parent project ids with paths: %v
- error getting child project ids with paths: %v
- file does not exist: %s
- no project root found
AI-assisted analysis of plandex-ai/plandex@e2d772072e (2026-09-05).
Data as JSON: /api/errors/be5fe280391d15ca.
Report an issue: GitHub.