{"record":{"id":"b1b1dfe3cfc73fc3","repo":"quickwit-oss/quickwit","slug":"index-id-in-config-file-does-not-match-update","errorCode":null,"errorMessage":"`index_id` in config file {} does not match updated `index_id` {}","messagePattern":"`index_id` in config file (.+?) does not match updated `index_id` (.+?)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"quickwit/quickwit-config/src/index_config/serialize.rs","lineNumber":80,"sourceCode":"}\n\n/// Parses and validates an [`IndexConfig`] update.\n///\n/// Ensures that the new configuration is valid in itself and compared to the\n/// current index config. If the new configuration omits some fields, the\n/// default values will be used, not those of the current index config.\npub fn load_index_config_update(\n    config_format: ConfigFormat,\n    index_config_bytes: &[u8],\n    default_index_root_uri: &Uri,\n    current_index_config: &IndexConfig,\n) -> anyhow::Result<IndexConfig> {\n    let mut new_index_config = load_index_config_from_user_config(\n        config_format,\n        index_config_bytes,\n        default_index_root_uri,\n    )?;\n    ensure!(\n        current_index_config.index_id == new_index_config.index_id,\n        \"`index_id` in config file {} does not match updated `index_id` {}\",\n        current_index_config.index_id,\n        new_index_config.index_id\n    );\n    ensure!(\n        current_index_config.index_uri == new_index_config.index_uri,\n        \"`index_uri` cannot be updated, current value {}, new expected value {}\",\n        current_index_config.index_uri,\n        new_index_config.index_uri\n    );\n    let (updated_doc_mapping, _mutation_occurred) = prepare_doc_mapping_update(\n        new_index_config.doc_mapping,\n        &current_index_config.doc_mapping,\n        &new_index_config.search_settings,\n    )?;\n    new_index_config.doc_mapping = updated_doc_mapping;\n","sourceCodeStart":62,"sourceCodeEnd":98,"githubUrl":"https://github.com/quickwit-oss/quickwit/blob/a39730c5cdcd1a4fe798403737ae293999ea21f8/quickwit/quickwit-config/src/index_config/serialize.rs#L62-L98","documentation":"This error is thrown by `load_index_config_update` in quickwit-config when applying a config-file update to an existing index. Quickwit parses the new index config from user-provided bytes and then checks that the `index_id` in the new file is identical to the `index_id` of the currently stored index config. Since the index identity cannot change through an update (the index is addressed by its `index_id`), any mismatch is rejected with this message showing both values.","triggerScenarios":"Calling `update_index` (REST/gRPC metadata update path) or `load_index_config_update` directly with index config YAML/JSON/TOML whose `index_id` field differs from the current index's `index_id`.","commonSituations":"Copy-pasting an index config from another index and forgetting to update `index_id`; renaming an index by editing `index_id` in the config instead of creating a new index; templated configs where the id is substituted incorrectly.","solutions":["Set the `index_id` field in the config file to exactly match the current index's `index_id`","If you actually intend to rename, delete the old index and create a new one instead of updating","Re-generate the config from the current index metadata (`GET /_index/{index_id}` style) to guarantee the id matches"],"exampleFix":"// before\nindex_id: my-renamed-index\n// after\nindex_id: my-index","handlingStrategy":"validation","validationCode":"fn ensure_index_id_unchanged(current: &str, new_config: &str) -> anyhow::Result<()> {\n    let new_id = extract_index_id(new_config)?; // parse your YAML/JSON to the index_id field\n    if new_id != current {\n        anyhow::bail!(\n            \"config index_id `{new_id}` does not match index being updated `{current}`\"\n        );\n    }\n    Ok(())\n}","typeGuard":null,"tryCatchPattern":"match load_index_config_update(...) {\n    Err(e) if e.to_string().contains(\"does not match updated `index_id`\") => {\n        eprintln!(\"Fix index_id in your config file to match the target index.\");\n    }\n    other => other?,\n}","preventionTips":["Fetch the current index config and edit only the fields you intend to change, keeping index_id intact","Never edit index_id to rename an index — create a new index instead","Template-render configs and assert the rendered index_id equals the target before calling update"],"tags":["config","indexing","validation"],"backgroundTag":"invalid-identifier","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"}