After Update from 2.1.0p30.cre to 2.2.0p5.cre: Activation failed: "too many values to unpack"

Hi there,
any help is appreciated

CMK version: 2.2.0p5.cre
OS version: Debian GNU/Linux 10 (buster)

Error message: An error occurred: Error creating configuration: too many values to unpack (expected 2)

Output of “cmk --debug -vvR”:

Trying to acquire lock on /omd/sites/sitename/etc/check_mk/main.mk
Got lock on /omd/sites/sitename/etc/check_mk/main.mk
Generating configuration for core (type nagios)...
Trying to acquire lock on /omd/sites/sitename/var/check_mk/core/helper_config/serial.mk
Got lock on /omd/sites/sitename/var/check_mk/core/helper_config/serial.mk
Releasing lock on /omd/sites/sitename/var/check_mk/core/helper_config/serial.mk
Released lock on /omd/sites/sitename/var/check_mk/core/helper_config/serial.mk
Trying to acquire lock on /omd/sites/sitename/var/check_mk/licensing/licensed_state
Got lock on /omd/sites/sitename/var/check_mk/licensing/licensed_state
Releasing lock on /omd/sites/sitename/var/check_mk/licensing/licensed_state
Released lock on /omd/sites/sitename/var/check_mk/licensing/licensed_state
Releasing lock on /omd/sites/sitename/etc/check_mk/main.mk
Released lock on /omd/sites/sitename/etc/check_mk/main.mk
Trying to acquire lock on /omd/sites/sitename/var/check_mk/crashes/base/0c0f28ce-1c19-11ee-aad2-c6549e47524c/crash.info
Got lock on /omd/sites/sitename/var/check_mk/crashes/base/0c0f28ce-1c19-11ee-aad2-c6549e47524c/crash.info
Releasing lock on /omd/sites/sitename/var/check_mk/crashes/base/0c0f28ce-1c19-11ee-aad2-c6549e47524c/crash.info
Released lock on /omd/sites/sitename/var/check_mk/crashes/base/0c0f28ce-1c19-11ee-aad2-c6549e47524c/crash.info
Traceback (most recent call last):
  File "/omd/sites/sitename/bin/cmk", line 112, in <module>
    exit_status = modes.call(mode_name, mode_args, opts, args)
                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/omd/sites/sitename/lib/python3/cmk/base/modes/__init__.py", line 68, in call
    return handler(*handler_args)
           ^^^^^^^^^^^^^^^^^^^^^^
  File "/omd/sites/sitename/lib/python3/cmk/base/modes/check_mk.py", line 1259, in mode_restart
    cmk.base.core.do_restart(
  File "/omd/sites/sitename/lib/python3/cmk/base/core.py", line 81, in do_restart
    core_config.do_create_config(
  File "/omd/sites/sitename/lib/python3/cmk/base/core_config.py", line 271, in do_create_config
    _create_core_config(
  File "/omd/sites/sitename/lib/python3/cmk/base/core_config.py", line 356, in _create_core_config
    core.create_config(config_path, config_cache, hosts_to_update=hosts_to_update)
  File "/omd/sites/sitename/lib/python3/cmk/base/core_config.py", line 79, in create_config
    self._create_config(config_path, config_cache, licensing_handler, hosts_to_update)
  File "/omd/sites/sitename/lib/python3/cmk/base/core_nagios.py", line 88, in _create_config
    self._create_core_config(config_path, licensing_handler)
  File "/omd/sites/sitename/lib/python3/cmk/base/core_nagios.py", line 106, in _create_core_config
    create_config(
  File "/omd/sites/sitename/lib/python3/cmk/base/core_nagios.py", line 198, in create_config
    all_host_labels[hostname] = _create_nagios_config_host(
                                ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/omd/sites/sitename/lib/python3/cmk/base/core_nagios.py", line 246, in _create_nagios_config_host
    service_labels=_create_nagios_servicedefs(
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/omd/sites/sitename/lib/python3/cmk/base/core_nagios.py", line 491, in _create_nagios_servicedefs
    for description, args in core_config.iter_active_check_services(
  File "/omd/sites/sitename/lib/python3/cmk/base/core_config.py", line 476, in iter_active_check_services
    active_info["argument_function"](params),
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/omd/sites/sitename/share/check_mk/checks/check_http", line 263, in check_http_arguments
    host = _host_from_params(params.get("host", {}))
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/omd/sites/sitename/share/check_mk/checks/check_http", line 113, in _host_from_params
    address_type, address = address_settings
    ^^^^^^^^^^^^^^^^^^^^^
ValueError: too many values to unpack (expected 2)

It looks like one of your hosts that has an http check assigned has a invalid configuration of IPs. Is is possible that one of your hosts checked with http check has more than one IP?

Yes, some hosts that have a http check assigned have more than one IPv6-address.
Perhaps a dump question:
Why is this an invalid configuration?
Or, in other words: Why can I assign multiple IP(v6)-addresses if this makes the configuration invalid if check_http is used?
:wink:
However:
I already rolled back the whole VM to a snapshot bevor the update.
I will remove the additional (v6) addresses, test the whole update procedure again and come back with the results.

Thank you for your help in between!

As promised i did a test on this and you where right.
After the removal of the 2nd and 3rd IPv6-adresses the update worked as expected.
For me this is the resolution but perhaps for others not.
Imho. it must be possible to assign multiple IP(v6)-adresses on a host even tough when check_http is in use.
Maybe the devs want to take a look at it?
:wink:

The problem is here that check_http can only handle a single IP (v4 or v6).
CMK now don’t know if you want to use the first or second address.
I think at the moment you can only insert an explicit address inside the check_http rule if you have a host with many addresses.

seems the behaviour of check_http has changed from 2.1 to 2.2.
however, to set a explicit address inside the check_http rule is a pretty good idea.
thank you for your support!

We found the problem during the migration to 2.2.
When updating to 2.2 the cmk-update-config will run. When an error occcurs during the script run, the active check rules will not migrated. Then the error with the “too many values to unpack” occurs.
The reason for this: The entry for address moved from string to a dictionary.
Best way to solve it is, to correct all errors in output of “cmk-update-congig --debug -vvv” and run it again. All Rules will be migrated than.

Regards, Christian