{"record":{"id":"85ef28b5855785b0","repo":"quickwit-oss/quickwit","slug":"index-not-found","errorCode":null,"errorMessage":"index `{}` not found","messagePattern":"index `(.+?)` not found","errorType":"validation","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"quickwit/quickwit-control-plane/src/model/mod.rs","lineNumber":215,"sourceCode":"\n        for (source_id, source_config) in &index_metadata.sources {\n            if source_config.source_type() == SourceType::IngestV2 {\n                self.shard_table.add_source(&index_uid, source_id);\n            }\n        }\n        self.index_table.insert(index_uid, index_metadata);\n        self.update_metrics();\n    }\n\n    /// Updates the configuration of the specified index, returning an error if\n    /// the index didn't exist.\n    pub(crate) fn update_index_config(\n        &mut self,\n        index_uid: &IndexUid,\n        index_config: IndexConfig,\n    ) -> anyhow::Result<bool> {\n        let Some(index_model) = self.index_table.get_mut(index_uid) else {\n            bail!(\"index `{}` not found\", index_uid.index_id);\n        };\n        let fp_changed = !index_model.index_config.equals_fingerprint(&index_config);\n        index_model.index_config = index_config;\n        Ok(fp_changed)\n    }\n\n    pub(crate) fn delete_index(&mut self, index_uid: &IndexUid) {\n        self.index_table.remove(index_uid);\n        self.index_uid_table.remove(&index_uid.index_id);\n        self.shard_table.delete_index(&index_uid.index_id);\n        self.update_metrics();\n    }\n\n    /// Adds a source to a given index. Returns an error if the source already\n    /// exists.\n    pub(crate) fn add_source(\n        &mut self,\n        index_uid: &IndexUid,","sourceCodeStart":197,"sourceCodeEnd":233,"githubUrl":"https://github.com/quickwit-oss/quickwit/blob/a39730c5cdcd1a4fe798403737ae293999ea21f8/quickwit/quickwit-control-plane/src/model/mod.rs#L197-L233","documentation":"The control-plane in-memory model maintains an `index_table` of known indexes. `update_index_config` replaces an index's config only when the index already exists; if the `IndexUid` is absent from the table it bails with \"index not found\" rather than silently creating it.","triggerScenarios":"Calling `ControlPlaneModel::update_index_config` with an `IndexUid` that was never added via index creation, or that was deleted, or that belongs to a control plane that lost its state and is replaying stale update messages.","commonSituations":"Control plane restarted from empty state receiving index-config update messages out of order; an index was deleted between the create and the update; tests exercising the model with a fabricated IndexUid.","solutions":["Ensure the index exists first (create-index flow populated the model) before sending index config updates.","Verify the IndexUid (index_id + generation) matches the one returned by index creation, not a rebuilt/stale one.","Restore control plane state (metastore-backed recovery) before processing queued update messages."],"exampleFix":"// before\nmodel.update_index_config(&unknown_uid, config)?;\n// after\nif model.index_table().contains_key(&unknown_uid) {\n    model.update_index_config(&unknown_uid, config)?;\n} else {\n    return Err(anyhow!(\"index {} must be created before update\", unknown_uid.index_id));\n}","handlingStrategy":"validation","validationCode":"// Rust: check existence before update\nif !model.index_table().contains_key(&index_uid) {\n    return Err(anyhow::anyhow!(\"cannot update config: index {} not registered\", index_uid.index_id));\n}","typeGuard":null,"tryCatchPattern":"match model.update_index_config(&index_uid, config) {\n    Ok(changed) => {/* apply */},\n    Err(e) if e.to_string().contains(\"not found\") => {\n        // re-sync model state from metastore before retrying\n    }\n    Err(e) => return Err(e),\n}","preventionTips":["Process control-plane messages in order so create precedes update.","Persist/recover control-plane state instead of replaying updates onto an empty model.","Use the exact IndexUid returned by the create-index operation."],"tags":["control-plane","index","not-found","state"],"backgroundTag":"entity-not-found","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"}