nautechsystems/nautilus_trader · error
Execution factory extractor '{name}' is already registered
Error message
Execution factory extractor '{name}' is already registered What it means
Duplicate-registration guard in the Python system registry's register_exec_factory_extractor: an execution factory extractor with the same name is already registered, so the second registration would silently overwrite it and is rejected.
Source
Thrown at crates/system/src/python/registry.rs:119
extractors.insert(type_name, extractor);
Ok(())
}
/// Registers an execution factory extractor for a specific factory name.
///
/// # Errors
///
/// Returns an error if a factory with the same name is already registered.
pub fn register_exec_factory_extractor(
&self,
name: String,
extractor: ExecutionFactoryExtractor,
) -> anyhow::Result<()> {
let mut extractors = self.exec_factory_extractors.lock();
if extractors.contains_key(&name) {
anyhow::bail!("Execution factory extractor '{name}' is already registered");
}
extractors.insert(name, extractor);
Ok(())
}
/// Registers a simulated execution factory extractor for a specific factory name.
///
/// # Errors
///
/// Returns an error if a factory with the same name is already registered.
pub fn register_sim_exec_factory_extractor(
&self,
name: String,
extractor: SimulatedExecutionFactoryExtractor,
) -> anyhow::Result<()> {
let mut extractors = self.sim_exec_factory_extractors.lock();
if extractors.contains_key(&name) {View on GitHub (pinned to 18893faf8b)
Solutions
- Make registration idempotent — register once per process.
- Use a distinct name for custom exec factories.
- If re-running in a notebook, recreate the registry/kernel instead of re-registering.
Example fix
// before
register_exec_factory_extractor("MyExecClient", factory) # second call fails
// after
if "MyExecClient" not in registered_names:
register_exec_factory_extractor("MyExecClient", factory) Defensive patterns
Strategy: try-catch
Validate before calling
if name in registered_exec_factories:
return
registered_exec_factories.add(name)
register_exec_factory_extractor(name, factory) Type guard
def exec_factory_registered(name: str, names: set) -> bool:
return name in names Try / catch
try:
register_exec_factory_extractor(name, factory)
except Exception as e:
if "is already registered" in str(e):
pass # idempotent re-setup
else:
raise Prevention
- Wrap exec factory registration in an idempotent setup function
- Use unique adapter names per venue/factory
- Don't re-run node setup cells/notebook code in the same process
When it happens
Trigger: Calling the public register_exec_factory_extractor twice with the same `name`, e.g. double plugin registration, module reload, or two exec client adapters sharing a name.
Common situations: Re-running system kernel/node setup in the same process (tests, notebooks), importing a third-party exec factory twice, name collisions between venue adapters.
Understand the failure class
Background: "already exists" / EEXIST / FileAlreadyExistsException: what the 'file already exists' error means and how to fix it — this error's family across 37 libraries.
Related errors
- Factory extractor '{name}' is already registered
- Simulated execution factory extractor '{name}' is already re
- Unsupported product type for Binance execution client: {prod
- A different {label} extractor is already registered for '{ty
- Config extractor '{type_name}' is already registered
AI-assisted analysis of nautechsystems/nautilus_trader@18893faf8b (2026-09-08).
Data as JSON: /api/errors/123031e72844cb0c.
Report an issue: GitHub.