{"record":{"id":"23df70c87df1b738","repo":"nautechsystems/nautilus_trader","slug":"config-path-must-be-in-format-module-path-classna-23df70","errorCode":null,"errorMessage":"config_path must be in format 'module.path:ClassName', was {config_path}","messagePattern":"config_path must be in format 'module\\.path:ClassName', was (.+?)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/system/src/python/registration.rs","lineNumber":563,"sourceCode":"        .map_err(|e| anyhow::anyhow!(\"Failed to import module {module_name}: {e}\"))?;\n\n    module\n        .getattr(class_name)\n        .map_err(|e| anyhow::anyhow!(\"Failed to get class {class_name}: {e}\"))\n}\n\nfn create_config_instance<'py>(\n    py: Python<'py>,\n    config_path: &str,\n    config: &HashMap<String, serde_json::Value>,\n) -> anyhow::Result<Option<Bound<'py, PyAny>>> {\n    if config_path.is_empty() && config.is_empty() {\n        log::debug!(\"No config_path or empty config, using None\");\n        return Ok(None);\n    }\n\n    let Some((config_module_name, config_class_name)) = config_path.split_once(':') else {\n        anyhow::bail!(\"config_path must be in format 'module.path:ClassName', was {config_path}\");\n    };\n\n    if config_module_name.is_empty()\n        || config_class_name.is_empty()\n        || config_class_name.contains(':')\n    {\n        anyhow::bail!(\"config_path must be in format 'module.path:ClassName', was {config_path}\");\n    }\n\n    log::debug!(\n        \"Importing config class from module: {config_module_name} class: {config_class_name}\"\n    );\n\n    let config_module = py\n        .import(config_module_name)\n        .map_err(|e| anyhow::anyhow!(\"Failed to import config module {config_module_name}: {e}\"))?;\n    let config_class = config_module\n        .getattr(config_class_name)","sourceCodeStart":545,"sourceCodeEnd":581,"githubUrl":"https://github.com/nautechsystems/nautilus_trader/blob/18893faf8b356be3320add8de2f861b0b647cf06/crates/system/src/python/registration.rs#L545-L581","documentation":"Thrown by `create_config_instance` when the `config_path` string cannot be split into `module.path:ClassName` because it lacks a `:`. Unlike error 1605, this message names the offending value (`config_path`) directly. Note: if config_path is empty AND config is empty, None config is used instead — this error only fires for non-empty malformed values.","triggerScenarios":"Providing a non-empty `config_path` without a colon separator when building an actor or strategy from importable configs — e.g. `my_pkg.configs.MyConfig` instead of `my_pkg.configs:MyConfig`.","commonSituations":"Same field-name confusion as 1605/1606 but on the config class rather than the actor/strategy class; configs copied from Python dotted-path documentation; YAML/JSON config with dots-only import references.","solutions":["Write config_path as `module.path:ClassName`, e.g. `my_pkg.configs:MyConfig`","If you truly want no config, pass an empty config_path together with empty config instead of a malformed value","Confirm the config class exists in the named module via importlib","Search your config file for `config_path` entries missing `:`"],"exampleFix":"// before\nconfig_path = \"my_pkg.configs.MyActorConfig\"\n// after\nconfig_path = \"my_pkg.configs:MyActorConfig\"","handlingStrategy":"validation","validationCode":"import re\nif config_path:\n    assert re.fullmatch(r\"[\\w.]+:[\\w.]+\", config_path), f\"bad config_path: {config_path}\"","typeGuard":"def is_valid_config_path(config_path: str) -> bool:\n    return \":\" in config_path and all(config_path.split(\":\", 1))","tryCatchPattern":"try:\n    trader.add_actor_from_importable_config(cfg)\nexcept ValueError as e:\n    if \"config_path must be in format\" in str(e):\n        raise ConfigError(f\"fix config_path: {cfg.config_path!r}\") from e\n    raise","preventionTips":["Leave config_path empty (with empty config) if you want defaults instead of a malformed value","Keep config class import paths next to actor import paths in a shared constants module","Lint config files for colon-less module paths"],"tags":["rust","python","config","format"],"backgroundTag":"invalid-argument-format","analyzedSha":"18893faf8b356be3320add8de2f861b0b647cf06","analyzedAt":"2026-09-08T20:49:34.690Z","contentChangedAt":"2026-09-08T20:49:34.690Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}