{"record":{"id":"ce0dd27d8aece317","repo":"nautechsystems/nautilus_trader","slug":"createstrategy-command-for-importable-strategy","errorCode":null,"errorMessage":"CreateStrategy command for importable strategy '{}' is not supported by the Rust controller","messagePattern":"CreateStrategy command for importable strategy '(.+?)' is not supported by the Rust controller","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/system/src/controller.rs","lineNumber":405,"sourceCode":"    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<()> {\n        self.register_execute_endpoint();\n        Ok(())\n    }\n\n    fn on_stop(&mut self) -> anyhow::Result<()> {\n        Self::deregister_execute_endpoint();\n        Ok(())\n    }\n\n    fn on_resume(&mut self) -> anyhow::Result<()> {","sourceCodeStart":387,"sourceCodeEnd":423,"githubUrl":"https://github.com/nautechsystems/nautilus_trader/blob/18893faf8b356be3320add8de2f861b0b647cf06/crates/system/src/controller.rs#L387-L423","documentation":"Analogous to the actor case: in builds without the 'python' feature, the Rust controller cannot instantiate importable Python strategies. unsupported_create_strategy_config always fails CreateStrategy commands carrying an ImportableStrategyConfig with this error.","triggerScenarios":"Sending a CreateStrategy command with an ImportableStrategyConfig to a controller compiled without the 'python' feature.","commonSituations":"Deploying a pure-Rust trader while the trading config still lists Python strategies by import path; upgrading from a Python build to a Rust-only binary without migrating strategy definitions.","solutions":["Build with the 'python' feature enabled to support importable strategies","Re-implement the strategy as a native Rust Strategy","Remove the CreateStrategy command from the Rust-only deployment"],"exampleFix":"// before (rust-only build)\ncontroller.send(\"CreateStrategy\".into(), create_strategy_command(strategy_config))?;\n// after: native Rust strategy\nlet strategy = MyRustStrategy::new(config);\nkernel.trader().add_strategy(strategy)?;","handlingStrategy":"type-guard","validationCode":"#[cfg(not(feature = \"python\"))]\nanyhow::ensure!(\n    !config_is_python_importable(&strategy_config),\n    \"python importable strategy requires a python-enabled build\"\n);","typeGuard":"fn supports_importable_python_strategies() -> bool {\n    cfg!(feature = \"python\")\n}","tryCatchPattern":"match controller.send(\"CreateStrategy\".into(), cmd) {\n    Err(e) if e.to_string().contains(\"not supported by the Rust controller\") => {\n        // migrate strategy to Rust or rebuild with python feature\n    }\n    other => other?,\n}","preventionTips":["Audit strategy configs for import paths when moving to Rust-only builds","Re-implement Python strategies as native Rust strategies before migration","Check feature flags in CI for the deployed binary"],"tags":["rust","controller","python","feature-flag","strategies"],"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"}