atuinsh/atuin · error

too many entries in v0 dotfiles env create record, got

Error message

too many entries in v0 dotfiles env create record, got {}, expected {}

What it means

The v0 dotfiles env 'create' record has a fixed MessagePack schema of exactly 3 fields. During deserialization the decoder reads the rmp array length and bails if it is not 3, rejecting malformed or from-the-future records rather than misparsing them.

Solutions

  1. Identify the bad record in the store and remove it (e.g. via record store tooling/sync from a healthy host)
  2. Ensure all machines run a compatible atuin version, then re-sync the dotfiles records
  3. Recreate the env var record with `atuin dotfiles env set` after clearing the bad record
Defensive patterns

Strategy: validation

Validate before calling

if let Ok(n) = rmp::decode::read_array_len(&bytes) {
    if n != 3 {
        eprintln!("unexpected v0 env record field count: {n}");
        return Ok(());
    }
}

Prevention

When it happens

Trigger: Decoding a v0 env var create record whose MessagePack payload encodes an array with more (or fewer) than 3 elements - typically a corrupt, hand-edited, or newer-version record in the store.

Common situations: Record store corrupted by manual edits, a record written by a different atuin version with a changed v0 layout, or bad data produced by a bug.

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@900007c480 (2026-09-19). Data as JSON: /api/errors/6d68a1c8c1ce735b. Report an issue: GitHub.

Appendix: source

Thrown at crates/atuin-dotfiles/src/shell.rs:50

    /// This is intended to be called by the store
    pub fn serialize(&self, output: &mut Vec<u8>) -> Result<()> {
        encode::write_array_len(output, 3)?; // 3 fields

        encode::write_str(output, self.name.as_str())?;
        encode::write_str(output, self.value.as_str())?;
        encode::write_bool(output, self.export)?;

        Ok(())
    }

    pub fn deserialize(bytes: &mut decode::Bytes) -> Result<Self> {
        fn error_report<E: std::fmt::Debug>(err: E) -> eyre::Report {
            eyre!("{err:?}")
        }

        let nfields = decode::read_array_len(bytes).map_err(error_report)?;

        ensure!(
            nfields == 3,
            "too many entries in v0 dotfiles env create record, got {}, expected {}",
            nfields,
            3
        );

        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)?;

        let mut bytes = decode::Bytes::new(bytes);
        let export = decode::read_bool(&mut bytes).map_err(error_report)?;

        ensure!(
            bytes.remaining_slice().is_empty(),
            "trailing bytes in encoded dotfiles env record, malformed"
        );

View on GitHub (pinned to 900007c480)