quickwit-oss/quickwit · error

Failed to create `OffsetDateTime` from split update timestam

Error message

Failed to create `OffsetDateTime` from split update timestamp.

What it means

Same conversion as the create-timestamp case but for split.update_timestamp, the last-update time recorded by the metastore. OffsetDateTime::from_unix_timestamp returns Err when the seconds value is out of the supported range; the expect turns that into a panic while building the `quickwit split list` table.

Source

Thrown at quickwit/quickwit-cli/src/split.rs:405

    //     println!("{hotcache_table}");
    // }
    Ok(())
}

fn make_split_table(splits: &[Split], title: &str) -> Table {
    let rows = splits
        .iter()
        .map(|split| {
            let time_range = if let Some(time_range) = &split.split_metadata.time_range {
                format!("[{time_range:?}]")
            } else {
                "[*]".to_string()
            };
            let created_at =
                OffsetDateTime::from_unix_timestamp(split.split_metadata.create_timestamp)
                    .expect("Failed to create `OffsetDateTime` from split create timestamp.");
            let updated_at = OffsetDateTime::from_unix_timestamp(split.update_timestamp)
                .expect("Failed to create `OffsetDateTime` from split update timestamp.");

            SplitRow {
                split_id: split.split_metadata.split_id.clone(),
                split_state: split.split_state,
                num_docs: split.split_metadata.num_docs,
                size_mega_bytes: split.split_metadata.uncompressed_docs_size_in_bytes / 1_000_000,
                created_at,
                updated_at,
                time_range,
            }
        })
        .sorted_by(|left, right| left.created_at.cmp(&right.created_at));
    make_table(title, rows, false)
}

fn parse_date(date_arg: &str, option_name: &str) -> anyhow::Result<OffsetDateTime> {
    let description = format_description::parse_borrowed::<2>("[year]-[month]-[day]")?;
    if let Ok(date) = Date::parse(date_arg, &description) {

View on GitHub (pinned to a39730c5cd)

Solutions

  1. Fix the update_timestamp for the offending split row in the metastore.
  2. Remove and re-ingest the corrupt split.
  3. Use unwrap_or_default-style fallback so one bad row does not kill the listing.

Example fix

// before
OffsetDateTime::from_unix_timestamp(split.update_timestamp)
    .expect("Failed to create `OffsetDateTime` from split update timestamp.")
// after
OffsetDateTime::from_unix_timestamp(split.update_timestamp)
    .unwrap_or(OffsetDateTime::UNIX_EPOCH)
Defensive patterns

Strategy: fallback

Validate before calling

let ts = split.update_timestamp;
if !(0..=253_402_300_799).contains(&ts) { eprintln!("invalid update_timestamp {ts}"); }

Type guard

fn is_sane_unix_ts(ts: i64) -> bool { (0..=253_402_300_799).contains(&ts) }

Try / catch

OffsetDateTime::from_unix_timestamp(split.update_timestamp)
    .unwrap_or(OffsetDateTime::UNIX_EPOCH)

Prevention

When it happens

Trigger: Listing splits where any split's update_timestamp is outside the valid Unix timestamp range (corrupt or fabricated metastore data).

Common situations: Corrupted PostgreSQL/file-backed metastore rows; splits copied between environments with mangled timestamps; tests or tooling that inserted placeholder sentinel values.

Related errors


AI-assisted analysis of quickwit-oss/quickwit@a39730c5cd (2026-09-08). Data as JSON: /api/errors/399975083bc6bf7b. Report an issue: GitHub.