{"record":{"id":"c217538dcdf4fe7d","repo":"Hmbown/CodeWhale","slug":"unable-to-round-cron-search-start","errorCode":null,"errorMessage":"Unable to round CRON search start","messagePattern":"Unable to round CRON search start","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/tui/src/automation_manager.rs","lineNumber":585,"sourceCode":"                    }\n                    let Some(candidate_naive) = date.and_hms_opt(*byhour, *byminute, 0) else {\n                        continue;\n                    };\n                    if let Some(candidate) = resolve_local_datetime(timezone, candidate_naive)\n                        && candidate.with_timezone(&Utc) > after\n                    {\n                        return Ok(candidate.with_timezone(&Utc));\n                    }\n                }\n                bail!(\"Unable to compute next WEEKLY run\");\n            }\n            Self::Cron { expr } => {\n                let cron = ParsedCronExpr::parse(expr)?;\n                let mut candidate_naive = local_after\n                    .naive_local()\n                    .with_second(0)\n                    .and_then(|dt| dt.with_nanosecond(0))\n                    .ok_or_else(|| anyhow::anyhow!(\"Unable to round CRON search start\"))?\n                    .checked_add_signed(Duration::minutes(1))\n                    .ok_or_else(|| anyhow::anyhow!(\"CRON schedule exceeded its range\"))?;\n\n                for _ in 0..MAX_CRON_SEARCH_MINUTES {\n                    if cron.matches(candidate_naive)\n                        && let Some(candidate) = 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                    candidate_naive = candidate_naive\n                        .checked_add_signed(Duration::minutes(1))\n                        .ok_or_else(|| anyhow::anyhow!(\"CRON schedule exceeded its range\"))?;\n                }\n                bail!(\"Unable to compute next CRON run within 5 years\");\n            }","sourceCodeStart":567,"sourceCodeEnd":603,"githubUrl":"https://github.com/Hmbown/CodeWhale/blob/73e0f67d83c59909b571efdfc88c4bc28c309cb1/crates/tui/src/automation_manager.rs#L567-L603","documentation":"WEEKLY next-run search: rounding the search start to a candidate local datetime failed (resolve_local_datetime returned None, typically a DST gap), so no valid next occurrence can be computed and the scheduler refuses rather than guessing a shifted time.","triggerScenarios":"Thrown at crates/tui/src/automation_manager.rs:585 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Check the CRON expression's fields (especially hour/minute/dom/month wildcards) for values that prevent rounding a valid local candidate after 'after'.","Simplify the expression to isolate the offending field, then re-test next_run computation."],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"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"}