{"record":{"id":"f8a280d3356d2b5c","repo":"xai-org/x-algorithm","slug":"no-absolute-config-module-found-mod-name-r","errorCode":null,"errorMessage":"No absolute config module found {mod_name!r}","messagePattern":"No absolute config module found (.+?)","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"phoenix/xrex/configs/config_loader.py","lineNumber":93,"sourceCode":"\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\n    if not hasattr(mod, \"CONFIGS\"):\n        raise ValueError(\"Your config needs a global variable named CONFIGS\")\n\n    configs = mod.CONFIGS\n    if ver not in configs:\n        logger.warning(\n            f\"Couldn't find a valid config ({len(configs)=}), searching for closest matches...\"\n        )\n        closest_matches = difflib.get_close_matches(ver, configs, n=5, cutoff=0)\n        raise ValueError(","sourceCodeStart":75,"sourceCodeEnd":111,"githubUrl":"https://github.com/xai-org/x-algorithm/blob/24c60942c5c5fdad3a6addffb4c6e6d2f228f04f/phoenix/xrex/configs/config_loader.py#L75-L111","documentation":"When importing the config module directly fails with ModuleNotFoundError and the name has more than one dot (depth > 1, i.e. an absolute dotted path), xrex refuses to guess and raises this ValueError rather than retrying under xrex.configs.","triggerScenarios":"get_named_config('a.b.c:v1') where 'a.b.c' doesn't exist as an importable absolute module — the loader won't try 'xrex.configs.a.b.c' because nested retry is ambiguous.","commonSituations":"Pointing at a config package moved/deleted, or assuming relative-to-xrex.configs resolution works for deeply nested paths.","solutions":["Verify the absolute module path exists (has __init__.py at each level)","If the module lives under xrex.configs, pass only the trailing part ('b.c:v1') so relative lookup applies","Restore or fix the package layout the name refers to"],"exampleFix":"# before\nget_named_config(\"xrex.configs.train.big:v1\")  # if that path doesn't exist\n# after\nget_named_config(\"train.big:v1\")  # resolved under xrex.configs","handlingStrategy":"validation","validationCode":"import importlib.util\nassert importlib.util.find_spec(mod_name) is not None, f\"absolute module missing: {mod_name}\"","typeGuard":null,"tryCatchPattern":null,"preventionTips":["For nested configs, pass paths relative to xrex.configs","Verify package layout in CI"],"tags":["config","import","module-resolution"],"backgroundTag":"module-not-found","analyzedSha":"24c60942c5c5fdad3a6addffb4c6e6d2f228f04f","analyzedAt":"2026-08-28T11:40:14.686Z","schemaVersion":2},"datasetVersion":"2026-08-28T16:17:29.566Z"}