{"record":{"id":"621d1b31fb0602a5","repo":"xai-org/x-algorithm","slug":"config-module-mod-name-r-has-no-key-ver-r-ava","errorCode":null,"errorMessage":"Config module {mod_name!r} has no key {ver!r}. Available keys: {avail}","messagePattern":"Config module (.+?) has no key (.+?)\\. Available keys: (.+?)","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"phoenix/python/common/xai-configlib/src/xai_configlib/__init__.py","lineNumber":597,"sourceCode":"\n    mod_name, ver = parts\n    try:\n        mod = get_module(f\"{base_module_name}.{mod_name}\")\n    except ModuleNotFoundError as e:\n        if on_failure_log_additional_info:\n            discovered_configs = get_all_configs_from_module(\n                base_module_name, ignore_loading_errors=True\n            )\n            available_configs = sorted(discovered_configs.configs.keys())\n            print(f\"Available configs: {available_configs}\")\n        raise e\n    configs = get_configs_from_mod(mod)\n    if configs is None:\n        raise ValueError(f\"Module {mod_name!r} does not have CONFIGS\")\n\n    if ver not in configs:\n        avail = \", \".join(configs.keys())\n        raise ValueError(f\"Config module {mod_name!r} has no key {ver!r}. Available keys: {avail}\")\n    return configs[ver]\n\n\nclass DiscoveredConfigsInModule(NamedTuple):\n    configs: dict[str, Config]\n    failing_modules: list[str]\n\n\ndef get_all_configs_from_module(\n    base_module_name: str,\n    ignore_loading_errors: bool = False,\n) -> DiscoveredConfigsInModule:\n    mod = get_module(base_module_name)\n    if not hasattr(mod, \"__path__\"):\n        raise ValueError(f\"Module '{base_module_name}' is not a package containing configs.\")\n\n    configs: dict[str, Config] = {}\n    failing_modules: list[str] = []","sourceCodeStart":579,"sourceCodeEnd":615,"githubUrl":"https://github.com/xai-org/x-algorithm/blob/24c60942c5c5fdad3a6addffb4c6e6d2f228f04f/phoenix/python/common/xai-configlib/src/xai_configlib/__init__.py#L579-L615","documentation":"The config module was found and has CONFIGS, but the requested key (the part after the first '.') is not present. The message lists the available keys to aid correction.","triggerScenarios":"Requesting 'my_cfg.v3' when CONFIGS only defines 'v1','v2'; also stale key names after a config restructure.","commonSituations":"Version bumps removing old keys, launch scripts referencing deleted experiment configs, typos in the version suffix.","solutions":["Use one of the keys listed in the error's 'Available keys'","Add the missing key to the module's CONFIGS dict","Update the launch script after config renames"],"exampleFix":"# before\nget_named_config_from_module(\"my_cfg.v3\", \"xrex.configs\")\n# after\nget_named_config_from_module(\"my_cfg.v2\", \"xrex.configs\")","handlingStrategy":"validation","validationCode":"from xai_configlib import get_configs_from_mod\nkeys = set(get_configs_from_mod(mod) or {})\nassert ver in keys, f\"{ver!r} not in {sorted(keys)}\"","typeGuard":null,"tryCatchPattern":"try:\n    get_named_config_from_module(name, base)\nexcept ValueError as e:\n    if \"has no key\" in str(e):\n        print(\"Available:\", str(e).split(\"Available keys: \")[-1])\n    raise","preventionTips":["Log available keys on startup","Keep deprecated keys as aliases during transitions"],"tags":["config","key-not-found","validation"],"backgroundTag":"config-key-not-found","analyzedSha":"24c60942c5c5fdad3a6addffb4c6e6d2f228f04f","analyzedAt":"2026-08-28T11:40:14.686Z","schemaVersion":2},"datasetVersion":"2026-08-28T16:17:29.566Z"}