{"record":{"id":"93e2307880182a89","repo":"Hmbown/CodeWhale","slug":"unable-to-compute-next-anchored-hourly-run","errorCode":null,"errorMessage":"Unable to compute next anchored HOURLY run","messagePattern":"Unable to compute next anchored HOURLY run","errorType":"exception","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"crates/tui/src/automation_manager.rs","lineNumber":537,"sourceCode":"                            .ok_or_else(|| anyhow::anyhow!(\"HOURLY schedule exceeded its range\"))?;\n\n                        if byday\n                            .as_ref()\n                            .is_none_or(|days| days.contains(&candidate_naive.weekday()))\n                            && let Some(candidate) =\n                                resolve_local_datetime(timezone, candidate_naive)\n                        {\n                            let candidate = candidate.with_timezone(&Utc);\n                            if candidate > after {\n                                return Ok(candidate);\n                            }\n                        }\n\n                        steps = steps\n                            .checked_add(1)\n                            .ok_or_else(|| anyhow::anyhow!(\"HOURLY schedule exceeded its range\"))?;\n                    }\n                    bail!(\"Unable to compute next anchored HOURLY run\");\n                }\n\n                let after_second = local_after.second();\n                let after_nanosecond = local_after.nanosecond();\n                let mut candidate = local_after + Duration::hours(i64::from(*interval_hours))\n                    - Duration::seconds(i64::from(after_second))\n                    - Duration::nanoseconds(i64::from(after_nanosecond));\n\n                if let Some(days) = byday {\n                    for _ in 0..(24 * 21) {\n                        if days.contains(&candidate.weekday()) {\n                            return Ok(candidate.with_timezone(&Utc));\n                        }\n                        candidate += Duration::hours(i64::from(*interval_hours));\n                    }\n                    bail!(\"Unable to compute next HOURLY run for BYDAY filter\");\n                }\n","sourceCodeStart":519,"sourceCodeEnd":555,"githubUrl":"https://github.com/Hmbown/CodeWhale/blob/73e0f67d83c59909b571efdfc88c4bc28c309cb1/crates/tui/src/automation_manager.rs#L519-L555","documentation":"Thrown when the anchored-HOURLY search exhausts MAX_HOURLY_SEARCH_STEPS without finding a candidate on the interval grid that passes the BYDAY filter and resolves to a real local time. The schedule advances `interval_hours` from a wall-clock anchor each step; if no eligible step lands within the bounded search window, the algorithm gives up instead of looping forever.","triggerScenarios":"An HOURLY schedule with anchor_hour/anchor_minute set whose BYDAY filter combined with the interval never yields a matching weekday within the bounded step count, or whose interval math overflows the search window (e.g. absurdly large interval_hours).","commonSituations":"Config with a very large FREQ=HOURLY;INTERVAL combined with BYDAY so the next matching day falls outside the search bound; a mistyped BYDAY list that matches no upcoming weekday within the window; corrupted stored schedule where interval_hours is huge.","solutions":["Reduce INTERVAL (interval_hours) or widen/fix the BYDAY list so a matching weekday occurs within the search window.","Remove the anchor (anchor_hour/anchor_minute) if a plain relative hourly cadence is intended.","Inspect the stored RRULE for a corrupt or extreme interval value and correct it."],"exampleFix":"// before\n\"FREQ=HOURLY;INTERVAL=100000;BYDAY=MO\"\n// after\n\"FREQ=HOURLY;INTERVAL=2;BYDAY=MO,TU,WE,TH,FR\"","handlingStrategy":"validation","validationCode":"if interval_hours > 24 * 7 {\n    return Err(\"HOURLY interval too large; use WEEKLY instead\");\n}\nif !byday.is_empty() && interval_hours > 168 {\n    return Err(\"BYDAY unreachable at this interval\");\n}","typeGuard":null,"tryCatchPattern":"match schedule.next_after_with_anchor(now, anchor) {\n    Ok(next) => arm(next),\n    Err(e) if e.to_string().contains(\"anchored HOURLY\") => flag_schedule_unreachable(),\n    Err(e) => report(e),\n}","preventionTips":["Cap INTERVAL at sane values (<= 168) in the schedule editor.","Prefer WEEKLY schedules when the interval exceeds a day.","Always pair a large interval with a permissive BYDAY."],"tags":["scheduling","automation","bounds"],"backgroundTag":"value-out-of-range","analyzedSha":"73e0f67d83c59909b571efdfc88c4bc28c309cb1","analyzedAt":"2026-09-22T01:30:00.501Z","contentChangedAt":"2026-09-22T01:30:00.501Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}