{"id":"f7843974cb52aa55","repo":"BurntSushi/ripgrep","slug":"index-was-opened-read-only","errorCode":null,"errorMessage":"index was opened read-only","messagePattern":"index was opened read-only","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/index/src/index.rs","lineNumber":195,"sourceCode":"    ReadOnly(ReadOnlyDatabase),\n}\n\nimpl Handle {\n    fn begin_read(\n        &self,\n    ) -> Result<redb::ReadTransaction, redb::TransactionError> {\n        use redb::ReadableDatabase;\n        match self {\n            Handle::ReadWrite(database) => database.begin_read(),\n            Handle::ReadOnly(database) => database.begin_read(),\n        }\n    }\n\n    fn read_write(&self) -> anyhow::Result<&Database> {\n        match self {\n            Handle::ReadWrite(database) => Ok(database),\n            Handle::ReadOnly(_) => {\n                anyhow::bail!(\"index was opened read-only\")\n            }\n        }\n    }\n\n    fn read_write_mut(&mut self) -> anyhow::Result<&mut Database> {\n        match self {\n            Handle::ReadWrite(database) => Ok(database),\n            Handle::ReadOnly(_) => {\n                anyhow::bail!(\"index was opened read-only\")\n            }\n        }\n    }\n}\n\nimpl std::fmt::Debug for Handle {\n    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {\n        match *self {\n            Handle::ReadWrite(_) => write!(f, \"<redb read-write database>\"),","sourceCodeStart":177,"sourceCodeEnd":213,"githubUrl":"https://github.com/BurntSushi/ripgrep/blob/3fce3b5bb0236da2df6d99672afb8a719642eca7/crates/index/src/index.rs#L177-L213","documentation":"Error \"index was opened read-only\" thrown in BurntSushi/ripgrep.","triggerScenarios":"Thrown at crates/index/src/index.rs:195 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Open the index in read-write mode to perform updates","Close other processes holding the index open read-only"],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"analyzedSha":"3fce3b5bb0236da2df6d99672afb8a719642eca7","analyzedAt":"2026-08-06T01:39:05.073Z","schemaVersion":2}