Hmbown/CodeWhale · error

ONCE schedules require AT

Error message

ONCE schedules require AT

What it means

RRULE parse guard for ONCE frequency: only FREQ and AT are allowed keys, and the AT key is missing from the parts map. A one-shot schedule cannot be built without its fire time, so parsing aborts before parse_once_at runs.

Solutions

  1. Add AT=<rfc3339 or local naive datetime> to the ONCE rrule.
  2. Use FREQ=WEEKLY/CRON if a recurring schedule was intended.
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at crates/tui/src/automation_manager.rs:706 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of Hmbown/CodeWhale@73e0f67d83 (2026-09-22). Data as JSON: /api/errors/8825f993391f9d1c. Report an issue: GitHub.

Appendix: source

Thrown at crates/tui/src/automation_manager.rs:706

            "SU" => Weekday::Sun,
            other => bail!("Invalid BYDAY value '{other}'"),
        };
        if !days.contains(&day) {
            days.push(day);
        }
    }
    Ok(days)
}

fn parse_once_schedule(parts: &BTreeMap<String, String>) -> Result<AutomationSchedule> {
    for key in parts.keys() {
        if key != "FREQ" && key != "AT" {
            bail!("Unsupported RRULE field '{key}' for ONCE. Allowed: FREQ,AT");
        }
    }
    let raw_at = parts
        .get("AT")
        .ok_or_else(|| anyhow::anyhow!("ONCE schedules require AT"))?;
    let at = parse_once_at(raw_at)?;
    Ok(AutomationSchedule::Once { at })
}

fn parse_cron_schedule(parts: &BTreeMap<String, String>) -> Result<AutomationSchedule> {
    for key in parts.keys() {
        if key != "FREQ" && key != "EXPR" {
            bail!("Unsupported RRULE field '{key}' for CRON. Allowed: FREQ,EXPR");
        }
    }
    let expr = parts
        .get("EXPR")
        .map(|value| value.trim().to_string())
        .filter(|value| !value.is_empty())
        .ok_or_else(|| anyhow::anyhow!("CRON schedules require EXPR"))?;
    ParsedCronExpr::parse(&expr)?;
    Ok(AutomationSchedule::Cron { expr })
}

View on GitHub (pinned to 73e0f67d83)