{"record":{"id":"48ed17468b5ff24f","repo":"xai-org/x-algorithm","slug":"invalid-config-name-r-expected-format-module-k-48ed17","errorCode":null,"errorMessage":"Invalid config {name!r}, expected format 'module.key' where key cannot contain '.'","messagePattern":"Invalid config (.+?), expected format 'module\\.key' where key cannot contain '\\.'","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"phoenix/xrex/configs/config_loader.py","lineNumber":83,"sourceCode":"\n_DEFAULT_AOT_CACHE_DIR = \"/tmp/jax_aot_cache/\"\n\n\ndef _apply_deployment_defaults(config: Config) -> Config:\n    if settings.AOT_CACHE_DIR and getattr(config, \"aot_cache_dir\", None) == (\n        _DEFAULT_AOT_CACHE_DIR\n    ):\n        config.aot_cache_dir = settings.AOT_CACHE_DIR\n    return config\n\n\ndef get_named_config(name: str) -> Config:\n    if \":\" in name:\n        mod_name, ver = name.rsplit(\":\", 1)\n    else:\n        parts = name.rsplit(\".\", 1)\n        if len(parts) < 2:\n            raise ValueError(\n                f\"Invalid config {name!r}, expected format 'module.key' where key cannot contain '.'\"\n            )\n        mod_name, ver = parts\n\n    try:\n        mod = importlib.import_module(mod_name)\n    except ModuleNotFoundError:\n        depth = mod_name.count(\".\")\n        if depth > 1:\n            raise ValueError(f\"No absolute config module found {mod_name!r}\")\n\n        try:\n            mod = importlib.import_module(f\"xrex.configs.{mod_name}\")\n        except ModuleNotFoundError:\n            raise ValueError(\n                f\"No config module {mod_name!r} found, either at the top level or under 'xrex.configs'\"\n            )\n","sourceCodeStart":65,"sourceCodeEnd":101,"githubUrl":"https://github.com/xai-org/x-algorithm/blob/24c60942c5c5fdad3a6addffb4c6e6d2f228f04f/phoenix/xrex/configs/config_loader.py#L65-L101","documentation":"xrex's get_named_config splits a name into module and key on ':' (preferred) or the last '.'. Without a colon, a name with no '.' at all cannot yield both parts and raises this ValueError.","triggerScenarios":"Calling get_named_config('myconfig') instead of 'myconfig:v1' or 'myconfig.v1'.","commonSituations":"Forgetting the version/key suffix, or migrating from a loader with a different separator convention.","solutions":["Use 'module:key' (or 'module.key' when the key has no dots)","If the key contains dots, use the colon form"],"exampleFix":"# before\ncfg = get_named_config(\"myconfig\")\n# after\ncfg = get_named_config(\"myconfig:v1\")","handlingStrategy":"validation","validationCode":"assert (\":\" in name) or (name.count(\".\") >= 1), f\"Use 'module:key': {name!r}\"","typeGuard":"def is_named_config(name: str) -> bool:\n    return isinstance(name, str) and (\":\" in name or \".\" in name)","tryCatchPattern":null,"preventionTips":["Prefer the colon separator; centralize name construction"],"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"}