{"record":{"id":"5d631dc662004d7a","repo":"nautechsystems/nautilus_trader","slug":"createactor-command-for-importable-actor-is-n","errorCode":null,"errorMessage":"CreateActor command for importable actor '{}' is not supported by the Rust controller","messagePattern":"CreateActor command for importable actor '(.+?)' is not supported by the Rust controller","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/system/src/controller.rs","lineNumber":395,"sourceCode":"            .register(Self::execute_endpoint(), handler);\n    }\n\n    fn deregister_execute_endpoint() {\n        get_message_bus()\n            .borrow_mut()\n            .endpoint_map::<ControllerCommand>()\n            .deregister(Self::execute_endpoint());\n    }\n\n    fn execute_endpoint() -> MStr<Endpoint> {\n        Self::EXECUTE_ENDPOINT.into()\n    }\n\n    #[cfg(not(feature = \"python\"))]\n    fn unsupported_create_actor_config(\n        actor_config: &ImportableActorConfig,\n    ) -> anyhow::Result<ActorId> {\n        anyhow::bail!(\n            \"CreateActor command for importable actor '{}' is not supported by the Rust controller\",\n            actor_config.actor_path\n        );\n    }\n\n    #[cfg(not(feature = \"python\"))]\n    fn unsupported_create_strategy_config(\n        strategy_config: &ImportableStrategyConfig,\n    ) -> anyhow::Result<StrategyId> {\n        anyhow::bail!(\n            \"CreateStrategy command for importable strategy '{}' is not supported by the Rust controller\",\n            strategy_config.strategy_path\n        );\n    }\n}\n\nimpl DataActor for Controller {\n    fn on_start(&mut self) -> anyhow::Result<()> {","sourceCodeStart":377,"sourceCodeEnd":413,"githubUrl":"https://github.com/nautechsystems/nautilus_trader/blob/18893faf8b356be3320add8de2f861b0b647cf06/crates/system/src/controller.rs#L377-L413","documentation":"In non-Python builds of NautilusTrader, the Rust controller cannot instantiate importable Python actors (which require the Python runtime to import and construct the class). unsupported_create_actor_config is the stub used for the CreateActor command in cfg(not(feature = \"python\")) builds, and it always returns this error.","triggerScenarios":"Sending a CreateActor command carrying an ImportableActorConfig to a controller compiled without the 'python' feature (a pure-Rust build).","commonSituations":"Running a pure-Rust binary against a config authored for a Python node that loads actors by module path; scripts assuming feature parity between Rust and Python builds.","solutions":["Use a Python-enabled build (compile/feature 'python') if the actor is a Python importable actor","Replace the importable Python actor with a native Rust Actor implementation","Remove the CreateActor command from the Rust-only control flow"],"exampleFix":"// before (rust-only build): sending CreateActor for a python importable actor\ncontroller.send(\"CreateActor\".into(), create_actor_command(actor_config))?;\n// after: use a native Rust actor\nlet actor = MyRustActor::new(config);\ncontroller.kernel().trader().add_actor(actor)?;","handlingStrategy":"type-guard","validationCode":"// Skip Python-importable actors on non-Python builds\n#[cfg(not(feature = \"python\"))]\nfn is_python_importable(c: &ImportableActorConfig) -> bool { true }\n#[cfg(feature = \"python\")]\nfn is_python_importable(_c: &ImportableActorConfig) -> bool { false }","typeGuard":"fn supports_importable_python_components() -> bool {\n    cfg!(feature = \"python\")\n}","tryCatchPattern":"match controller.send(\"CreateActor\".into(), cmd) {\n    Err(e) if e.to_string().contains(\"not supported by the Rust controller\") => {\n        // route to Python-enabled node or use native Rust actor\n    }\n    other => other?,\n}","preventionTips":["Verify the build's feature flags before authoring configs with Python importables","Prefer native Rust actors for Rust-only deployments","Document feature requirements per deployment artifact"],"tags":["rust","controller","python","feature-flag","actors"],"backgroundTag":"unsupported-operation","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"}