vectordotdev/vector · info

event count should never exceed u64

Error message

event count should never exceed u64

What it means

After decoding the final checkpoint record during disk_v2 recovery, Vector converts the record's event count (a platform `usize`) into `u64` to compute the last known record ID. On every supported platform `usize` is at most 64 bits, so the conversion is total; the expect is a documented-impossible assertion guarding hypothetical >64-bit targets. Seeing it means memory corruption or an unsupported platform, not a data or config problem.

Source

Thrown at lib/vector-buffers/src/variants/disk_v2/checkpoint_recovery.rs:471

        }

        match validate_record_archive(data_file_mmap.as_ref(), &Hasher::new()) {
            RecordStatus::Valid { id: last_record_id } => {
                let record = try_as_record_archive(data_file_mmap.as_ref())
                    .expect("record was already validated");
                let item = match decode_record_payload::<T>(record) {
                    Ok(item) => item,
                    Err(error) => {
                        warn!(
                            data_file_id,
                            %error,
                            "Final checkpoint record could not be decoded; scanning file boundary."
                        );
                        return Ok(DataFileClassification::NeedsBoundaryScan);
                    }
                };
                let record_events =
                    u64::try_from(item.event_count()).expect("event count should never exceed u64");
                Ok(DataFileClassification::KnownLastRecord {
                    last_record_id: last_record_id + record_events.saturating_sub(1),
                })
            }
            RecordStatus::Corrupted { .. } => {
                warn!(
                    data_file_id,
                    "Final checkpoint record has an invalid checksum; scanning file boundary."
                );
                Ok(DataFileClassification::NeedsBoundaryScan)
            }
            RecordStatus::FailedDeserialization(error) => {
                warn!(
                    data_file_id,
                    ?error,
                    "Final checkpoint record could not be deserialized; scanning file boundary."
                );
                Ok(DataFileClassification::NeedsBoundaryScan)

View on GitHub (pinned to 3708c39b12)

Solutions

  1. Treat as a bug: capture the backtrace and report it upstream
  2. If panics cluster, rule out memory/hardware instability (memtest, cgroup OOM behavior, ECC errors)
  3. Move the buffer data directory aside to return to service
Defensive patterns

Strategy: fallback

Prevention

When it happens

Trigger: u64::try_from(item.event_count()) failing, which requires a `usize` wider than u64 (no supported Rust target); no Vector configuration or on-disk state can trigger it.

Common situations: None in practice; the panic would only appear alongside hardware faults or a custom >64-bit target build.

Related errors


AI-assisted analysis of vectordotdev/vector@3708c39b12 (2026-08-20). Data as JSON: /api/errors/306b697ccdc6c58a. Report an issue: GitHub.