Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.


Info

This article describes how to fix the KeyError: 'cmk.influxdb' during the Update Checkmk 2.1.0 to Checkmk 2.2.0



Panel
borderColor#CCCCCC
bgColor#e3fcef

LAST TESTED ON CHECKMK 2.2.0p30



Panel
borderColorblack
bgColor#f8f8f8
titleTable of Contents

Table of Contents

Problem

During the Update to a Version Checkmk 2.2.0 the following error breaks the update process. In distributed monitoring this message appears on the master site. The same error can be thrown on upgraded remote sites while activate changes:

Code Block
languagebash
themeRDark
Updating core configuration...
Generating configuration for core (type cmc)...
Configuration Error: Error creating configuration: 'cmk.influxdb'
Could not update core configuration. Aborting.


The output from cmk debug command shows the following:

Code Block
languagebash
themeRDark
OMD[mysite]:~$ cmk --debug -vvU
Trying to acquire lock on /omd/sites/mysite/etc/check_mk/main.mk
Got lock on /omd/sites/mysite/etc/check_mk/main.mk
Generating configuration for core (type cmc)...
Trying to acquire lock on /omd/sites/mysite/var/check_mk/core/helper_config/serial.mk
Got lock on /omd/sites/mysite/var/check_mk/core/helper_config/serial.mk
Releasing lock on /omd/sites/mysite/var/check_mk/core/helper_config/serial.mk
Released lock on /omd/sites/mysite/var/check_mk/core/helper_config/serial.mk
Trying to acquire lock on /omd/sites/mysite/var/check_mk/licensing/licensed_state
Got lock on /omd/sites/mysite/var/check_mk/licensing/licensed_state
Releasing lock on /omd/sites/mysite/var/check_mk/licensing/licensed_state
Released lock on /omd/sites/mysite/var/check_mk/licensing/licensed_state

Releasing lock on /omd/sites/mysite/etc/check_mk/main.mk
Released lock on /omd/sites/mysite/etc/check_mk/main.mk
Configuration Error: 'cmk.influxdb'
Trying to acquire lock on /omd/sites/mysite/var/check_mk/crashes/base/cfd7aef2-4734-11ee-a2f4-90e2bae2d00c/crash.info
Got lock on /omd/sites/mysite/var/check_mk/crashes/base/cfd7aef2-4734-11ee-a2f4-90e2bae2d00c/crash.info
Releasing lock on /omd/sites/mysite/var/check_mk/crashes/base/cfd7aef2-4734-11ee-a2f4-90e2bae2d00c/crash.info
Released lock on /omd/sites/mysite/var/check_mk/crashes/base/cfd7aef2-4734-11ee-a2f4-90e2bae2d00c/crash.info
Traceback (most recent call last):
  File “/omd/sites/mysite/bin/cmk”, line 112, in <module>
    exit_status = modes.call(mode_name, mode_args, opts, args)
                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File “/omd/sites/mysite/lib/python3/cmk/base/modes/__init__.py”, line 68, in call
    return handler(*handler_args)
           ^^^^^^^^^^^^^^^^^^^^^^
  File “/omd/sites/mysite/lib/python3/cmk/base/modes/check_mk.py”, line 1218, in mode_update
    do_create_config(
  File “/omd/sites/mysite/lib/python3/cmk/base/core_config.py”, line 271, in do_create_config
    _create_core_config(
  File “/omd/sites/mysite/lib/python3/cmk/base/core_config.py”, line 359, in _create_core_config
    core.create_config(config_path, config_cache, hosts_to_update=hosts_to_update)
  File “/omd/sites/mysite/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/mysite/lib/python3/cmk/base/cee/microcore_config.py”, line 3215, in _create_config
    data = create_core_config(
           ^^^^^^^^^^^^^^^^^^^
  File “/omd/sites/mysite/lib/python3/cmk/base/cee/microcore_config.py”, line 3134, in create_core_config
    data[“globals”] = _serialize_config_globals(string_pool, serial)
                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File “/omd/sites/mysite/lib/python3/cmk/base/cee/microcore_config.py”, line 545, in _serialize_config_globals
    _fill_influx_db(gl, string_pool)
  File “/omd/sites/mysite/lib/python3/cmk/base/cee/microcore_config.py”, line 420, in _fill_influx_db
    influx_db.log_level = _to_log_level(base_config.cmc_log_levels["cmk.influxdb”])
                                        ~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^
KeyError: 'cmk.influxdb'


Solution

Issues could be resolved by resetting the logging of the core to factory settings for all sites.

  1. In “Setup -> General -> Distributed monitoring”  open the Site specific global settings

    Image showing the location of the Distributed monitoring icon



  2. Reset all settings in the “Logging of the core” section to factory setting, even they are set to Factory settings and Save. 

    Image showing the options of logging of core


  3. Activate the changes


  4. Repeat this for all sites, including the central site.


Warning

Not supported: It is also possible to change the values with CLI. 


Code Block
languagebash
themeRDark
vi ~/etc/check_mk/conf.d/wato/sitespecific.mk

# Set log levels to default.
# Add 'cmk.influxdb': 5, if not configured in sitespecific.mk

cmc_log_levels = {'cmk.alert': 5,
 'cmk.carbon': 5,
 'cmk.core': 5,
 'cmk.downtime': 5,
 'cmk.helper': 5,
 'cmk.influxdb': 5,
 'cmk.livestatus': 5,
 'cmk.notification': 5,
 'cmk.rrd': 5,
 'cmk.smartping': 5}


Filter by label
showLabelsfalse
max5
spacesKB
showSpacefalse
sortmodified
reversetrue
typepage
cqllabel in ( "kb-troubleshooting-article" , "influx" , "update" ) and type = "page" and space = "KB"
labelskb-how-to-article

Page Properties
hiddentrue


Related issues