{"record":{"id":"f3aa1b8fdea702d6","repo":"Hmbown/CodeWhale","slug":"cron-schedule-exceeded-its-range","errorCode":null,"errorMessage":"CRON schedule exceeded its range","messagePattern":"CRON schedule exceeded its range","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/tui/src/automation_manager.rs","lineNumber":587,"sourceCode":"                        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            }\n        }\n    }","sourceCodeStart":569,"sourceCodeEnd":605,"githubUrl":"https://github.com/Hmbown/CodeWhale/blob/73e0f67d83c59909b571efdfc88c4bc28c309cb1/crates/tui/src/automation_manager.rs#L569-L605","documentation":"CRON next-run search exhausted its candidate range without finding an occurrence after the given time; either the expression matches nothing in range or it is unsatisfiable, so the scheduler fails instead of looping forever.","triggerScenarios":"Thrown at crates/tui/src/automation_manager.rs:587 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Narrow the CRON expression's ranges so iteration over the search window yields valid candidates.","Verify the expression with a cron parser before saving the automation."],"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"}