Error when rescan devices

Hi Rainer,

we’ve seen this exact error pattern before — it’s a recurring issue between Checkmk and the werkzeug library, where a limit on the number of form parts in a single POST request gets exceeded. This typically happens on hosts with a large number of services (e.g. big switches, ESXi hosts, or SNMP devices with many OIDs).

One thing that might help as an immediate workaround: try raising the max_parts limit directly in the werkzeug library:

bash

vi /omd/sites/ukm/lib/python3.12/site-packages/werkzeug/sansio/multipart.py

Find this line:

python

if self.max_parts is not None and self._parts_decoded > self.max_parts:

and change the comparison value to something like 10000 instead of the default 1000.

:warning: Note: this will be overwritten on the next Checkmk update, so it’s a temporary fix only.

Before trying this though — a few questions that would help narrow things down:

  1. Is this error triggered on specific hosts only, or does it happen on every rescan across the board?
  2. Do you have Periodic Service Discovery enabled? If so, that could explain why the error floods web.log every second — something is repeatedly triggering the rescan automatically.
  3. How many services does the affected host approximately have? The more services, the larger the POST payload sent to ajax_service_discovery.py.
  4. Did you check whether a specific host type (e.g. SNMP device, ESXi, Windows agent) is involved, or is it mixed?

Knowing this would help confirm whether it’s purely a form-size issue or whether something else changed in p43 for your setup.

Sources: Werkzeug Docs – max_form_parts · werkzeug commit – limit multipart parts · Checkmk Werk #15939 · Checkmk Forum – same error

Greetz Bernd