crowdsecurity/crowdsec · error
no matching files for pattern
Error message
no matching files for pattern %s
What it means
ConfigureByDSN expands the file glob of the file:// DSN and requires at least one match. It fires when filepath.Glob returns no files for the pattern (typo, wrong path, files not yet present), aborting acquisition setup.
Solutions
- Fix the glob pattern in the DSN to match existing files
- Verify the path relative to the crowdsec working directory
- Create the log files, or use a pattern matching rotated files too (e.g. /var/log/myapp.log*)
Defensive patterns
Strategy: validation
When it happens
Trigger: Thrown at pkg/acquisition/modules/file/config.go:215 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of crowdsecurity/crowdsec@909b515798 (2026-09-06).
Data as JSON: /api/errors/ce70aa428e3e9a77.
Report an issue: GitHub.
Appendix: source
Thrown at pkg/acquisition/modules/file/config.go:215
default:
return fmt.Errorf("unknown parameter %s", key)
}
}
}
s.config.Labels = labels
s.config.Mode = configuration.CAT_MODE
s.config.UniqueId = uuid
s.logger.Debugf("Will try pattern %s", args[0])
files, err := filepath.Glob(args[0])
if err != nil {
return fmt.Errorf("glob failure: %w", err)
}
if len(files) == 0 {
return fmt.Errorf("no matching files for pattern %s", args[0])
}
if len(files) > 1 {
s.logger.Infof("Will read %d files", len(files))
}
for _, file := range files {
s.logger.Infof("Adding file %s to filelist", file)
s.files = append(s.files, file)
}
return nil
}
View on GitHub (pinned to 909b515798)