Repository navigation
Description
Bug Description
Schedules configured with cron day-of-week 1 (Monday) are consistently firing on Tuesday instead. The scheduler correctly computes next_run_at as Monday, but the actual execution happens on Tuesday.
Evidence
Agent: ability-website
Weekly SEO Monitor (5 9 * * 1)
Execution history shows the pattern clearly:
| Execution Date | Day of Week | Expected | Status |
|---|---|---|---|
| 2026-03-17 09:05 UTC | Tuesday | Monday | success |
| 2026-03-10 09:05 UTC | Tuesday | Monday | failed |
| 2026-03-03 09:05 UTC | Tuesday | Monday | failed |
(Mar 16 Monday execution at 17:49 was a manual trigger, not the cron)
Weekly CRO Report (42 9 * * 1)
| Execution Date | Day of Week | Expected |
|---|---|---|
| 2026-03-17 09:47 UTC | Tuesday | Monday |
Pre-SEO git-sync (55 8 * * 1)
| Execution Date | Day of Week | Expected |
|---|---|---|
| 2026-03-17 08:55 UTC | Tuesday | Monday |
next_run_at is correct
The scheduler computes future run times correctly:
42 9 * * 1→next_run_at: 2026-03-23T09:42:00Z(Monday ✓)- Tested
* * 0: returnednext_run_at: 2026-03-22(Sunday ✓)
So the cron parsing is correct (0=Sun, 1=Mon), but actual execution is shifted +1 day.
Possible Causes
-
Catch-up execution: If the agent was down on Monday and the scheduler retries missed jobs on the next available window (Tuesday). However, this happened 3 weeks in a row (Mar 3, 10, 17).
-
Off-by-one in the execution trigger (not the parser): The cron expression is parsed correctly for
next_run_atdisplay, but the actual trigger comparison uses a different weekday calculation. -
Timezone boundary issue: All schedules use
timezone: UTCand fire times are well within the UTC day (08:55-09:47), so this seems unlikely.
Additional Notes
- The
updated_atfield on ALL schedules shows the same timestamp (2026-03-17T12:15:47), suggesting a bulk sync or agent restart on Tuesday - Container health
last_check_atis stale (2026-02-28) - Container shows
restart_count: 0but logs show a fresh startup sequence
Expected Behavior
Cron 5 9 * * 1 should fire on Monday at 09:05 UTC, not Tuesday.
Environment
- Trinity platform (self-hosted)
- Agent:
ability-website - Schedules created between 2026-01-30 and 2026-03-16
Activity
fix: Scheduler misfire handling — missed cron jobs now catch up on re…
fix: Scheduler misfire handling — missed cron jobs now catch up on re…
fix: Scheduler misfire handling — missed cron jobs now catch up on re…
chore(enterprise): bump submodule pointer f5d69be6 → 7f40361 (ent#185) (