Werk #22644: Process discovery: reject replacements without regular expression groups
| Component | Checks & agents | ||||
| Title | Process discovery: reject replacements without regular expression groups | ||||
| Date | Oct 15, 2026 | ||||
| Level | Trivial Change | ||||
| Class | Bug Fix | ||||
| Compatibility | Compatible - no manual interaction needed | ||||
| Checkmk versions & editions |
|
A rule in Process discovery or Process discovery (only SNMP) could
use %s or %1, %2, … in the process name while its process matching
was an exact name or path, Match all processes, or a regular expression
with fewer groups than replacements. Saving such a rule was accepted, but
the service discovery of every host it applied to then crashed with
ValueError: Invalid entry in inventory_processes_rules: service name '%s'
contains 1 replaceable elements, but regular expression None contains only
0 subexpression(s).
Such rules are now rejected when they are saved, with a message explaining that the process matching needs a regular expression with enough groups.
Existing rules are not changed. If you see this crash, find the process
discovery rule whose process name and pattern appear in the message and
either match the process with a regular expression containing one group
per replacement, e.g. ~.*(myproc.*), or remove the replacements from
the process name.