Hmbown/CodeWhale · error · anyhow::Error
INTERVAL must be >= 1 for HOURLY schedules
Error message
INTERVAL must be >= 1 for HOURLY schedules
What it means
HOURLY schedules accept an INTERVAL that shifts the run every N hours; an INTERVAL of 0 would never advance and is rejected. The parser parses INTERVAL as u32 and enforces >= 1 (1 being the default when omitted).
Solutions
- Set INTERVAL to 1 or greater (omit it entirely for every hour)
- Fix template/variable substitution so empty values don't become 0
- Validate INTERVAL > 0 before writing the automation config
Example fix
// before RRULE:FREQ=HOURLY;INTERVAL=0 // after RRULE:FREQ=HOURLY;INTERVAL=1
Defensive patterns
Strategy: validation
Validate before calling
const interval = Number(rule.match(/INTERVAL=(\d+)/)?.[1] ?? 1);
if (interval < 1) throw new Error("INTERVAL must be >= 1 for HOURLY schedules"); Try / catch
try {
parse_rrule(rule)?;
} catch e if e.to_string().contains("INTERVAL must be >= 1") {
eprintln!("{e}; defaulting to INTERVAL=1");
} Prevention
- Use a numeric spinner with min=1 in schedule forms
- Treat missing INTERVAL as 1 and reject explicit 0 at input time
- Guard template variables so unset values never render as 0
When it happens
Trigger: Parsing 'RRULE:FREQ=HOURLY;INTERVAL=0' — u32 parse succeeds with value 0 and the explicit zero check bails.
Common situations: Config templating that substitutes an unset variable as 0; user thinking INTERVAL=0 means 'every hour'.
Understand the failure class
Background: "value must be between 0 and 1" / "out of range" / "must not be negative" errors: fixing range-validation failures across open-source libraries — this error's family across 42 libraries.
Related errors
- BYHOUR must be between 0 and 23
- BYMINUTE must be between 0 and 59
- BYDAY cannot be empty for WEEKLY schedules
- Invalid BYDAY value
- RRULE must include FREQ
AI-assisted analysis of Hmbown/CodeWhale@73e0f67d83 (2026-09-22).
Data as JSON: /api/errors/d1d5137c0eeecfd2.
Report an issue: GitHub.
Appendix: source
Thrown at crates/tui/src/automation_manager.rs:389
if key != "FREQ"
&& key != "INTERVAL"
&& key != "BYDAY"
&& key != "BYHOUR"
&& key != "BYMINUTE"
{
bail!(
"Unsupported RRULE field '{key}' for HOURLY. Allowed: FREQ,INTERVAL,BYDAY,BYHOUR,BYMINUTE"
);
}
}
let interval_hours = parts
.get("INTERVAL")
.map(|v| v.parse::<u32>())
.transpose()
.context("Failed to parse INTERVAL")?
.unwrap_or(1);
if interval_hours == 0 {
bail!("INTERVAL must be >= 1 for HOURLY schedules");
}
let byday = parts
.get("BYDAY")
.map(|value| parse_byday(&value.to_ascii_uppercase()))
.transpose()?;
let anchor_hour = parts
.get("BYHOUR")
.map(|value| value.parse::<u32>())
.transpose()
.context("Failed to parse BYHOUR")?;
let anchor_minute = parts
.get("BYMINUTE")
.map(|value| value.parse::<u32>())
.transpose()
.context("Failed to parse BYMINUTE")?;
if anchor_hour.is_some_and(|hour| hour > 23) {
bail!("BYHOUR must be between 0 and 23");
}View on GitHub (pinned to 73e0f67d83)