zeroclaw-labs/zeroclaw · error · anyhow::Error
Invalid schedule: 'at' must be in the future
Error message
Invalid schedule: 'at' must be in the future (now_utc={}, now_local={}, at_utc={}, at_local={}, delta_seconds={}) What it means
Validation guard in validate_schedule for Schedule::At: the one-shot timestamp is not in the future. The message includes both UTC and local renderings plus the delta in seconds so the operator can see whether a timezone misconfiguration made an intended-future time land in the past; one-shot jobs that already fired cannot be scheduled.
Solutions
- Choose an 'at' time in the future; check the printed now/at timestamps and timezone.
Defensive patterns
Strategy: validation
When it happens
Trigger: Thrown at crates/zeroclaw-runtime/src/cron/schedule.rs:76 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of zeroclaw-labs/zeroclaw@88bb9c8533 (2026-08-23).
Data as JSON: /api/errors/1debd3e79cda2e1d.
Report an issue: GitHub.
Appendix: source
Thrown at crates/zeroclaw-runtime/src/cron/schedule.rs:76
.with_attrs(::serde_json::json!({"every_ms": *every_ms})),
"cron schedule: every_ms overflowed DateTime arithmetic"
);
anyhow::Error::msg("every_ms overflowed DateTime")
})
}
}
}
pub fn validate_schedule(schedule: &Schedule, now: DateTime<Utc>) -> Result<()> {
match schedule {
Schedule::Cron { expr, .. } => {
let _ = normalize_expression(expr)?;
let _ = next_run_for_schedule(schedule, now)?;
Ok(())
}
Schedule::At { at } => {
if *at <= now {
anyhow::bail!(
"Invalid schedule: 'at' must be in the future \
(now_utc={}, now_local={}, at_utc={}, at_local={}, delta_seconds={})",
now.to_rfc3339(),
now.with_timezone(&chrono::Local).to_rfc3339(),
at.to_rfc3339(),
at.with_timezone(&chrono::Local).to_rfc3339(),
(*at - now).num_seconds()
);
}
Ok(())
}
Schedule::Every { every_ms } => {
if *every_ms == 0 {
anyhow::bail!("Invalid schedule: every_ms must be > 0");
}
Ok(())
}
}View on GitHub (pinned to 88bb9c8533)