{"record":{"id":"b54073b8027560db","repo":"quickwit-oss/quickwit","slug":"failed-to-create-offsetdatetime-from-split-creat","errorCode":null,"errorMessage":"Failed to create `OffsetDateTime` from split create timestamp.","messagePattern":"Failed to create `OffsetDateTime` from split create timestamp\\.","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"quickwit/quickwit-cli/src/split.rs","lineNumber":403,"sourceCode":"    //     }\n    //     let hotcache_table = make_table(\"Files in Hotcache\", hotcache_files.into_iter(), false);\n    //     println!(\"{hotcache_table}\");\n    // }\n    Ok(())\n}\n\nfn make_split_table(splits: &[Split], title: &str) -> Table {\n    let rows = splits\n        .iter()\n        .map(|split| {\n            let time_range = if let Some(time_range) = &split.split_metadata.time_range {\n                format!(\"[{time_range:?}]\")\n            } else {\n                \"[*]\".to_string()\n            };\n            let created_at =\n                OffsetDateTime::from_unix_timestamp(split.split_metadata.create_timestamp)\n                    .expect(\"Failed to create `OffsetDateTime` from split create timestamp.\");\n            let updated_at = OffsetDateTime::from_unix_timestamp(split.update_timestamp)\n                .expect(\"Failed to create `OffsetDateTime` from split update timestamp.\");\n\n            SplitRow {\n                split_id: split.split_metadata.split_id.clone(),\n                split_state: split.split_state,\n                num_docs: split.split_metadata.num_docs,\n                size_mega_bytes: split.split_metadata.uncompressed_docs_size_in_bytes / 1_000_000,\n                created_at,\n                updated_at,\n                time_range,\n            }\n        })\n        .sorted_by(|left, right| left.created_at.cmp(&right.created_at));\n    make_table(title, rows, false)\n}\n\nfn parse_date(date_arg: &str, option_name: &str) -> anyhow::Result<OffsetDateTime> {","sourceCodeStart":385,"sourceCodeEnd":421,"githubUrl":"https://github.com/quickwit-oss/quickwit/blob/a39730c5cdcd1a4fe798403737ae293999ea21f8/quickwit/quickwit-cli/src/split.rs#L385-L421","documentation":"make_split_table converts each split's create_timestamp (a Unix seconds value from the metastore) into a time::OffsetDateTime for display. OffsetDateTime::from_unix_timestamp fails only for timestamps outside the representable range (roughly year -9999..9999); the expect asserts metastore timestamps are always sane, so the panic indicates corrupted metadata.","triggerScenarios":"Listing splits where a split's split_metadata.create_timestamp is negative, zero-corrupt, absurdly large, or otherwise out of OffsetDateTime's valid Unix-seconds range.","commonSituations":"Hand-edited or migrated metastore rows with bogus timestamps; corruption when importing splits from another index; clock misconfiguration at indexing time producing extreme values.","solutions":["Inspect the offending split's metadata (e.g. via the metastore DB) and correct the create_timestamp.","Delete/re-upload the corrupt split so metadata is regenerated.","In display code, fall back to showing the raw timestamp or a placeholder instead of panicking."],"exampleFix":"// before\nOffsetDateTime::from_unix_timestamp(split.split_metadata.create_timestamp)\n    .expect(\"Failed to create `OffsetDateTime` from split create timestamp.\")\n// after\nOffsetDateTime::from_unix_timestamp(split.split_metadata.create_timestamp)\n    .unwrap_or(OffsetDateTime::UNIX_EPOCH)","handlingStrategy":"fallback","validationCode":"let ts = split.split_metadata.create_timestamp;\nlet valid = (0..=253_402_300_799).contains(&ts); // 10000-01-01 upper bound in seconds","typeGuard":"fn is_sane_unix_ts(ts: i64) -> bool { (0..=253_402_300_799).contains(&ts) }","tryCatchPattern":"OffsetDateTime::from_unix_timestamp(ts)\n    .unwrap_or(OffsetDateTime::UNIX_EPOCH)","preventionTips":["Validate timestamps when importing or migrating splits between clusters.","Guard against clock skew (NTP) on indexing nodes.","Never hand-edit metastore rows without re-validating metadata."],"tags":["cli","timestamps","metastore","panic"],"backgroundTag":"invalid-date-format","analyzedSha":"a39730c5cdcd1a4fe798403737ae293999ea21f8","analyzedAt":"2026-09-08T13:19:37.784Z","contentChangedAt":"2026-09-08T13:19:37.784Z","schemaVersion":2},"datasetVersion":"2026-09-14T11:17:12.474Z"}