After update to 2.1: Unexpected configuration of context variable, site not accessible anymore

Dear all,
I recently updated from 2.0.0p21.cre to 2.1.0p5.cre but it ended up with an error:

-|  10/25 Migrate pagetype topics...
-|  + "Migrate pagetype topics" failed
-| Traceback (most recent call last):
-|   File "/omd/sites/bnitm/lib/python3/cmk/update_config.py", line 239, in run
-|     step_func()
-|   File "/omd/sites/bnitm/lib/python3/cmk/update_config.py", line 1001, in _migrate_pagetype_topics_to_ids
-|     topic_created_for.update(self._migrate_all_visuals_topics(topics))
-|   File "/omd/sites/bnitm/lib/python3/cmk/update_config.py", line 1071, in _migrate_all_visuals_topics
-|     topics, visual_type="dashboards", all_visuals=get_all_dashboards()
-|   File "/omd/sites/bnitm/lib/python3/cmk/gui/plugins/dashboard/utils.py", line 831, in get_all_dashboards
-|     return DashboardStore.get_instance().all
-|   File "/omd/sites/bnitm/lib/python3/cmk/gui/plugins/dashboard/utils.py", line 808, in get_instance
-|     return cls()
-|   File "/omd/sites/bnitm/lib/python3/cmk/gui/plugins/dashboard/utils.py", line 811, in __init__
-|     self.all = self._load_all()
-|   File "/omd/sites/bnitm/lib/python3/cmk/gui/plugins/dashboard/utils.py", line 817, in _load_all
-|     return _transform_dashboards(visuals.load("dashboards", builtin_dashboards))
-|   File "/omd/sites/bnitm/lib/python3/cmk/gui/plugins/dashboard/utils.py", line 853, in _transform_dashboards
-|     visuals.transform_old_visual(dashlet)
-|   File "/omd/sites/bnitm/lib/python3/cmk/gui/visuals.py", line 330, in transform_old_visual
-|     visual["context"] = cleanup_context_filters(visual["context"], visual["single_infos"])
-|   File "/omd/sites/bnitm/lib/python3/cmk/gui/visuals.py", line 401, in cleanup_context_filters
-|     return dict(new_context_vars)
-|   File "/omd/sites/bnitm/lib/python3/cmk/gui/visuals.py", line 364, in unsingle
-|     raise MKGeneralException(
-| cmk.utils.exceptions.MKGeneralException: Unexpected configuration of context variable: Filter 'host' with value 'smb1.hs2.bnitm.de'

Afterwards, I couldn’t access the site by web browser anymore due to the same error message “Unexpected configuration of context variable: Filter ‘host’ with value ‘smb1.hs2.bnitm.de’”.

Is there a way to delete this host manually (by editing the hosts.mk file or sth?) to get the site up and running again? I tried it by using the web api but it seams that I don’t have any user that is allowed for automated actions.

CMK version: 2.1.0p5.cre
OS version: Debian 11.3

Error message: Unexpected configuration of context variable: Filter ‘host’ with value ‘smb1.hs2.bnitm.de’

Thanks a lot in advance
Markus

Hi.
looks like taht the filter definition is set in a custom view or dashborad. You can try to delete the effectet object find in

~/var/check_mk/web/<user>/user_<views|dashboards>.mk

or modify the filter within this files find by key “context”.
I hope it helps.

RG, Christian

2 Likes

Thanks a lot Christian, that solved my issue.

if you have many users how do you determine where to remove it?

I have practically the same question as @jstallsmith . Appearently some user has some dashboard or view with a filter, but I seem to be unable to find it. I found one mention of the host in a file in one of the users folders under ~/var/check_mk/web/, however, removing that entry, didn’t solve the issue.

Luckily I did a test upgrade on a site copy, so I can browse on the original site through the dashboards and views in the browser. However, I can’t find any of those that has a literal filter for that host.

So I’m a bit stuck now…

I’m having the same issue here.
Filter ‘host’ with value…

I have deleted customs views and dashboards to no avail. How do I find those or can I just delete all those files?

I ran into the same error.

The solution from christian did not help me here.

What did help me was to delete some suspect directories within this path:

/omd/sites/SITE_ID/var/check_mk/web/

At first I wiped the whole contents there. Then my cmk Instance was disconnected. After that I deleted some user directories selctively and that worked.