search_log
Find the root cause of a build failure by searching the log for error signatures or a regex, returning matches with context. Use when tail only shows the symptom.
Instructions
Find the failure in a build log: grep it and return each hit with context.
START HERE when investigating a failed build — do not read tails first.
In a parallel make -j log the real compile error sits hundreds of lines
above the end, so the tail shows only make: *** Error 2: the symptom, not
the cause. This finds the cause in one call.
pattern is a Python regex; omit it to use the built-in build-failure
signatures (compiler/link errors, failed patch hunks, unresolved
BuildRequires, RPM packaging errors, %check failures, OOM/network trouble).
Matched lines are prefixed >>> and every line is numbered, so a hit's
number can be fed straight to read_log_range to see more.
Only the first max_matches hits are reported — the first error is the root
cause and the rest are cascades — but the header counts all of them. Lines
are clipped to max_line_chars around the match (0 = verbatim, needed when
quoting an exact multi-KB command line). The log is downloaded
automatically if not already on disk.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| after | No | ||
| before | No | ||
| pattern | No | ||
| build_id | Yes | ||
| filename | Yes | ||
| max_chars | No | ||
| max_matches | No | ||
| max_line_chars | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |