{"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":"exception","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/900007c48045867e7f44b0f9bc55ad9dbe99ee0d/crates/atuin-client/src/api_client.rs#L600-L636","documentation":"`record_status` fetches the remote record index from `api/v0/record` and calls `ensure_version` on the response before parsing it. If the response's version marker does not match what this client supports, it bails with this message. It protects the record store from syncing against a server protocol the client cannot interpret (or vice versa).","triggerScenarios":"A `record_status` call (used by sync flows like `atuin sync`) where the record index response fails `ensure_version` — server record format version differs from the client's expected version.","commonSituations":"Client and server atuin versions are out of sync (old client against a newer server or vice versa); a self-hosted server upgraded while clients were not; sync protocol v2 mismatches after upgrades.","solutions":["Update the atuin CLI to the latest version (`atuin update` or your package manager)","If self-hosted, align server and client versions — upgrade both together","Check release notes for sync/record format changes between your versions","If you cannot upgrade, pin the server to a version compatible with your clients"],"exampleFix":"null","handlingStrategy":"fallback","validationCode":"// Check version compatibility before syncing\nlet status = client.record_status().await; // if this fails, versions likely mismatch\n// Or compare `atuin --version` against the server's supported versions","typeGuard":null,"tryCatchPattern":"match client.record_status().await {\n    Err(e) if e.to_string().contains(\"version mismatch\") => {\n        eprintln!(\"Update the atuin CLI to match the sync server's record format: {e}\");\n    }\n    other => other,\n}","preventionTips":["Upgrade clients and servers together when atuin releases protocol changes","Pin server versions compatible with your client fleet","Read release notes for record/sync format changes"],"tags":["sync","version-mismatch","records","protocol"],"backgroundTag":"incompatible-source-type","analyzedSha":"900007c48045867e7f44b0f9bc55ad9dbe99ee0d","analyzedAt":"2026-09-19T12:52:51.491Z","contentChangedAt":"2026-09-19T12:52:51.491Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}