atuinsh/atuin · error

too many entries in v0 shell alias create record

Error message

too many entries in v0 shell alias create record

What it means

A v0 shell alias 'create' record must be a msgpack array with exactly 2 fields (key and value). The deserializer reads the array length and rejects the record if it is not 2, indicating the payload does not match the v0 alias-create schema. This prevents misinterpreting corrupt or version-mismatched data as a valid alias.

Source

Thrown at crates/atuin-dotfiles/src/store.rs:70

    pub fn deserialize(data: &DecryptedData, version: &RecordVersion) -> Result<Self> {
        use rmp::decode;

        fn error_report<E: std::fmt::Debug>(err: E) -> eyre::Report {
            eyre!("{err:?}")
        }

        match version {
            RecordVersion::V0 => {
                let mut bytes = decode::Bytes::new(&data.0);

                let record_type = decode::read_u8(&mut bytes).map_err(error_report)?;

                match record_type {
                    // create
                    0 => {
                        let nfields = decode::read_array_len(&mut bytes).map_err(error_report)?;
                        ensure!(nfields == 2, "too many entries in v0 shell alias create record");

                        let bytes = bytes.remaining_slice();

                        let (key, bytes) =
                            decode::read_str_from_slice(bytes).map_err(error_report)?;
                        let (value, bytes) =
                            decode::read_str_from_slice(bytes).map_err(error_report)?;

                        if !bytes.is_empty() {
                            bail!("trailing bytes in encoded shell alias record. malformed");
                        }

                        Ok(Self::Create(Alias {
                            name: key.to_owned(),
                            value: value.to_owned(),
                        }))
                    }

View on GitHub (pinned to c0c717ab04)

Solutions

  1. Upgrade atuin on all machines sharing the record store to the same version
  2. Delete the malformed alias record and re-create it via `atuin dotfiles`
  3. Re-sync aliases from a known-good machine
  4. Inspect the record store DB directly if the corruption persists
Defensive patterns

Strategy: validation

Validate before calling

let n = rmp::decode::read_array_len(&mut bytes)?;
if n != 2 { return Err("malformed v0 alias create record".into()); }

Try / catch

match AliasRecord::deserialize(&data) {
    Ok(rec) => apply(rec),
    Err(e) => log::warn!("skipping bad alias record: {e}"),
}

Prevention

When it happens

Trigger: Deserializing a v0 alias create record (record_type 0) whose decoded msgpack array length differs from 2.

Common situations: Version-skew between synced clients (newer format vs older reader); corrupted record store data; records produced by third-party tools writing to the store.

Understand the failure class

Background: Schema validation failed / invalid input schema: payload rejected because its shape doesn't match the expected schema — this error's family across 28 libraries.

Related errors


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