{"record":{"id":"6087eb6e50d7e253","repo":"atuinsh/atuin","slug":"failed-to-parse-uuid-for-local-store-status","errorCode":null,"errorMessage":"failed to parse uuid for local store status","messagePattern":"failed to parse uuid for local store status","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/atuin-client/src/record/sqlite_store.rs","lineNumber":309,"sourceCode":"        }\n    }\n\n    pub async fn status(&self) -> Result<RecordStatus> {\n        let mut status = RecordStatus::new();\n\n        let res: Result<Vec<(String, String, i64)>, sqlx::Error> =\n            sqlx::query_as(\"select host, tag, max(idx) from store group by host, tag\")\n                .fetch_all(&self.pool)\n                .await;\n\n        let res = match res {\n            Err(e) => return Err(eyre!(\"failed to fetch local store status: {}\", e)),\n            Ok(v) => v,\n        };\n\n        for i in res {\n            let host = HostId(\n                Uuid::from_str(i.0.as_str()).expect(\"failed to parse uuid for local store status\"),\n            );\n\n            status.set_raw(host, RecordTag::from(i.1), i.2 as u64);\n        }\n\n        Ok(status)\n    }\n\n    pub async fn all_tagged(\n        &self,\n        tag: &RecordTag,\n    ) -> Result<Vec<Record<paseto_v4::EncryptedData>>> {\n        let res = sqlx::query(\"select * from store where tag = ?1 order by timestamp asc\")\n            .bind(tag.as_str())\n            .map(Self::query_row)\n            .fetch_all(&self.pool)\n            .await?;\n","sourceCodeStart":291,"sourceCodeEnd":327,"githubUrl":"https://github.com/atuinsh/atuin/blob/202f6ad98ee0da165c35cdb2afbc5b13d6ab81a1/crates/atuin-client/src/record/sqlite_store.rs#L291-L327","documentation":"A panic in SqliteStore's local store-status routine (sqlite_store.rs:309). It runs `select host, tag, max(idx) from store group by host, tag` to build the sync status, then expects each host string to parse as a UUID. A host value that is not a UUID means the store table contains corrupt or foreign data, and the process aborts — the sibling of the id-column panic in query_row, but on the host column and in the status path (so it typically kills `atuin store status` or sync bookkeeping).","triggerScenarios":"Running local store status / operations that build the store status when at least one row in the store table has a host column that is not a UUID string — same corruption vectors as error 17.","commonSituations":"Hand-edited or partially restored record stores; another process writing malformed rows; disk or copy corruption; mixing databases from incompatible tools.","solutions":["Restore the records database from backup","Identify and delete corrupt rows: select host from store group by host, validate each against UUID shape, then delete rows with invalid hosts (backup the file first)","As a last resort delete the records DB and re-register to rebuild the store (sync will repopulate from other hosts)","Stop the atuin daemon before any manual SQLite surgery"],"exampleFix":"-- after (locate + remove corrupt host rows; back up first)\n-- sqlite3 ~/.local/share/atuin/records.sqlite3\n.backup /tmp/records.bak\nDELETE FROM store WHERE host NOT GLOB '????????-????-????-????-????????????';","handlingStrategy":"validation","validationCode":"// Pre-check host values before running store status\n// sqlite3 ~/.local/share/atuin/records.sqlite3\n// SELECT host FROM store GROUP BY host WHERE host NOT GLOB '????????-????-????-????-????????????'; -- fix: use HAVING-style check per row instead:\n-- SELECT DISTINCT host FROM store;\n-- then validate each against UUID shape and delete bad rows (after .backup)","typeGuard":null,"tryCatchPattern":"// expect() panic: not catchable as an error. Validate the host column first and\n// keep backups; treat any occurrence as corruption requiring row cleanup or a\n// rebuild (delete DB + re-register, then re-sync).","preventionTips":["Validate the store table's host column after manual edits or restores","Back up the records database before any surgery","Stop the daemon before touching SQLite files","If corruption recurs, investigate disk health or tools sharing the data directory"],"tags":["database","corruption","panic","uuid","sqlite","sync","rust","atuin"],"backgroundTag":"database-corruption","analyzedSha":"202f6ad98ee0da165c35cdb2afbc5b13d6ab81a1","analyzedAt":"2026-08-16T19:30:24.731Z","schemaVersion":2},"datasetVersion":"2026-08-16T23:17:17.608Z"}