Site crash after creating customized All Services view

CMK version: 2.3.0p30.cee
OS version: Debian 11

Issue:
I created a copy of the built-in ‘allservices’ to filter results showing only the services for which I was developing a plugin family. I left the name and ID the same to override the default view. I used the service’s regex filter with a valid regular expression pattern. As soon as I saved this, the UI broke, and I got a crash report.

I ended up creating a new LXC container so I could keep the broken site, but get back to developing. I made the same view change on the new instance of my dev site, and it worked just fine; same OS, same site version and edition.

I am not sure if this is a bug, but it seems like a spot for improvement. The fact that this issue broke the entire UI is a problem. If this happened in a production environment, it’d be a significant issue.

At the end of the below traceback, there is a base64 encoded filepath that it is looking for: {'self': PosixPath('/omd/sites/vscode_ide/local/lib/check_mk/gui/plugins/views')}

That path is missing within my site as indicated by the “File not found” issue:

OMD[vscode_ide]:~/local/lib$ ls -lash
total 12K
8.5K drwxr-x--- 6 vscode_ide vscode_ide  7 Nov 14 08:58 ./
 512 drwxr-x--- 5 vscode_ide vscode_ide  5 Jan  7 10:02 ../
 512 drwxr-x--- 2 vscode_ide vscode_ide  2 Nov 14 08:58 apache/
 512 lrwxrwxrwx 1 vscode_ide vscode_ide 11 Nov 14 08:58 check_mk -> python3/cmk
 512 drwxr-x--- 3 vscode_ide vscode_ide  3 Nov 14 08:58 nagios/
 512 drwxr-x--- 2 vscode_ide vscode_ide  2 Nov 14 08:58 python/
 512 drwxr-x--- 3 vscode_ide vscode_ide  3 Apr 21 10:12 python3/
OMD[vscode_ide]:~/local/lib$ ls -1 python3/
cmk_addons/
OMD[vscode_ide]:~/local/lib$

Error message:

{
    "core": "cmc",
    "crash_type": "gui",
    "details": {
        "is_mobile": false,
        "is_ssl_request": false,
        "language": "en",
        "page": "index.py",
        "referer": "http:\/\/172.16.230.103\/vscode_ide\/check_mk\/login.py",
        "request_method": "GET",
        "user_agent": "Mozilla\/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit\/537.36 (KHTML, like Gecko) Chrome\/135.0.0.0 Safari\/537.36",
        "username": "cmkadmin",
        "vars": {}
    },
    "edition": "cee",
    "exc_traceback": [
        [
            "\/omd\/sites\/vscode_ide\/lib\/python3\/cmk\/gui\/wsgi\/applications\/checkmk.py",
            188,
            "_process_request",
            "resp = page_handler()"
        ],
        [
            "\/omd\/sites\/vscode_ide\/lib\/python3\/cmk\/gui\/wsgi\/applications\/utils.py",
            113,
            "_call_auth",
            "func()"
        ],
        [
            "\/omd\/sites\/vscode_ide\/lib\/python3\/cmk\/gui\/pages.py",
            187,
            "wrapper",
            "return hc().handle_page()"
        ],
        [
            "\/omd\/sites\/vscode_ide\/lib\/python3\/cmk\/gui\/pages.py",
            51,
            "handle_page",
            "self.page()"
        ],
        [
            "\/omd\/sites\/vscode_ide\/lib\/python3\/cmk\/gui\/pages.py",
            146,
            "<lambda>",
            "\"page\": lambda self: self._wrapped_callable[0](),"
        ],
        [
            "\/omd\/sites\/vscode_ide\/lib\/python3\/cmk\/gui\/main.py",
            33,
            "page_index",
            "SidebarRenderer().show(title, content)"
        ],
        [
            "\/omd\/sites\/vscode_ide\/lib\/python3\/cmk\/gui\/sidebar\/__init__.py",
            383,
            "show",
            "self._show_sidebar()"
        ],
        [
            "\/omd\/sites\/vscode_ide\/lib\/python3\/cmk\/gui\/sidebar\/__init__.py",
            417,
            "_show_sidebar",
            "self._show_sidebar_head()"
        ],
        [
            "\/omd\/sites\/vscode_ide\/lib\/python3\/cmk\/gui\/sidebar\/__init__.py",
            627,
            "_show_sidebar_head",
            "MainMenuRenderer().show()"
        ],
        [
            "\/omd\/sites\/vscode_ide\/lib\/python3\/cmk\/gui\/sidebar\/main_menu.py",
            41,
            "show",
            "self._show_main_menu_content()"
        ],
        [
            "\/omd\/sites\/vscode_ide\/lib\/python3\/cmk\/gui\/sidebar\/main_menu.py",
            45,
            "_show_main_menu_content",
            "for menu_item in self._get_main_menu_items():"
        ],
        [
            "\/omd\/sites\/vscode_ide\/lib\/python3\/cmk\/gui\/sidebar\/main_menu.py",
            85,
            "_get_main_menu_items",
            "if not menu.topics():"
        ],
        [
            "\/omd\/sites\/vscode_ide\/lib\/python3\/cmk\/gui\/sidebar\/_snapin\/_views.py",
            163,
            "<lambda>",
            "topics=lambda: view_menu_topics(include_reports=True),"
        ],
        [
            "\/omd\/sites\/vscode_ide\/lib\/python3\/cmk\/gui\/sidebar\/_snapin\/_views.py",
            61,
            "view_menu_topics",
            "return make_topic_menu(view_menu_items(include_reports))"
        ],
        [
            "\/omd\/sites\/vscode_ide\/lib\/python3\/cmk\/gui\/sidebar\/_snapin\/_views.py",
            85,
            "view_menu_items",
            "for name, view in get_permitted_views().items()"
        ],
        [
            "\/omd\/sites\/vscode_ide\/lib\/python3\/cmk\/gui\/views\/store.py",
            87,
            "get_permitted_views",
            "return ViewStore.get_instance().permitted"
        ],
        [
            "\/omd\/sites\/vscode_ide\/lib\/python3\/cmk\/gui\/views\/store.py",
            57,
            "get_instance",
            "return cls()"
        ],
        [
            "\/omd\/sites\/vscode_ide\/lib\/python3\/cmk\/gui\/views\/store.py",
            60,
            "__init__",
            "self.all: Final = ViewStore._load_all_views()"
        ],
        [
            "\/omd\/sites\/vscode_ide\/lib\/python3\/cmk\/gui\/views\/store.py",
            68,
            "_load_all_views",
            "for k, v in visuals.load("
        ],
        [
            "\/omd\/sites\/vscode_ide\/lib\/python3\/cmk\/gui\/visuals\/_store.py",
            95,
            "load",
            "_CombinedVisualsCache[TVisual](what).load("
        ],
        [
            "\/omd\/sites\/vscode_ide\/lib\/python3\/cmk\/gui\/visuals\/_store.py",
            161,
            "load",
            "return self._compute_and_write_cache(internal_to_runtime_transformer)"
        ],
        [
            "\/omd\/sites\/vscode_ide\/lib\/python3\/cmk\/gui\/visuals\/_store.py",
            191,
            "_compute_and_write_cache",
            "visuals = _load_custom_user_visuals(self._visual_type, internal_to_runtime_transformer)"
        ],
        [
            "\/omd\/sites\/vscode_ide\/lib\/python3\/cmk\/gui\/visuals\/_store.py",
            255,
            "_load_custom_user_visuals",
            "_get_packaged_visuals("
        ],
        [
            "\/omd\/sites\/vscode_ide\/lib\/python3\/cmk\/gui\/visuals\/_store.py",
            295,
            "_get_packaged_visuals",
            "for dirpath in local_path.iterdir():"
        ],
        [
            "\/omd\/sites\/vscode_ide\/lib\/python3.12\/pathlib.py",
            1056,
            "iterdir",
            "for name in os.listdir(self):"
        ]
    ],
    "exc_type": "FileNotFoundError",
    "exc_value": "(2, 'No such file or directory')",
    "id": "245a4b5c-2045-11f0-8c4f-bc24110822f4",
    "local_vars": "eydzZWxmJzogUG9zaXhQYXRoKCcvb21kL3NpdGVzL3ZzY29kZV9pZGUvbG9jYWwvbGliL2NoZWNrX21rL2d1aS9wbHVnaW5zL3ZpZXdzJyl9",
    "os": "Debian GNU\/Linux 11 (bullseye)",
    "python_paths": [
        "\/omd\/sites\/vscode_ide\/local\/lib\/python3",
        "\/omd\/sites\/vscode_ide\/lib\/python3\/cloud",
        "\/omd\/sites\/vscode_ide\/lib\/python312.zip",
        "\/omd\/sites\/vscode_ide\/lib\/python3.12",
        "\/omd\/sites\/vscode_ide\/lib\/python3.12\/lib-dynload",
        "\/omd\/sites\/vscode_ide\/lib\/python3.12\/site-packages",
        "\/omd\/sites\/vscode_ide\/lib\/python3"
    ],
    "python_version": "3.12.3 (main, Mar 18 2025, 02:40:08) [GCC 13.2.0]",
    "time": 1745414178.3199127,
    "version": "2.3.0p30"
}

I am not sure I can provide a copy of the site for testing. It contains information protected by NDA and other legal protections. I’m happy to work on getting data or other items if desired. I just need to make sure sensitive data is not sent.

That is strange. It looks like a broken dev container/site. In my dev environment there are the folders available under “~/local/lib/python3/cmk/”.

You are right. I am not sure how these folders got removed. I was able to recover the site after doing the following:

mkdir python3/cmk/gui
mkdir python3/cmk/gui/plugins
mkdir python3/cmk/gui/plugins/views
mkdir python3/cmk/gui/plugins/dashboard
mkdir python3/cmk/gui/plugins/reports

I looked through my bash history. I do use
find ~/local/lib/python3/cmk_addons/plugins/* -type d -empty -delete
to help keep my plugins folder tree clean, but nothing high enough up that it should have removed those folders.

Thank you for triggering that thought. This indeed does look like a self-created issue, but not sure how I did it. It might be good for the site on restart to check for required folders, but that could get to be a really large task so I understand if it wouldn’t be implemented.

Maybe it’s a nice feature to suggest for Setup > Maintenance (if your site hasn’t crashed yet), and/or as external tool, to be able to Verify files and folders.