Issue: "Activate Changes" Fails with 110s Timeout (After Upgrade to 2.4.0p21.cre)

I want to write topic/help on my application forum, Where i wanted to highlight activate changes get 110 timeout, event though there is only 1-2 modification is only going on this change.
Earlier i would to upload 1000+ host and it was functional perfect however from last couple of days i started to face this issue.

Further i tried to put the error and senario in AI chat and suggested changing config files.

  1. increase timeout on /opt/omd/sites/*/lib/python3/cmk/gui/http.py
  2. increase timeout on etc/apache/apache.conf
  3. added mod_proxy on etc/apache/apache.conf
  4. added beow mod_proxy block on /etc/apache2/conf-available/omd-timeout-override.conf

Override OMD proxy timeouts for long-running operations like “push changes”

ProxyPass http://127.0.0.1:5015/xxxxx retry=0 disablereuse=On timeout=600 Keepalive=On ProxyPassReverse http://127.0.0.1:5015/xxxxxx SetEnv proxy-sendcl 1 SetEnv proxy-sendchunks 1

From above 1-2-3 changes, timeout issue got fix, But now it started to get proxy error, Earlier timeout=600 use to work on old check-mk1.6 version but in current updated 2.4.0p21.cre i do not find “proxy-port.conf” so made new omd-timeout-override file and applied the changes but still getting proxy error. After multiple like 30-40 retry it get success

CMK version:OS version: 2.4.0p21.cre

Error message:

Started at: 23:42:33. Finished at: 23:44:38.
Got invalid data:
Internal automation error: Error running automation call restart: Your request timed out after 110 seconds. This issue may be related to a local configuration problem or a request which works with a too large number of objects. But if you think this issue is a bug, please send a crash report.
Traceback (most recent call last):
File “/omd/sites/site_name/lib/python3/cmk/gui/watolib/automations.py”, line 131, in check_mk_local_automation_serialized
result = executor.execute(command, args, stdin_data, auto_logger, timeout)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “/omd/sites/site_name/lib/python3/cmk/gui/watolib/automation_helper.py”, line 50, in execute
response = session.post(AUTOMATION_HELPER_ENDPOINT, json=payload)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “/omd/sites/site_name/lib/python3.12/site-packages/requests/sessions.py”, line 637, in post
return self.request(“POST”, url, data=data, json=json, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “/omd/sites/site_name/lib/python3.12/site-packages/requests/sessions.py”, line 589, in request
resp = self.send(prep, **send_kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “/omd/sites/site_name/lib/python3.12/site-packages/opentelemetry/instrumentation/requests/_init_.py”, line 333, in instrumented_send
raise exception.with_traceback(exception._traceback_)
File “/omd/sites/site_name/lib/python3.12/site-packages/opentelemetry/instrumentation/requests/_init_.py”, line 255, in instrumented_send
result = wrapped_send(
^^^^^^^^^^^^^
File “/omd/sites/site_name/lib/python3.12/site-packages/requests/sessions.py”, line 703, in send
r = adapter.send(request, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “/omd/sites/site_name/lib/python3.12/site-packages/requests/adapters.py”, line 667, in send
resp = conn.urlopen(
^^^^^^^^^^^^^
File “/omd/sites/site_name/lib/python3.12/site-packages/urllib3/connectionpool.py”, line 787, in urlopen
response = self._make_request(
^^^^^^^^^^^^^^^^^^^
File “/omd/sites/site_name/lib/python3.12/site-packages/urllib3/connectionpool.py”, line 534, in _make_request
response = conn.getresponse()
^^^^^^^^^^^^^^^^^^
File “/omd/sites/site_name/lib/python3.12/site-packages/urllib3/connection.py”, line 571, in getresponse
httplib_response = super().getresponse()
^^^^^^^^^^^^^^^^^^^^^
File “/omd/sites/site_name/lib/python3.12/http/client.py”, line 1430, in getresponse
response.begin()
File “/omd/sites/site_name/lib/python3.12/http/client.py”, line 331, in begin
version, status, reason = self._read_status()
^^^^^^^^^^^^^^^^^^^
File “/omd/sites/site_name/lib/python3.12/http/client.py”, line 292, in _read_status
line = str(self.fp.readline(_MAXLINE + 1), “iso-8859-1”)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “/omd/sites/site_name/lib/python3.12/socket.py”, line 720, in readinto
return self._sock.recv_into(b)
^^^^^^^^^^^^^^^^^^^^^^^
File “/omd/sites/site_name/lib/python3/cmk/gui/utils/timeout_manager.py”, line 36, in handle_request_timeout
raise RequestTimeout(
cmk.gui.exceptions.RequestTimeout: Your request timed out after 110 seconds. This issue may be related to a local configuration problem or a request which works with a too large number of objects. But if you think this issue is a bug, please send a crash report.

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File “/omd/sites/site_name/lib/python3/cmk/gui/wato/pages/automation.py”, line 271, in _execute_automation_command
response.set_data(repr(automation.execute(automation.get_request())))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “/omd/sites/site_name/lib/python3/cmk/gui/wato/pages/activate_changes.py”, line 1056, in execute
return activate_changes.execute_activate_changes(api_request)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “/omd/sites/site_name/lib/python3.12/contextlib.py”, line 81, in inner
return func(*args, **kwds)
^^^^^^^^^^^^^^^^^^^
File “/omd/sites/site_name/lib/python3/cmk/gui/watolib/activate_changes.py”, line 2525, in execute_activate_changes
warnings = get_config_domain(domain_request.name).activate(domain_request.settings)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “/omd/sites/site_name/lib/python3/cmk/gui/watolib/config_domains.py”, line 116, in activate
return {“restart”: restart, “reload”: reload}[active_config.wato_activation_method](
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “/omd/sites/site_name/lib/python3/cmk/gui/watolib/check_mk_automations.py”, line 347, in restart
_automation_serialized(“restart”, args=hosts_to_update),
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “/omd/sites/site_name/lib/python3/cmk/gui/watolib/check_mk_automations.py”, line 61, in _automation_serialized
cmdline, serialized_result = check_mk_local_automation_serialized(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “/omd/sites/site_name/lib/python3/cmk/gui/watolib/automations.py”, line 156, in check_mk_local_automation_serialized
raise MKAutomationException(msg)
cmk.gui.watolib.automations.MKAutomationException: Error running automation call restart: Your request timed out after 110 seconds. This issue may be related to a local configuration problem or a request which works with a too large number of objects. But if you think this issue is a bug, please send a crash report.

Before you change anything with the hard coded timeouts i would inspect how long a “cmk --debug -vvR” takes on the problematic site.
I had sometimes the problem that the generation and activation of the config hangs at one point and this leads to the timeout.

The 110 seconds timeout is hard coded inside the GUI code.

1 Like

Thanks Andreas,

I will test this as well.
Additionally i did one test by executed cmk -U it took around 7 min just for 1-2 device changes/addition, This seems odd.

$ time cmk -U
Generating configuration for core (type nagios)…
Precompiling host checks…OK
Validating Nagios configuration…OK

real 7m4.176s
user 2m6.151s
sys 0m7.264s

Do you have many DNS requests while activating the changes?

Please run the command Andreas posted as it will show more information.

You can do this “cmk -U” also with “–debug” and “-vvU” as switches to get a little bit more output where it hangs.

I have executed “cmk --debug -vvR” and there are around 13771 line of details recorded.
all mostly there are line :
changes which is pending are only 2 …

looking for any possible finetunning.
wc -l output_debug.out
13771 output_debug.out

+++++++++++++++++++
Got lock on /omd/sites/site_name/etc/check_mk/main.mk
Generating configuration for core (type nagios)…
Trying to acquire lock on /omd/sites/site_name/var/check_mk/passwords_merged
Got lock on /omd/sites/site_name/var/check_mk/passwords_merged
Releasing lock on /omd/sites/site_name/var/check_mk/passwords_merged
Released lock on /omd/sites/site_name/var/check_mk/passwords_merged
Trying to acquire lock on /omd/sites/site_name/var/check_mk/core/helper_config/serial.mk
Got lock on /omd/sites/site_name/var/check_mk/core/helper_config/serial.mk
Releasing lock on /omd/sites/site_name/var/check_mk/core/helper_config/serial.mk
Released lock on /omd/sites/site_name/var/check_mk/core/helper_config/serial.mk
Trying to acquire lock on /omd/sites/site_name/var/check_mk/licensing/licensed_state
Got lock on /omd/sites/site_name/var/check_mk/licensing/licensed_state
Releasing lock on /omd/sites/site_name/var/check_mk/licensing/licensed_state
Released lock on /omd/sites/site_name/var/check_mk/licensing/licensed_state
0 piggyback files for ‘xxxxxxxxx’.
0 piggyback files for ‘xxxxxxxxx’.
0 piggyback files for ‘xxxxxxxxx’.
0 piggyback files for ‘xxxxxxxxx’.
0 piggyback files for ‘xxxxxxxxx’.
0 piggyback files for ‘xxxxxxxxx’.
0 piggyback files for ‘xxxxxxxxx’.
0 piggyback files for ‘xxxxxxxxx’.
0 piggyback files for ‘xxxxxxxxx’.
0 piggyback files for ‘xxxxxxxxx’.
0 piggyback files for ‘xxxxxxxxx’.

MORE SUCH LINES

Releasing lock on /omd/sites/site_name/var/check_mk/core/helper_config/66/notify/host_config/xxxxxxxxxx
Released lock on /omd/sites/site_name/var/check_mk/core/helper_config/66/notify/host_config/xxxxxxxxxx
Trying to acquire lock on /omd/sites/site_name/var/check_mk/core/helper_config/66/notify/host_config/xxxxxxxxxx
Got lock on /omd/sites/site_name/var/check_mk/core/helper_config/66/notify/host_config/xxxxxxxxxx
Releasing lock on /omd/sites/site_name/var/check_mk/core/helper_config/66/notify/host_config/xxxxxxxxxx
Released lock on /omd/sites/site_name/var/check_mk/core/helper_config/66/notify/host_config/xxxxxxxxxx
Trying to acquire lock on /omd/sites/site_name/var/check_mk/core/helper_config/66/notify/host_config/xxxxxxxxxx

The number of pending changes has nothing to do with the time the config generation needs. 14k lines is not unusual in bigger systems. You said this need 7 minutes - is the whole process slow and you see slow output or does the generation stops at some point and then continues?

1 Like

It generates continuously without interruption..

But then it must be very slow???

System Configuration Overview

I am currently running my system on Ubuntu 24.04.2 LTS with the following specifications:

  • CPU: 16 Cores

  • Memory (RAM): 32 GB

  • Storage: 300 GB


Observation

I generally do not observe significant system load; however, I frequently receive cache-related alerts during memory monitoring.


Query

I would like to understand:

  • How critical is cache utilization when implementing system changes?

  • Is it practically possible for cache behavior to negatively impact website performance?

For reference, I am also attaching a snapshot of the current memory performance