stamparm/maltrail · error
unable to compile the combined wildcard-trail regex
Error message
unable to compile the combined wildcard-trail regex ({e}); wildcard trail matching is disabled What it means
The combined regular expression built from all wildcard-trail patterns failed to compile. As a safety measure the sensor disables wildcard trail matching entirely rather than crashing, so trails whose matching depends on this regex engine will not fire until the problem is fixed.
Solutions
- Read the wrapped {e} — it names the regex compile problem (syntax or size/complexity limit) to locate the offending trail pattern.
- Bisect the wildcard trail set (remove recent trail additions) until the combined regex compiles, then fix or remove the offending trail.
- Reduce wildcard trail complexity (anchor trails, avoid nested/excessive wildcards) to stay under the engine's limits.
- Note the operational impact: wildcard trail matching stays disabled until a successful rebuild, so monitor for this log line after every trail update.
Defensive patterns
Strategy: validation
Validate before calling
# validate trail patterns before deploying them # compile the combined wildcard-trail regex offline and fail the deploy on error python3 -c "import re,sys; re.compile(open(sys.argv[1]).read())" wildcard_trails.txt || echo "combined regex invalid"
Prevention
- Test the combined wildcard-trail regex in CI before shipping trail updates
- Bound wildcard trail complexity; avoid deeply nested or unbounded wildcards
- Bisect trail additions when this error appears to find the offending pattern
- Monitor for the log line after each trail update — matching stays disabled until a successful rebuild
When it happens
Trigger: build() calls pyre::build_fancy(&self.source) with the aggregated wildcard-trail pattern and gets Err(e) — usually a pattern that exceeds the backtracking engine's limits or a construct it cannot handle after combination.
Common situations: A newly deployed trail set contains a wildcard pattern that produces an over-large or invalid combined regex; regex size/complexity limits exceeded by growing trail counts; an upstream trail feed shipping a pathological pattern.
Related errors
- invalid configuration value for 'REMOTE_SEVERITY_REGEX
- lookahead should match
- SUSPICIOUS_HTTP_REQUEST_REGEXES must carry a 'code…
- forwarded-for regex
- trail reload REJECTED
AI-assisted analysis of stamparm/maltrail@77cfb06d76 (2026-09-13).
Data as JSON: /api/errors/6bfc14e2682571d9.
Report an issue: GitHub.
Appendix: source
Thrown at sensor/src/trails/regexset.rs:267
self.source.push_str(&format!("(?P<g{}>{})", self.patterns.len(), compiled));
self.patterns.push(trail.to_string());
}
pub fn build(self) -> TrailRegex {
let mut fancy = false;
let regex = if self.source.is_empty() {
None
} else {
let fast = if self.needs_fancy { None } else { pyre::build(&self.source).ok() };
match fast {
Some(re) => Some(Engine::Fast(re)),
None => match pyre::build_fancy(&self.source) {
Ok(re) => {
fancy = true;
Some(Engine::Backtracking(re))
}
Err(e) => {
crate::output::log_error(
&format!(
"unable to compile the combined wildcard-trail regex ({e}); \
wildcard trail matching is disabled"
),
true,
);
None
}
},
}
};
TrailRegex {
regex,
patterns: self.patterns,
source: self.source,
skipped: self.skipped,
repaired: self.repaired,
fancy,View on GitHub (pinned to 77cfb06d76)