{"record":{"id":"bb0acbf2b637de88","repo":"atuinsh/atuin","slug":"could-not-sync-records-due-to-version-mismatch","errorCode":null,"errorMessage":"could not sync records due to version mismatch","messagePattern":"could not sync records due to version mismatch","errorType":"error_code","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/atuin-client/src/api_client.rs","lineNumber":618,"sourceCode":"    }\n\n    /// Build a records request for `series`.\n    pub fn records(&self, series: &RecordSeriesKey) -> RecordsRequest {\n        RecordsRequest {\n            client: self.clone(),\n            series: series.clone(),\n        }\n    }\n\n    #[instrument(level = \"trace\", skip_all, err)]\n    pub async fn record_status(&self) -> Result<RecordStatus> {\n        let url = self.sync_addr.append_path(\"api/v0/record\")?;\n\n        let resp = self.client.get(url).send().await?;\n        let resp = handle_resp_error(resp).await?;\n\n        if !ensure_version(&resp)? {\n            bail!(\"could not sync records due to version mismatch\");\n        }\n\n        let index = resp.json().await?;\n\n        debug!(\"got remote index {index:?}\");\n\n        Ok(index)\n    }\n\n    #[instrument(level = \"trace\", skip_all, err)]\n    pub async fn delete(&self) -> Result<()> {\n        let url = self.sync_addr.append([\"account\"])?;\n\n        let resp = self.client.delete(url).send().await?;\n\n        if resp.status() == 403 {\n            bail!(\"invalid login details\");\n        } else if resp.status() == 200 {","sourceCodeStart":600,"sourceCodeEnd":636,"githubUrl":"https://github.com/atuinsh/atuin/blob/c0c717ab04c881764bcad4b3d169a507e2432643/crates/atuin-client/src/api_client.rs#L600-L636","documentation":"Guard in record_status: after the record-index GET succeeds, ensure_version compares the client version (ATUIN_CARGO_VERSION) against the server's advertised version. If the server is too old to speak the record protocol this client requires, the request is abandoned — sync cannot proceed until both sides agree on the protocol version.","triggerScenarios":"Thrown at crates/atuin-client/src/api_client.rs:618 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Upgrade the Atuin server to a version at least as new as the client","Compare client and server versions (the ensure_version path surfaces both on mismatch)","Pin the client to a compatible release if the server cannot be upgraded immediately"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"c0c717ab04c881764bcad4b3d169a507e2432643","analyzedAt":"2026-09-12T07:40:01.341Z","contentChangedAt":"2026-09-12T07:40:01.341Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}