{"record":{"id":"c6a62e31fc4bd1bd","repo":"quickwit-oss/quickwit","slug":"left-metastore-config-is-defined-multiple-time","errorCode":null,"errorMessage":"{left:?} metastore config is defined multiple times","messagePattern":"(.+?) metastore config is defined multiple times","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"quickwit/quickwit-config/src/metastore_config.rs","lineNumber":66,"sourceCode":"    pub fn redact(&mut self) {\n        for metastore_config in &mut self.0 {\n            metastore_config.redact();\n        }\n    }\n\n    pub fn validate(&self) -> anyhow::Result<()> {\n        for metastore_config in &self.0 {\n            metastore_config.validate()?;\n        }\n        let backends: Vec<MetastoreBackend> = self\n            .0\n            .iter()\n            .map(|metastore_config| metastore_config.backend())\n            .sorted()\n            .collect();\n\n        for (left, right) in backends.iter().zip(backends.iter().skip(1)) {\n            ensure!(\n                left != right,\n                \"{left:?} metastore config is defined multiple times\"\n            );\n        }\n        Ok(())\n    }\n\n    pub fn find_file(&self) -> Option<&FileMetastoreConfig> {\n        self.0\n            .iter()\n            .find_map(|metastore_config| match metastore_config {\n                MetastoreConfig::File(file_metastore_config) => Some(file_metastore_config),\n                _ => None,\n            })\n    }\n\n    pub fn find_postgres(&self) -> Option<&PostgresMetastoreConfig> {\n        self.0","sourceCodeStart":48,"sourceCodeEnd":84,"githubUrl":"https://github.com/quickwit-oss/quickwit/blob/a39730c5cdcd1a4fe798403737ae293999ea21f8/quickwit/quickwit-config/src/metastore_config.rs#L48-L84","documentation":"When validating node configuration, Quickwit collects every configured metastore backend and rejects duplicates: the same backend type (e.g. `postgres`) appearing in more than one metastore config entry is ambiguous, so `validate` sorts backend names and fails when two adjacent entries are equal.","triggerScenarios":"A node config file (quickwit.yaml) listing the same metastore backend twice — e.g. two `postgres` blocks or repeated `metastore` entries after merging multiple config files.","commonSituations":"Merging config files/overlays where both a base and an override file define the same metastore; hand-editing config and duplicating a block; templating that appends a metastore entry unconditionally.","solutions":["Remove the duplicate metastore config block, keeping exactly one per backend","If merging files is the cause, drop or override the entry in one of the files instead of concatenating","Run `quickwit config validate` (or equivalent) after any config merge to catch duplicates early"],"exampleFix":"// before (duplicate postgres blocks)\nmetastore:\n  uri: postgres://a\n  uri: postgres://b\n// after\nmetastore:\n  uri: postgres://a","handlingStrategy":"validation","validationCode":"fn ensure_unique_metastore_backends(config: &NodeConfig) -> anyhow::Result<()> {\n    let mut backends: Vec<_> = config.metastore_configs()\n        .iter().map(|m| m.backend()).collect();\n    backends.sort();\n    backends.dedup();\n    if backends.len() != config.metastore_configs().len() {\n        anyhow::bail!(\"duplicate metastore backend configs detected\");\n    }\n    Ok(())\n}","typeGuard":null,"tryCatchPattern":"if let Err(e) = node_config.validate() {\n    if e.to_string().contains(\"metastore config is defined multiple times\") {\n        eprintln!(\"Check for duplicated metastore blocks across merged config files.\");\n    }\n}","preventionTips":["Keep exactly one metastore definition per backend in your config","When layering config files, override keys instead of appending lists","Run config validation after any merge/template rendering step"],"tags":["config","metastore","validation"],"backgroundTag":"conflicting-config-options","analyzedSha":"a39730c5cdcd1a4fe798403737ae293999ea21f8","analyzedAt":"2026-09-08T13:19:37.784Z","contentChangedAt":"2026-09-08T13:19:37.784Z","schemaVersion":2},"datasetVersion":"2026-09-14T16:17:12.679Z"}