nautechsystems/nautilus_trader · error
Duplicate data catalog name '{name}'
Error message
Duplicate data catalog name '{name}' What it means
When building the kernel with streaming/catalog configuration, each configured data catalog is assigned a name (explicit or auto-generated catalog_N). Names are collected into a set, and if two catalogs resolve to the same name the kernel refuses to start with this error, because catalog lookups by name would be ambiguous.
Source
Thrown at crates/system/src/kernel.rs:346
let exec_engine = Rc::new(RefCell::new(exec_engine));
let order_emulator = OrderEmulatorAdapter::new(clock.clone(), cache.clone());
let data_engine = DataEngine::new(clock.clone(), cache.clone(), config.data_engine());
#[cfg(feature = "streaming")]
let mut data_engine = data_engine;
#[cfg(feature = "streaming")]
{
let mut unnamed_index = 0;
let mut catalog_names = HashSet::new();
for catalog_config in config.catalogs() {
let name = catalog_config.name.clone().unwrap_or_else(|| {
let name = format!("catalog_{unnamed_index}");
unnamed_index += 1;
name
});
anyhow::ensure!(
catalog_names.insert(name.clone()),
"Duplicate data catalog name '{name}'",
);
let catalog = catalog_config.create_catalog().with_context(|| {
format!(
"Failed to create data catalog from '{}'",
catalog_config.path
)
})?;
data_engine.register_catalog(catalog, Some(&name));
}
}
let data_engine = Rc::new(RefCell::new(data_engine));
DataEngine::register_msgbus_handlers(&data_engine);
RiskEngine::register_msgbus_handlers(&risk_engine);
ExecutionEngine::register_msgbus_handlers(&exec_engine);
OrderEmulator::register_msgbus_handlers(&order_emulator.emulator());View on GitHub (pinned to 18893faf8b)
Solutions
- Give every catalog in config.catalogs() a unique explicit name
- Check for duplicated catalog blocks in the config file (copy-paste errors)
- Rename any manual catalog name that could collide with generated names (catalog_0, catalog_1, ...) — prefer descriptive names like "parquet-main"
- Log the resolved catalog names during startup to spot collisions before the kernel builds
Example fix
// before: duplicate names
catalogs: [CatalogConfig { name: Some("main"), .. }, CatalogConfig { name: Some("main"), .. }]
// after
catalogs: [CatalogConfig { name: Some("main"), .. }, CatalogConfig { name: Some("archive"), .. }] Defensive patterns
Strategy: validation
Validate before calling
fn catalog_names_unique(configs: &[CatalogConfig]) -> Result<(), String> {
let mut seen = std::collections::HashSet::new();
for (i, c) in configs.iter().enumerate() {
let name = c.name.clone().unwrap_or(format!("catalog_{i}"));
if !seen.insert(name.clone()) {
return Err(format!("duplicate catalog name: {name}"));
}
}
Ok(())
} Try / catch
match Kernel::new_with_dependencies(...) {
Err(e) if e.to_string().contains("Duplicate data catalog name") => {
eprintln!("fix catalog names in config: {e}");
std::process::exit(2);
}
other => other?,
} Prevention
- Give every catalog a unique, descriptive explicit name in config
- Validate config files for duplicate blocks at load time
- Avoid names matching the auto-generated pattern (catalog_N)
When it happens
Trigger: Configuring two or more catalogs in the TradingKernelConfig with the same explicit name, or relying on auto-generated names that collide after a manual name equals a generated one (e.g. an explicit "catalog_0" plus an unnamed catalog).
Common situations: Copy-pasting a catalog block in the config without renaming it; merging config files that each define a default-named catalog; an explicitly named catalog like catalog_1 colliding with the second unnamed catalog's generated name.
Related errors
- Duplicate quote spend limit for token pair {token_in} -> {to
- Config extractor '{type_name}' is already registered
- Invalid config type for AxExecutionClientFactory. Expected A
- Invalid config type for BetfairDataClientFactory. Expected B
- Invalid config type for BetfairExecutionClientFactory. Expec
AI-assisted analysis of nautechsystems/nautilus_trader@18893faf8b (2026-09-08).
Data as JSON: /api/errors/0df839eaaaf6c864.
Report an issue: GitHub.