atuinsh/atuin · error

trailing bytes in encoded dotfiles var record. malformed

Error message

trailing bytes in encoded dotfiles var record. malformed

What it means

Decoder guard in VarRecord::deserialize: after reading a v0 dotfiles var record's expected fields, leftover bytes remain in the payload. A well-formed v0 record consumes its buffer exactly; trailing bytes mean the record is malformed — corruption, truncation of an earlier write, or an encoder/decoder mismatch.

Source

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

                match record_type {
                    // create
                    0 => {
                        let env = Var::deserialize(&mut bytes)?;
                        Ok(Self::Create(env))
                    }

                    // delete
                    1 => {
                        let nfields = decode::read_array_len(&mut bytes).map_err(error_report)?;
                        ensure!(nfields == 1, "too many entries in v0 dotfiles var delete record");

                        let bytes = bytes.remaining_slice();

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

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

                        Ok(Self::Delete(key.to_owned()))
                    }

                    n => {
                        bail!("unknown Dotfiles var record type {n}");
                    }
                }
            }
            other => {
                bail!("unknown var record version {other:?}");
            }
        }
    }
}

#[derive(Debug, Clone)]

View on GitHub (pinned to c0c717ab04)

Solutions

  1. Delete and re-create the affected var record, or re-sync the dotfiles store
  2. Check for disk corruption or interrupted sync writes
  3. Report to Atuin if it recurs on a fresh sync
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at crates/atuin-dotfiles/src/store/var.rs:78 when the library encounters an invalid state.

Common situations: See trigger scenarios.

Understand the failure class


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