{"record":{"id":"0df839eaaaf6c864","repo":"nautechsystems/nautilus_trader","slug":"duplicate-data-catalog-name-name","errorCode":null,"errorMessage":"Duplicate data catalog name '{name}'","messagePattern":"Duplicate data catalog name '(.+?)'","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/system/src/kernel.rs","lineNumber":346,"sourceCode":"        let exec_engine = Rc::new(RefCell::new(exec_engine));\n\n        let order_emulator = OrderEmulatorAdapter::new(clock.clone(), cache.clone());\n\n        let data_engine = DataEngine::new(clock.clone(), cache.clone(), config.data_engine());\n        #[cfg(feature = \"streaming\")]\n        let mut data_engine = data_engine;\n        #[cfg(feature = \"streaming\")]\n        {\n            let mut unnamed_index = 0;\n            let mut catalog_names = HashSet::new();\n\n            for catalog_config in config.catalogs() {\n                let name = catalog_config.name.clone().unwrap_or_else(|| {\n                    let name = format!(\"catalog_{unnamed_index}\");\n                    unnamed_index += 1;\n                    name\n                });\n                anyhow::ensure!(\n                    catalog_names.insert(name.clone()),\n                    \"Duplicate data catalog name '{name}'\",\n                );\n                let catalog = catalog_config.create_catalog().with_context(|| {\n                    format!(\n                        \"Failed to create data catalog from '{}'\",\n                        catalog_config.path\n                    )\n                })?;\n                data_engine.register_catalog(catalog, Some(&name));\n            }\n        }\n        let data_engine = Rc::new(RefCell::new(data_engine));\n\n        DataEngine::register_msgbus_handlers(&data_engine);\n        RiskEngine::register_msgbus_handlers(&risk_engine);\n        ExecutionEngine::register_msgbus_handlers(&exec_engine);\n        OrderEmulator::register_msgbus_handlers(&order_emulator.emulator());","sourceCodeStart":328,"sourceCodeEnd":364,"githubUrl":"https://github.com/nautechsystems/nautilus_trader/blob/18893faf8b356be3320add8de2f861b0b647cf06/crates/system/src/kernel.rs#L328-L364","documentation":"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.","triggerScenarios":"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).","commonSituations":"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.","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"],"exampleFix":"// before: duplicate names\ncatalogs: [CatalogConfig { name: Some(\"main\"), .. }, CatalogConfig { name: Some(\"main\"), .. }]\n// after\ncatalogs: [CatalogConfig { name: Some(\"main\"), .. }, CatalogConfig { name: Some(\"archive\"), .. }]","handlingStrategy":"validation","validationCode":"fn catalog_names_unique(configs: &[CatalogConfig]) -> Result<(), String> {\n    let mut seen = std::collections::HashSet::new();\n    for (i, c) in configs.iter().enumerate() {\n        let name = c.name.clone().unwrap_or(format!(\"catalog_{i}\"));\n        if !seen.insert(name.clone()) {\n            return Err(format!(\"duplicate catalog name: {name}\"));\n        }\n    }\n    Ok(())\n}","typeGuard":null,"tryCatchPattern":"match Kernel::new_with_dependencies(...) {\n    Err(e) if e.to_string().contains(\"Duplicate data catalog name\") => {\n        eprintln!(\"fix catalog names in config: {e}\");\n        std::process::exit(2);\n    }\n    other => other?,\n}","preventionTips":["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)"],"tags":["config","catalog","duplicate","kernel"],"backgroundTag":"conflicting-config-options","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"}