vectordotdev/vector · info
Vector only supports record sizes that fit in u64
Error message
Vector only supports record sizes that fit in u64
What it means
`ReaderError::consumed_record_bytes` reports how many payload bytes a checksum-mismatched or deserialization-failed record consumed, converting the error's `record_bytes: usize` to `u64` for ledger accounting. On supported platforms the conversion is total, so this expect is a documented impossibility guarding hypothetical >64-bit `usize` targets.
Source
Thrown at lib/vector-buffers/src/variants/disk_v2/reader.rs:145
impl<T> ReaderError<T>
where
T: Bufferable,
{
pub(super) fn is_bad_read(&self) -> bool {
matches!(
self,
ReaderError::Checksum { .. }
| ReaderError::Deserialization { .. }
| ReaderError::PartialWrite
)
}
pub(super) fn consumed_record_bytes(&self) -> Option<u64> {
match self {
ReaderError::Checksum { record_bytes, .. }
| ReaderError::Deserialization { record_bytes, .. } => Some(
u64::try_from(*record_bytes)
.expect("Vector only supports record sizes that fit in u64"),
),
_ => None,
}
}
fn as_error_code(&self) -> &'static str {
match self {
ReaderError::Io { .. } => "io_error",
ReaderError::Deserialization { .. } => "deser_failed",
ReaderError::Checksum { .. } => "checksum_mismatch",
ReaderError::Decode { .. } => "decode_failed",
ReaderError::Incompatible { .. } => "incompatible_record_version",
ReaderError::PartialWrite => "partial_write",
ReaderError::EmptyRecord => "empty_record",
}
}
pub fn as_recoverable_error(&self) -> Option<BufferReadError> {View on GitHub (pinned to 3708c39b12)
Solutions
- No action possible; if it appears, treat it as an upstream bug and report the backtrace
Defensive patterns
Strategy: validation
Prevention
- Nothing to guard: byte counts derive from real I/O sizes that fit u64 on supported platforms
- Report any occurrence upstream with a backtrace
When it happens
Trigger: A Checksum or Deserialization ReaderError carrying record_bytes larger than u64::MAX — impossible on 32/64-bit targets regardless of on-disk state, because the byte count originates from a real buffer/file length.
Common situations: None in practice; byte counts derive from actual reads, which cannot approach 2^64 on supported hardware.
Related errors
- event count should never exceed u64
- Event count for a record cannot exceed 2^64 events.
- Ledger length cannot be greater than `u64`.
- Default maximum data file size should never be greater than
- record was already validated
AI-assisted analysis of vectordotdev/vector@3708c39b12 (2026-08-20).
Data as JSON: /api/errors/7954157f35e6a81d.
Report an issue: GitHub.