Upgrade 2.1.0p25.cee to 2.2.0.cee breaks

CMK version:2.1.0p25
OS version:Debian 10 buster

Error message:Lots of error messages

I’ve duplicated the original OMD site as adviced in the docs, and getting these errors when typing omd stop testcloud && omd update testcloud

Any idea on its origin ?

-|  17/21 Update licensing folders or settings...
-| Rename folder /omd/sites/testcloud/var/check_mk/license_usage to /omd/sites/testcloud/var/check_mk/licensing
-| Upgrade license usage report
-| No such instance id; create new one.
-|  18/21 Transform spool files...
-|  19/21 Update backup config...
-|  20/21 Removing deprecated allocated_ports file...
-|  21/21 Update Agent Bakery...
-| Done (success)
OK
Updating core configuration...
Generating configuration for core (type cmc)...
Starting full compilation for all hosts Creating global helper config...OK
 Creating cmc protobuf configuration...Configuration Error: Error creating configuration: Traceback (most recent call last):
  File "/omd/sites/testcloud/lib/python3/cmk/base/cee/microcore_config.py", line 2136, in _hosts_worker
    hosts_data = _compute_worker_hosts_data(
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/omd/sites/testcloud/lib/python3/cmk/base/cee/microcore_config.py", line 2027, in _compute_worker_hosts_data
    return [
           ^
  File "/omd/sites/testcloud/lib/python3/cmk/base/cee/microcore_config.py", line 2028, in <listcomp>
    helper_config_manager.get_host_data(
  File "/omd/sites/testcloud/lib/python3/cmk/base/cee/microcore_config.py", line 2903, in get_host_data
    return self._compute_and_cache(host_class(hostname, stored_passwords))
                                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/omd/sites/testcloud/lib/python3/cmk/base/cee/microcore_config.py", line 1289, in __init__
    super().__init__(
  File "/omd/sites/testcloud/lib/python3/cmk/base/cee/microcore_config.py", line 1032, in __init__
    self._compute()
  File "/omd/sites/testcloud/lib/python3/cmk/base/cee/microcore_config.py", line 1312, in _compute
    self._info.services.extend(self._cmc_services())
                               ^^^^^^^^^^^^^^^^^^^^
  File "/omd/sites/testcloud/lib/python3/cmk/base/cee/microcore_config.py", line 1709, in _cmc_services
    for entry in self._config_cache.custom_checks(self._hostname):
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/omd/sites/testcloud/lib/python3/cmk/base/config.py", line 3355, in custom_checks
    return self.host_extra_conf(host_name, custom_checks)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/omd/sites/testcloud/lib/python3/cmk/base/config.py", line 4493, in host_extra_conf
    return list(
           ^^^^^
  File "/omd/sites/testcloud/lib/python3/cmk/utils/rulesets/ruleset_matcher.py", line 244, in get_host_ruleset_values
    self.tuple_transformer.transform_in_place(ruleset, is_service=False, is_binary=is_binary)
  File "/omd/sites/testcloud/lib/python3/cmk/utils/rulesets/ruleset_matcher.py", line 1069, in transform_in_place
    raise MKGeneralException(
cmk.utils.exceptions.MKGeneralException: ('rule', "Found old style tuple ruleset (({'service_description': 'Website ChefFiles', 'command_line': 'check_http -S -H cheffiles.jalios.net -u https://cheffiles.jalios.net/ --useragent=Nagios -t 30', 'has_perfdata': True}, [], ['cheffiles.jalios.net'])). Checkmk now expects dict rules. Please convert to new format, see werk 7352.\n The new ruleset format is \n{'condition': {'host_name': ['cheffiles.jalios.net']}, 'value': {'service_description': 'Website ChefFiles', 'command_line': 'check_http -S -H cheffiles.jalios.net -u https://cheffiles.jalios.net/ --useragent=Nagios -t 30', 'has_perfdata': True}}")

Traceback (most recent call last):
  File "/omd/sites/testcloud/lib/python3/cmk/base/cee/microcore_config.py", line 2136, in _hosts_worker
    hosts_data = _compute_worker_hosts_data(
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/omd/sites/testcloud/lib/python3/cmk/base/cee/microcore_config.py", line 2027, in _compute_worker_hosts_data
    return [
           ^
  File "/omd/sites/testcloud/lib/python3/cmk/base/cee/microcore_config.py", line 2028, in <listcomp>
    helper_config_manager.get_host_data(
  File "/omd/sites/testcloud/lib/python3/cmk/base/cee/microcore_config.py", line 2903, in get_host_data
    return self._compute_and_cache(host_class(hostname, stored_passwords))
                                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/omd/sites/testcloud/lib/python3/cmk/base/cee/microcore_config.py", line 1289, in __init__
    super().__init__(
  File "/omd/sites/testcloud/lib/python3/cmk/base/cee/microcore_config.py", line 1032, in __init__
    self._compute()
  File "/omd/sites/testcloud/lib/python3/cmk/base/cee/microcore_config.py", line 1312, in _compute
    self._info.services.extend(self._cmc_services())
                               ^^^^^^^^^^^^^^^^^^^^
  File "/omd/sites/testcloud/lib/python3/cmk/base/cee/microcore_config.py", line 1709, in _cmc_services
    for entry in self._config_cache.custom_checks(self._hostname):
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/omd/sites/testcloud/lib/python3/cmk/base/config.py", line 3355, in custom_checks
    return self.host_extra_conf(host_name, custom_checks)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/omd/sites/testcloud/lib/python3/cmk/base/config.py", line 4493, in host_extra_conf
    return list(
           ^^^^^
  File "/omd/sites/testcloud/lib/python3/cmk/utils/rulesets/ruleset_matcher.py", line 244, in get_host_ruleset_values
    self.tuple_transformer.transform_in_place(ruleset, is_service=False, is_binary=is_binary)
  File "/omd/sites/testcloud/lib/python3/cmk/utils/rulesets/ruleset_matcher.py", line 1069, in transform_in_place
    raise MKGeneralException(
cmk.utils.exceptions.MKGeneralException: ('rule', "Found old style tuple ruleset (({'service_description': 'Website ChefFiles', 'command_line': 'check_http -S -H cheffiles.jalios.net -u https://cheffiles.jalios.net/ --useragent=Nagios -t 30', 'has_perfdata': True}, [], ['cheffiles.jalios.net'])). Checkmk now expects dict rules. Please convert to new format, see werk 7352.\n The new ruleset format is \n{'condition': {'host_name': ['cheffiles.jalios.net']}, 'value': {'service_description': 'Website ChefFiles', 'command_line': 'check_http -S -H cheffiles.jalios.net -u https://cheffiles.jalios.net/ --useragent=Nagios -t 30', 'has_perfdata': True}}")

Traceback (most recent call last):
  File "/omd/sites/testcloud/lib/python3/cmk/base/cee/microcore_config.py", line 2136, in _hosts_worker
    hosts_data = _compute_worker_hosts_data(
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/omd/sites/testcloud/lib/python3/cmk/base/cee/microcore_config.py", line 2027, in _compute_worker_hosts_data
    return [
           ^
  File "/omd/sites/testcloud/lib/python3/cmk/base/cee/microcore_config.py", line 2028, in <listcomp>
    helper_config_manager.get_host_data(
  File "/omd/sites/testcloud/lib/python3/cmk/base/cee/microcore_config.py", line 2903, in get_host_data
    return self._compute_and_cache(host_class(hostname, stored_passwords))
                                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/omd/sites/testcloud/lib/python3/cmk/base/cee/microcore_config.py", line 1289, in __init__
    super().__init__(
  File "/omd/sites/testcloud/lib/python3/cmk/base/cee/microcore_config.py", line 1032, in __init__
    self._compute()
  File "/omd/sites/testcloud/lib/python3/cmk/base/cee/microcore_config.py", line 1312, in _compute
    self._info.services.extend(self._cmc_services())
                               ^^^^^^^^^^^^^^^^^^^^
  File "/omd/sites/testcloud/lib/python3/cmk/base/cee/microcore_config.py", line 1709, in _cmc_services
    for entry in self._config_cache.custom_checks(self._hostname):
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/omd/sites/testcloud/lib/python3/cmk/base/config.py", line 3355, in custom_checks
    return self.host_extra_conf(host_name, custom_checks)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/omd/sites/testcloud/lib/python3/cmk/base/config.py", line 4493, in host_extra_conf
    return list(
           ^^^^^
  File "/omd/sites/testcloud/lib/python3/cmk/utils/rulesets/ruleset_matcher.py", line 244, in get_host_ruleset_values
    self.tuple_transformer.transform_in_place(ruleset, is_service=False, is_binary=is_binary)
  File "/omd/sites/testcloud/lib/python3/cmk/utils/rulesets/ruleset_matcher.py", line 1069, in transform_in_place
    raise MKGeneralException(
cmk.utils.exceptions.MKGeneralException: ('rule', "Found old style tuple ruleset (({'service_description': 'Website ChefFiles', 'command_line': 'check_http -S -H cheffiles.jalios.net -u https://cheffiles.jalios.net/ --useragent=Nagios -t 30', 'has_perfdata': True}, [], ['cheffiles.jalios.net'])). Checkmk now expects dict rules. Please convert to new format, see werk 7352.\n The new ruleset format is \n{'condition': {'host_name': ['cheffiles.jalios.net']}, 'value': {'service_description': 'Website ChefFiles', 'command_line': 'check_http -S -H cheffiles.jalios.net -u https://cheffiles.jalios.net/ --useragent=Nagios -t 30', 'has_perfdata': True}}")

Traceback (most recent call last):
  File "/omd/sites/testcloud/lib/python3/cmk/base/cee/microcore_config.py", line 2136, in _hosts_worker
    hosts_data = _compute_worker_hosts_data(
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/omd/sites/testcloud/lib/python3/cmk/base/cee/microcore_config.py", line 2027, in _compute_worker_hosts_data
    return [
           ^
  File "/omd/sites/testcloud/lib/python3/cmk/base/cee/microcore_config.py", line 2028, in <listcomp>
    helper_config_manager.get_host_data(
  File "/omd/sites/testcloud/lib/python3/cmk/base/cee/microcore_config.py", line 2903, in get_host_data
    return self._compute_and_cache(host_class(hostname, stored_passwords))
                                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/omd/sites/testcloud/lib/python3/cmk/base/cee/microcore_config.py", line 1289, in __init__
    super().__init__(
  File "/omd/sites/testcloud/lib/python3/cmk/base/cee/microcore_config.py", line 1032, in __init__
    self._compute()
  File "/omd/sites/testcloud/lib/python3/cmk/base/cee/microcore_config.py", line 1312, in _compute
    self._info.services.extend(self._cmc_services())
                               ^^^^^^^^^^^^^^^^^^^^
  File "/omd/sites/testcloud/lib/python3/cmk/base/cee/microcore_config.py", line 1709, in _cmc_services
    for entry in self._config_cache.custom_checks(self._hostname):
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/omd/sites/testcloud/lib/python3/cmk/base/config.py", line 3355, in custom_checks
    return self.host_extra_conf(host_name, custom_checks)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/omd/sites/testcloud/lib/python3/cmk/base/config.py", line 4493, in host_extra_conf
    return list(
           ^^^^^
  File "/omd/sites/testcloud/lib/python3/cmk/utils/rulesets/ruleset_matcher.py", line 244, in get_host_ruleset_values
    self.tuple_transformer.transform_in_place(ruleset, is_service=False, is_binary=is_binary)
  File "/omd/sites/testcloud/lib/python3/cmk/utils/rulesets/ruleset_matcher.py", line 1069, in transform_in_place
    raise MKGeneralException(
cmk.utils.exceptions.MKGeneralException: ('rule', "Found old style tuple ruleset (({'service_description': 'Website ChefFiles', 'command_line': 'check_http -S -H cheffiles.jalios.net -u https://cheffiles.jalios.net/ --useragent=Nagios -t 30', 'has_perfdata': True}, [], ['cheffiles.jalios.net'])). Checkmk now expects dict rules. Please convert to new format, see werk 7352.\n The new ruleset format is \n{'condition': {'host_name': ['cheffiles.jalios.net']}, 'value': {'service_description': 'Website ChefFiles', 'command_line': 'check_http -S -H cheffiles.jalios.net -u https://cheffiles.jalios.net/ --useragent=Nagios -t 30', 'has_perfdata': True}}")

Traceback (most recent call last):
  File "/omd/sites/testcloud/lib/python3/cmk/base/cee/microcore_config.py", line 2136, in _hosts_worker
    hosts_data = _compute_worker_hosts_data(
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/omd/sites/testcloud/lib/python3/cmk/base/cee/microcore_config.py", line 2027, in _compute_worker_hosts_data
    return [
           ^
  File "/omd/sites/testcloud/lib/python3/cmk/base/cee/microcore_config.py", line 2028, in <listcomp>
    helper_config_manager.get_host_data(
  File "/omd/sites/testcloud/lib/python3/cmk/base/cee/microcore_config.py", line 2903, in get_host_data
    return self._compute_and_cache(host_class(hostname, stored_passwords))
                                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/omd/sites/testcloud/lib/python3/cmk/base/cee/microcore_config.py", line 1289, in __init__
    super().__init__(
  File "/omd/sites/testcloud/lib/python3/cmk/base/cee/microcore_config.py", line 1032, in __init__
    self._compute()
  File "/omd/sites/testcloud/lib/python3/cmk/base/cee/microcore_config.py", line 1312, in _compute
    self._info.services.extend(self._cmc_services())
                               ^^^^^^^^^^^^^^^^^^^^
  File "/omd/sites/testcloud/lib/python3/cmk/base/cee/microcore_config.py", line 1709, in _cmc_services
    for entry in self._config_cache.custom_checks(self._hostname):
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/omd/sites/testcloud/lib/python3/cmk/base/config.py", line 3355, in custom_checks
    return self.host_extra_conf(host_name, custom_checks)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/omd/sites/testcloud/lib/python3/cmk/base/config.py", line 4493, in host_extra_conf
    return list(
           ^^^^^
  File "/omd/sites/testcloud/lib/python3/cmk/utils/rulesets/ruleset_matcher.py", line 244, in get_host_ruleset_values
    self.tuple_transformer.transform_in_place(ruleset, is_service=False, is_binary=is_binary)
  File "/omd/sites/testcloud/lib/python3/cmk/utils/rulesets/ruleset_matcher.py", line 1069, in transform_in_place
    raise MKGeneralException(
cmk.utils.exceptions.MKGeneralException: ('rule', "Found old style tuple ruleset (({'service_description': 'Website ChefFiles', 'command_line': 'check_http -S -H cheffiles.jalios.net -u https://cheffiles.jalios.net/ --useragent=Nagios -t 30', 'has_perfdata': True}, [], ['cheffiles.jalios.net'])). Checkmk now expects dict rules. Please convert to new format, see werk 7352.\n The new ruleset format is \n{'condition': {'host_name': ['cheffiles.jalios.net']}, 'value': {'service_description': 'Website ChefFiles', 'command_line': 'check_http -S -H cheffiles.jalios.net -u https://cheffiles.jalios.net/ --useragent=Nagios -t 30', 'has_perfdata': True}}")

Traceback (most recent call last):
  File "/omd/sites/testcloud/lib/python3/cmk/base/cee/microcore_config.py", line 2136, in _hosts_worker
    hosts_data = _compute_worker_hosts_data(
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/omd/sites/testcloud/lib/python3/cmk/base/cee/microcore_config.py", line 2027, in _compute_worker_hosts_data
    return [
           ^
  File "/omd/sites/testcloud/lib/python3/cmk/base/cee/microcore_config.py", line 2028, in <listcomp>
    helper_config_manager.get_host_data(
  File "/omd/sites/testcloud/lib/python3/cmk/base/cee/microcore_config.py", line 2903, in get_host_data
    return self._compute_and_cache(host_class(hostname, stored_passwords))
                                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/omd/sites/testcloud/lib/python3/cmk/base/cee/microcore_config.py", line 1289, in __init__
    super().__init__(
  File "/omd/sites/testcloud/lib/python3/cmk/base/cee/microcore_config.py", line 1032, in __init__
    self._compute()
  File "/omd/sites/testcloud/lib/python3/cmk/base/cee/microcore_config.py", line 1312, in _compute
    self._info.services.extend(self._cmc_services())
                               ^^^^^^^^^^^^^^^^^^^^
  File "/omd/sites/testcloud/lib/python3/cmk/base/cee/microcore_config.py", line 1709, in _cmc_services
    for entry in self._config_cache.custom_checks(self._hostname):
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/omd/sites/testcloud/lib/python3/cmk/base/config.py", line 3355, in custom_checks
    return self.host_extra_conf(host_name, custom_checks)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/omd/sites/testcloud/lib/python3/cmk/base/config.py", line 4493, in host_extra_conf
    return list(
           ^^^^^
  File "/omd/sites/testcloud/lib/python3/cmk/utils/rulesets/ruleset_matcher.py", line 244, in get_host_ruleset_values
    self.tuple_transformer.transform_in_place(ruleset, is_service=False, is_binary=is_binary)
  File "/omd/sites/testcloud/lib/python3/cmk/utils/rulesets/ruleset_matcher.py", line 1069, in transform_in_place
    raise MKGeneralException(
cmk.utils.exceptions.MKGeneralException: ('rule', "Found old style tuple ruleset (({'service_description': 'Website ChefFiles', 'command_line': 'check_http -S -H cheffiles.jalios.net -u https://cheffiles.jalios.net/ --useragent=Nagios -t 30', 'has_perfdata': True}, [], ['cheffiles.jalios.net'])). Checkmk now expects dict rules. Please convert to new format, see werk 7352.\n The new ruleset format is \n{'condition': {'host_name': ['cheffiles.jalios.net']}, 'value': {'service_description': 'Website ChefFiles', 'command_line': 'check_http -S -H cheffiles.jalios.net -u https://cheffiles.jalios.net/ --useragent=Nagios -t 30', 'has_perfdata': True}}")

Could not update core configuration. Aborting.

Output of “cmk --debug -vvn hostname”: (If it is a problem with checks or plugins)

It looks like a old classic Nagios check. You have two options - remove this old check or recreate the rule and the system saves it in the wanted format.

1 Like

Hello @andreas-doehler and thanks for your answer.

I can’t find the new format for ‘custom_checks’ in the Werk 7352.

I’ve tried this, but it ends with an “invalid syntax” error :

custom_checks += [
{
  'condition': { 'host_name': 'xxx.test.net'}
  'value': 'all',
  'options':
  {
        'service_description': 'Statut Demo xxx',
        'command_line': 'check_http -S -H xxx.jaliosworkplace.com -u https://xxx.jaliosworkplace.com/plugins/SiteSettingsPlugin/front/loginRight.jsp',
        'has_perfdata': True
 }
},
]

I would not try to create this rule manually. It is better if you try to modify the rule inside the GUI before upgrade.

99% of the rules for our environments are automatically created via CHEF scripting. We need to know the new template used to be able to upgrade to the new version.

Your classic checks looks like this if created from inside WATO.

globals().setdefault("custom_checks", [])

custom_checks = [
    {
        "id": "448cf5ed-6a42-4b4a-b7fc-05d61a2740c1",
        "value": {
            "service_description": "Statut Demo xxx",
            "command_line": "$USER1$/check_http -S -H xxx.jaliosworkplace.com -u https://xxx.jaliosworkplace.com/plugins/SiteSettingsPlugin/front/loginRight.jsp",
            "command_name": "check_http",
            "has_perfdata": True,
        },
        "condition": {"host_name": ["xxx.test.net"]},
        "options": {"disabled": False, "docu_url": "omdadmin"},
    },
] + custom_checks

1 Like

Is there any way to generate an original ID, or could I use my own way ?

The id is a generic uuid. You can generate it with any function you have for uuid generation.
This id is used an important if you edit rules via API or web.

2 Likes