Hmbown/CodeWhale · error

WEEKLY schedules require BYMINUTE

Error message

WEEKLY schedules require BYMINUTE

What it means

RRULE parse guard for WEEKLY frequency: BYDAY parsed successfully but the parts map has no BYMINUTE key. The minute component of the weekly anchor time is mandatory, so the schedule is rejected before an AutomationSchedule is built.

Solutions

  1. Add BYMINUTE to the RRULE, e.g. FREQ=WEEKLY;BYDAY=TU;BYHOUR=14;BYMINUTE=0
  2. Ensure BYMINUTE is an integer 0-59
  3. Regenerate the schedule via the automation UI/CLI which composes the full RRULE

Example fix

// before
"FREQ=WEEKLY;BYDAY=TU;BYHOUR=14"
// after
"FREQ=WEEKLY;BYDAY=TU;BYHOUR=14;BYMINUTE=0"
Defensive patterns

Strategy: validation

Validate before calling

fn validate_byminute(rule: &str) -> Result<(), String> {
    let parts: HashMap<_,_> = rule.split(';').filter_map(|p| p.split_once('=')).collect();
    if parts.get("FREQ").map(String::as_str) != Some("WEEKLY") { return Ok(()); }
    let m: u32 = parts.get("BYMINUTE").ok_or("WEEKLY requires BYMINUTE")?.parse().map_err(|_| "BYMINUTE not numeric")?;
    if m > 59 { return Err("BYMINUTE must be 0-59".into()); }
    Ok(())
}

Try / catch

match parse_rrule(&rule) {
    Ok(s) => save(s),
    Err(e) if e.to_string().contains("require BYMINUTE") =>
        eprintln!("Add BYMINUTE (0-59) to your WEEKLY rule"),
    Err(e) => return Err(e),
}

Prevention

When it happens

Trigger: A WEEKLY RRULE such as 'FREQ=WEEKLY;BYDAY=TU;BYHOUR=14' without BYMINUTE, or BYMINUTE present but non-numeric (which fails at the adjacent parse with context 'Failed to parse BYMINUTE').

Common situations: Author assuming minute defaults to 0, schedules converted from cron (where minutes are the first field and easily omitted when translating), tooling generating RRULEs without time components.

Understand the failure class

Background: "is required", "must be set", "missing required field": configuration validation errors across open-source libraries — this error's family across 36 libraries.

Related errors


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

Appendix: source

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

                            "Unsupported RRULE field '{key}' for WEEKLY. Allowed: FREQ,BYDAY,BYHOUR,BYMINUTE"
                        );
                    }
                }
                let byday_raw = parts
                    .get("BYDAY")
                    .ok_or_else(|| anyhow::anyhow!("WEEKLY schedules require BYDAY"))?;
                let byday = parse_byday(&byday_raw.to_ascii_uppercase())?;
                if byday.is_empty() {
                    bail!("BYDAY cannot be empty for WEEKLY schedules");
                }
                let byhour = parts
                    .get("BYHOUR")
                    .ok_or_else(|| anyhow::anyhow!("WEEKLY schedules require BYHOUR"))?
                    .parse::<u32>()
                    .context("Failed to parse BYHOUR")?;
                let byminute = parts
                    .get("BYMINUTE")
                    .ok_or_else(|| anyhow::anyhow!("WEEKLY schedules require BYMINUTE"))?
                    .parse::<u32>()
                    .context("Failed to parse BYMINUTE")?;

                if byhour > 23 {
                    bail!("BYHOUR must be between 0 and 23");
                }
                if byminute > 59 {
                    bail!("BYMINUTE must be between 0 and 59");
                }

                Ok(Self::Weekly {
                    byday,
                    byhour,
                    byminute,
                })
            }
        }
    }

View on GitHub (pinned to 73e0f67d83)