atuinsh/atuin · error
trailing bytes in encoded history. malformed
Error message
trailing bytes in encoded history. malformed
What it means
Error "trailing bytes in encoded history. malformed" thrown in atuinsh/atuin.
Source
Thrown at crates/atuin-client/src/history.rs:334
let intent = if match version {
Version::Zero => false,
Version::One => nfields > min_fields,
Version::Two => true,
} {
decode::read_optional(&mut bytes, decode::read_string)?
} else {
None
};
let shell = if version >= Version::Two {
decode::read_optional(&mut bytes, decode::read_string)?
} else {
None
};
if version < Version::Two && !bytes.remaining_slice().is_empty() {
bail!("trailing bytes in encoded history. malformed");
}
Ok(History {
id: id.into(),
timestamp: OffsetDateTime::from_unix_nanos_u64(timestamp),
duration,
exit,
command,
cwd,
session,
author: author.unwrap_or_else(|| Self::author_from_hostname(&hostname)),
hostname,
intent,
deleted_at: deleted_at.map(OffsetDateTime::from_unix_nanos_u64),
shell,
})
}
View on GitHub (pinned to 15fe1318f1)
Solutions
- The encoded history entry is corrupt; delete or rebuild the affected record and re-sync.
When it happens
Trigger: Fires when extra undecoded bytes remain after parsing an encoded history record, indicating corruption.
Common situations: See trigger scenarios.
Understand the failure class
- Parsing and encoding errors: unexpected token, malformed input — why parsers reject input and how to find the real culprit.
AI-assisted analysis of atuinsh/atuin@15fe1318f1 (2026-08-19).
Data as JSON: /api/errors/a4df718e3eec4849.
Report an issue: GitHub.