{"record":{"id":"79b72dd15486e9f5","repo":"nautechsystems/nautilus_trader","slug":"failed-to-get-config-class-config-class-name-e","errorCode":null,"errorMessage":"Failed to get config class {config_class_name}: {e}","messagePattern":"Failed to get config class (.+?): (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/system/src/python/registration.rs","lineNumber":582,"sourceCode":"    };\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)\n        .map_err(|e| anyhow::anyhow!(\"Failed to get config class {config_class_name}: {e}\"))?;\n    let py_dict = PyDict::new(py);\n\n    for (key, value) in config {\n        let py_value = config_value_to_py(py, key, value)?;\n        py_dict.set_item(key, py_value)?;\n    }\n\n    let config_instance = match config_class.call((), Some(&py_dict)) {\n        Ok(instance) => instance,\n        Err(kwargs_err) => match config_class.call0() {\n            Ok(instance) => {\n                for (key, value) in config {\n                    let py_value = config_value_to_py(py, key, value)?;\n\n                    if let Err(setattr_err) = instance.setattr(key, py_value) {\n                        anyhow::bail!(\"Failed to set attribute {key}: {setattr_err}\");\n                    }\n                }","sourceCodeStart":564,"sourceCodeEnd":600,"githubUrl":"https://github.com/nautechsystems/nautilus_trader/blob/18893faf8b356be3320add8de2f861b0b647cf06/crates/system/src/python/registration.rs#L564-L600","documentation":"Raised by `create_config_instance` when the config module imported successfully but `getattr` cannot find the named config class on it. The referenced config class does not exist under that name in that module.","triggerScenarios":"A `config_path` of the form `module:ConfigClass` where the config class is misspelled, was renamed, or lives in a different module than specified while instantiating a Python actor/strategy config.","commonSituations":"Renaming `*Config` dataclasses during refactors with stale configs pointing at old names; referring to an inner/non-top-level class; case mismatch.","solutions":["Confirm the config class name matches its definition in the module","Re-export the class at the module's top level or update the config path","Grep the module for `class <Name>` to find the correct current name"],"exampleFix":"// before\nconfig_path = \"my_package.config:MyActorConf\"\n// after\nconfig_path = \"my_package.config:MyActorConfig\"","handlingStrategy":"validation","validationCode":"from importlib import import_module\nmod_path, cls = config_path.split(\":\")\nassert hasattr(import_module(mod_path), cls), f\"no config class {cls} in {mod_path}\"","typeGuard":null,"tryCatchPattern":"try:\n    trader.add_actor(actor_config)\nexcept Exception as e:\n    if \"Failed to get config class\" in str(e):\n        logging.error(\"verify config class name: %s\", e)\n    raise","preventionTips":["Match config class names exactly as defined in source","Re-export config classes from stable module paths","Avoid referring to nested classes in config paths"],"tags":["python","attribute-error","config"],"backgroundTag":"class-not-found","analyzedSha":"18893faf8b356be3320add8de2f861b0b647cf06","analyzedAt":"2026-09-08T20:49:34.690Z","contentChangedAt":"2026-09-08T20:49:34.690Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}