nautechsystems/nautilus_trader · error

CreateActor command for importable actor '{}' is not support

Error message

CreateActor command for importable actor '{}' is not supported by the Rust controller

What it means

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.

Source

Thrown at crates/system/src/controller.rs:395

            .register(Self::execute_endpoint(), handler);
    }

    fn deregister_execute_endpoint() {
        get_message_bus()
            .borrow_mut()
            .endpoint_map::<ControllerCommand>()
            .deregister(Self::execute_endpoint());
    }

    fn execute_endpoint() -> MStr<Endpoint> {
        Self::EXECUTE_ENDPOINT.into()
    }

    #[cfg(not(feature = "python"))]
    fn unsupported_create_actor_config(
        actor_config: &ImportableActorConfig,
    ) -> anyhow::Result<ActorId> {
        anyhow::bail!(
            "CreateActor command for importable actor '{}' is not supported by the Rust controller",
            actor_config.actor_path
        );
    }

    #[cfg(not(feature = "python"))]
    fn unsupported_create_strategy_config(
        strategy_config: &ImportableStrategyConfig,
    ) -> anyhow::Result<StrategyId> {
        anyhow::bail!(
            "CreateStrategy command for importable strategy '{}' is not supported by the Rust controller",
            strategy_config.strategy_path
        );
    }
}

impl DataActor for Controller {
    fn on_start(&mut self) -> anyhow::Result<()> {

View on GitHub (pinned to 18893faf8b)

Solutions

  1. Use a Python-enabled build (compile/feature 'python') if the actor is a Python importable actor
  2. Replace the importable Python actor with a native Rust Actor implementation
  3. Remove the CreateActor command from the Rust-only control flow

Example fix

// before (rust-only build): sending CreateActor for a python importable actor
controller.send("CreateActor".into(), create_actor_command(actor_config))?;
// after: use a native Rust actor
let actor = MyRustActor::new(config);
controller.kernel().trader().add_actor(actor)?;
Defensive patterns

Strategy: type-guard

Validate before calling

// Skip Python-importable actors on non-Python builds
#[cfg(not(feature = "python"))]
fn is_python_importable(c: &ImportableActorConfig) -> bool { true }
#[cfg(feature = "python")]
fn is_python_importable(_c: &ImportableActorConfig) -> bool { false }

Type guard

fn supports_importable_python_components() -> bool {
    cfg!(feature = "python")
}

Try / catch

match controller.send("CreateActor".into(), cmd) {
    Err(e) if e.to_string().contains("not supported by the Rust controller") => {
        // route to Python-enabled node or use native Rust actor
    }
    other => other?,
}

Prevention

When it happens

Trigger: Sending a CreateActor command carrying an ImportableActorConfig to a controller compiled without the 'python' feature (a pure-Rust build).

Common situations: 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.

Understand the failure class

Background: UnsupportedOperationException and "is not supported" errors: when a library deliberately refuses a call — this error's family across 30 libraries.

Related errors


AI-assisted analysis of nautechsystems/nautilus_trader@18893faf8b (2026-09-08). Data as JSON: /api/errors/5d631dc662004d7a. Report an issue: GitHub.