{"record":{"id":"601a05fa2da79861","repo":"quickwit-oss/quickwit","slug":"left-storage-config-is-defined-multiple-times","errorCode":null,"errorMessage":"{left:?} storage config is defined multiple times","messagePattern":"(.+?) storage config is defined multiple times","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"quickwit/quickwit-config/src/storage_config.rs","lineNumber":119,"sourceCode":"\n    pub fn apply_flavors(&mut self) {\n        for storage_config in self.0.iter_mut() {\n            if let StorageConfig::S3(s3_storage_config) = storage_config {\n                s3_storage_config.apply_flavor();\n            }\n        }\n    }\n\n    pub fn validate(&self) -> anyhow::Result<()> {\n        let backends: Vec<StorageBackend> = self\n            .0\n            .iter()\n            .map(|storage_config| storage_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:?} storage config is defined multiple times\",\n            );\n        }\n        Ok(())\n    }\n\n    pub fn find_azure(&self) -> Option<&AzureStorageConfig> {\n        self.0\n            .iter()\n            .find_map(|storage_config| match storage_config {\n                StorageConfig::Azure(azure_storage_config) => Some(azure_storage_config),\n                _ => None,\n            })\n    }\n\n    pub fn find_google(&self) -> Option<&GoogleCloudStorageConfig> {\n        self.0","sourceCodeStart":101,"sourceCodeEnd":137,"githubUrl":"https://github.com/quickwit-oss/quickwit/blob/a39730c5cdcd1a4fe798403737ae293999ea21f8/quickwit/quickwit-config/src/storage_config.rs#L101-L137","documentation":"Quickwit's storage configuration allows at most one storage definition per backend type (e.g. s3, azure, gcs, file). During validation of StorageConfigs, the backend names are sorted and adjacent pairs compared; any duplicate means the same backend was declared twice in the config, which is ambiguous. The library throws this to reject conflicting storage definitions at load time instead of guessing which one to use.","triggerScenarios":"Calling StorageConfig::validate (indirectly via config loading) when the user's quickwit config defines two storage configs with the same `backend` value, e.g. two `[storage.s3]` blocks or two storage entries merged from multiple config files.","commonSituations":"Merging multiple config files/fragments where both define storage for the same backend; copy-pasting a storage block and forgetting to remove the original; environment-variable overrides that duplicate an existing storage section.","solutions":["Search your quickwit config for duplicate storage blocks with the same `backend` value and remove or merge them into one.","If merging config fragments, ensure each backend appears only once across all fragments.","If overriding via environment variables, override the existing block's keys instead of adding a second block."],"exampleFix":"// before (quickwit.yaml)\nstorage:\n  s3:\n    bucket: quickwit-a\n  s3:\n    bucket: quickwit-b\n// after\nstorage:\n  s3:\n    bucket: quickwit-b","handlingStrategy":"validation","validationCode":"fn has_duplicate_backends(cfg: &QuickwitConfig) -> bool {\n    let mut backends: Vec<_> = cfg.storage_config.iter().map(|s| s.backend()).collect();\n    backends.sort();\n    backends.windows(2).any(|w| w[0] == w[1])\n}\n// if has_duplicate_backends(&cfg) { fail fast before serving }","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Keep storage config in a single config file; avoid merging fragments that may both define storage.","Run `quickwit config validate` (or call validate()) at deploy time before starting services.","Review environment-variable overrides for storage blocks in CI."],"tags":["config","validation","duplicate"],"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-14T11:17:12.474Z"}