atuinsh/atuin · error

could not sync records due to version mismatch

Error message

could not sync records due to version mismatch

What it means

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.

Source

Thrown at crates/atuin-client/src/api_client.rs:618

    }

    /// Build a records request for `series`.
    pub fn records(&self, series: &RecordSeriesKey) -> RecordsRequest {
        RecordsRequest {
            client: self.clone(),
            series: series.clone(),
        }
    }

    #[instrument(level = "trace", skip_all, err)]
    pub async fn record_status(&self) -> Result<RecordStatus> {
        let url = self.sync_addr.append_path("api/v0/record")?;

        let resp = self.client.get(url).send().await?;
        let resp = handle_resp_error(resp).await?;

        if !ensure_version(&resp)? {
            bail!("could not sync records due to version mismatch");
        }

        let index = resp.json().await?;

        debug!("got remote index {index:?}");

        Ok(index)
    }

    #[instrument(level = "trace", skip_all, err)]
    pub async fn delete(&self) -> Result<()> {
        let url = self.sync_addr.append(["account"])?;

        let resp = self.client.delete(url).send().await?;

        if resp.status() == 403 {
            bail!("invalid login details");
        } else if resp.status() == 200 {

View on GitHub (pinned to c0c717ab04)

Solutions

  1. Upgrade the Atuin server to a version at least as new as the client
  2. Compare client and server versions (the ensure_version path surfaces both on mismatch)
  3. Pin the client to a compatible release if the server cannot be upgraded immediately
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at crates/atuin-client/src/api_client.rs:618 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of atuinsh/atuin@c0c717ab04 (2026-09-12). Data as JSON: /api/errors/bb0acbf2b637de88. Report an issue: GitHub.