openai/codex · error · anyhow::Error
invalid unix timestamp
Error message
invalid unix timestamp: {secs} What it means
Validation guard: chrono could not construct a DateTime from the persisted unix seconds (out of representable range), so the timestamp cannot be converted to a datetime.
Solutions
- Fix or sanitize the stored timestamp to a valid range
- Clamp extreme values to the minimum/maximum representable datetime
Defensive patterns
Strategy: validation
When it happens
Trigger: Thrown at codex-rs/state/src/model/backfill_state.rs:72 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of openai/codex@339751715c (2026-08-25).
Data as JSON: /api/errors/a4bae818e0f9cca8.
Report an issue: GitHub.
Appendix: source
Thrown at codex-rs/state/src/model/backfill_state.rs:72
BackfillStatus::Pending => "pending",
BackfillStatus::Running => "running",
BackfillStatus::Complete => "complete",
}
}
pub fn parse(value: &str) -> Result<Self> {
match value {
"pending" => Ok(Self::Pending),
"running" => Ok(Self::Running),
"complete" => Ok(Self::Complete),
_ => Err(anyhow::anyhow!("invalid backfill status: {value}")),
}
}
}
fn epoch_seconds_to_datetime(secs: i64) -> Result<DateTime<Utc>> {
DateTime::<Utc>::from_timestamp(secs, 0)
.ok_or_else(|| anyhow::anyhow!("invalid unix timestamp: {secs}"))
}
View on GitHub (pinned to 339751715c)