{"record":{"id":"38c6518e96ccea13","repo":"xai-org/x-algorithm","slug":"no-config-module-found-mod-name-r-under-xrex-co","errorCode":null,"errorMessage":"No config module found {mod_name!r} under 'xrex.configs', or {mod_name!r} has another import issue: {traceback.format_exc()}","messagePattern":"No config module found (.+?) under 'xrex\\.configs', or (.+?) has another import issue: (.+?)","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"phoenix/xrex/configs/config_loader.py","lineNumber":46,"sourceCode":"    \"timeout.checkpoint=999999\",\n]\n\nPRESETS[\"no_health\"] = [\n    \"allow_unschedulable_nodes=True\",\n]\n\nPRESETS[\"no_checkpointing\"] = [\n    \"checkpoint_every_n=0\",\n    \"save_final_checkpoint=False\",\n    \"from_checkpoint=False\",\n]\n\n\ndef get_config_module(mod_name: str) -> dict[str, Config]:\n    try:\n        return importlib.import_module(f\"xrex.configs.{mod_name}\")\n    except ImportError as e:\n        raise ValueError(\n            f\"No config module found {mod_name!r} under 'xrex.configs', \"\n            f\"or {mod_name!r} has another import issue: {traceback.format_exc()}\"\n        ) from e\n\n\ndef replace_cli_subs(config: Any, kvs: list[str]) -> tuple[Any, dict[str, list[str]]]:\n    return xai_configlib.replace_cli_subs(config, kvs, PRESETS)\n\n\ndef replace_and_validate_cli_subs(config: Any, kvs: list[str]) -> Any:\n    config, used = xai_configlib.replace_cli_subs(config, kvs, PRESETS)\n    for k, v in used.items():\n        if not v:\n            raise ValueError(f\"Unused KV pairs: {k}\")\n        elif len(v) > 1:\n            logger.warning(f\"{k} matches multiple paths: {v}\")\n    return config\n","sourceCodeStart":28,"sourceCodeEnd":64,"githubUrl":"https://github.com/xai-org/x-algorithm/blob/24c60942c5c5fdad3a6addffb4c6e6d2f228f04f/phoenix/xrex/configs/config_loader.py#L28-L64","documentation":"xrex's get_config_module imports xrex.configs.<mod_name> and wraps any ImportError in a ValueError that embeds the full traceback, because a missing module and a broken module (syntax error, failing import inside it) look identical.","triggerScenarios":"Calling get_config_module with a nonexistent module name, or one whose file imports something unavailable (missing dependency, typo'd import) — both raise this.","commonSituations":"Typos in config names, new configs importing libraries not installed in the env, config modules referencing symbols moved during refactors, or running outside the repo so xrex.configs isn't importable.","solutions":["Read the embedded traceback: if it's not ModuleNotFoundError for the config module itself, fix the failing import inside your config","Fix the module-name typo","Install/ensure dependencies the config imports are available","Run from an environment where the xrex package is installed/importable"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"import importlib.util\nspec = importlib.util.find_spec(f\"xrex.configs.{mod_name}\")\nassert spec is not None, f\"no such config module: {mod_name}\"","typeGuard":null,"tryCatchPattern":"try:\n    get_config_module(mod_name)\nexcept ValueError as e:\n    # traceback is embedded; surface it for diagnosis\n    logging.error(\"config import failed:\\n%s\", e)\n    raise","preventionTips":["Smoke-test importing every config module in CI","Keep config dependencies installed in training envs"],"tags":["config","import","module-resolution","traceback"],"backgroundTag":"config-import-failed","analyzedSha":"24c60942c5c5fdad3a6addffb4c6e6d2f228f04f","analyzedAt":"2026-08-28T11:40:14.686Z","schemaVersion":2},"datasetVersion":"2026-08-28T16:17:29.566Z"}