{"record":{"id":"87f13d26dc08c662","repo":"xai-org/x-algorithm","slug":"invalid-config-name-r-expected-format-module-k","errorCode":null,"errorMessage":"Invalid config {name!r}, expected format 'module.key'","messagePattern":"Invalid config (.+?), expected format 'module\\.key'","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"phoenix/python/common/xai-configlib/src/xai_configlib/__init__.py","lineNumber":578,"sourceCode":"\ndef get_configs_from_mod(\n    mod: ModuleType,\n) -> dict[str, Config] | None:\n    if \"CONFIGS\" not in dir(mod):\n        return None\n    configs: dict[str, Any | Config] = mod.CONFIGS\n    assert all(isinstance(config, Config) for config in configs.values())\n    return cast(dict[str, Config], configs)\n\n\ndef get_named_config_from_module(\n    name: str,\n    base_module_name: str,\n    on_failure_log_additional_info: bool = False,\n) -> Config:\n    parts = name.split(\".\", 1)\n    if len(parts) < 2:\n        raise ValueError(f\"Invalid config {name!r}, expected format 'module.key'\")\n\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())","sourceCodeStart":560,"sourceCodeEnd":596,"githubUrl":"https://github.com/xai-org/x-algorithm/blob/24c60942c5c5fdad3a6addffb4c6e6d2f228f04f/phoenix/python/common/xai-configlib/src/xai_configlib/__init__.py#L560-L596","documentation":"get_named_config_from_module resolves a config name like 'module.key': it splits on the first '.'. A name with no dot cannot yield both a module and a key, so it raises this ValueError.","triggerScenarios":"Calling get_named_config_from_module('myconfig') instead of 'myconfig.v1', or a name where the dot is missing/typo'd.","commonSituations":"Config name typos in launch scripts, or switching from a colon-style ('module:key') convention used elsewhere (xrex's get_named_config) to this library's dot convention.","solutions":["Use the 'module.key' format, e.g. 'base_cfg.v2'","If the key itself contains dots, use the colon form or a library variant that supports it","Verify the module exists under base_module_name"],"exampleFix":"# before\ncfg = get_named_config_from_module(\"myconfig\", \"xrex.configs\")\n# after\ncfg = get_named_config_from_module(\"myconfig.v1\", \"xrex.configs\")","handlingStrategy":"validation","validationCode":"import re\nassert re.fullmatch(r\"[^.]+\\..+\", name), f\"Use 'module.key': {name!r}\"","typeGuard":"def is_module_key(name: str) -> bool:\n    return isinstance(name, str) and \".\" in name and name.split(\".\", 1)[0]","tryCatchPattern":null,"preventionTips":["Adopt a single naming convention ('module:key') across scripts"],"tags":["config","module-resolution","validation"],"backgroundTag":"config-name-invalid","analyzedSha":"24c60942c5c5fdad3a6addffb4c6e6d2f228f04f","analyzedAt":"2026-08-28T11:40:14.686Z","schemaVersion":2},"datasetVersion":"2026-08-28T16:17:29.566Z"}