Update to CMK 2.5 fails: Update aborted with Error: 'credentials'

CMK version: 2.4.0p30 Pro
OS version: Debian 13 Trixie

Error message: Update aborted with Error: ‘credentials’.

Hi,

i get the following error when trying to update from 2.4.0p30 to 2.5.0p6

-|  02/11 Rulesets...
-| Traceback (most recent call last):
-|   File "/omd/sites/cmk2test/lib/python3/cmk/update_config/main.py", line 101, in main_check_config
-|     check_config(logger, conflict)
-|     ~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^
-|   File "/omd/sites/cmk2test/lib/python3/cmk/update_config/main.py", line 244, in check_config
-|     pre_action(logger, conflict_mode)
-|     ~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^
-|   File "/omd/sites/cmk2test/lib/python3/cmk/update_config/plugins/pre_actions/rulesets.py", line 60, in __call__
-|     result = _validate_rule_values(
-|         rulesets,
-|     ...<2 lines>...
-|         logger,
-|     )
-|   File "/omd/sites/cmk2test/lib/python3/cmk/update_config/plugins/pre_actions/rulesets.py", line 188, in _validate_rule_values
-|     validation_errors = visitor.validate(RawDiskData(rule.value))
-|   File "/omd/sites/cmk2test/lib/python3/cmk/gui/form_specs/visitors/_base.py", line 54, in validate
-|     if nested_validations := self._validate(parsed_value):
-|                              ~~~~~~~~~~~~~~^^^^^^^^^^^^^^
-|   File "/omd/sites/cmk2test/lib/python3/cmk/gui/form_specs/visitors/transform.py", line 65, in _validate
-|     ).validate(parsed_value)
-|       ~~~~~~~~^^^^^^^^^^^^^^
-|   File "/omd/sites/cmk2test/lib/python3/cmk/gui/form_specs/visitors/_base.py", line 54, in validate
-|     if nested_validations := self._validate(parsed_value):
-|                              ~~~~~~~~~~~~~~^^^^^^^^^^^^^^
-|   File "/omd/sites/cmk2test/lib/python3/cmk/gui/form_specs/visitors/dictionary.py", line 198, in _validate
-|     for validation in element_visitor.validate(parsed_value[key_name]):
-|                       ~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^
-|   File "/omd/sites/cmk2test/lib/python3/cmk/gui/form_specs/visitors/_base.py", line 45, in validate
-|     self._migrate_disk_value(raw_value)
-|     ~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^
-|   File "/omd/sites/cmk2test/lib/python3/cmk/gui/form_specs/visitors/_base.py", line 81, in _migrate_disk_value
-|     return RawDiskData(value=self.form_spec.migrate(value.value))
-|                              ~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^
-|   File "/omd/sites/cmk2test/lib/python3/cmk/plugins/checkmk/rulesets/cmk_update_agent.py", line 76, in _migrate_proxy_old_format
-|     protocol, credentials = _parse_proxy_protocol(proxy_config)
-|                             ~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^
-|   File "/omd/sites/cmk2test/lib/python3/cmk/plugins/checkmk/rulesets/cmk_update_agent.py", line 103, in _parse_proxy_protocol
-|     return "http", credentials["credentials"]
-|                    ~~~~~~~~~~~^^^^^^^^^^^^^^^
-| KeyError: 'credentials'
-|
-| Update aborted with Error: 'credentials'.
-| The update can be retried after the error has been fixed.

From what i understand i guess it has something to do with the proxy settings and the agent_updater rules. I tried removing the proxy settings from there (temporarely) but it still fails with the exact same error.

This is the proxy section from the GUI

As you can see, “credentials” are not used here.

I can bypass this problem by removing the proxy line from the rules.mk files.

So for example

‘proxy’: {‘server’: ‘myproxy.domain.at’, ‘port’: 8888, ‘proxy_protocol’: (‘http’, {})},

I asked an AI for help and it seems the problem is within cmk_update_agent.py because it uses

return "http", credentials["credentials"]

instead of

return "http", credentials.get("credentials")

I guess i hit a bug here. Now i could remove it from every rules.mk file and run the update but… maybe this can be fixed in code?

Thanks and best regards
Mike