-
-
Notifications
You must be signed in to change notification settings - Fork 54.3k
Description
Bug: Cron scheduler timer never fires — every-type and all jobs affected
Environment
- OpenClaw version: 2026.2.6 (also reproduced on 2026.2.3-1)
- OS: Linux 6.14.0-37-generic (x64)
- Node: v25.5.0
Summary
The cron scheduler's timer mechanism is fundamentally broken in 2026.2.6. Two related but distinct issues:
-
every-type jobs:computeNextRunAtMsalways returns a future timestamp, sorunDueJobsnever finds them due. This is the known bug from [Bug]: CRON jobs not executing at scheduled time with upgrade to 2026.2.3-1 #10812 / Cron scheduler advances nextRunAtMs but doesn't execute jobs #10655. -
All job types (including
cronexpressions): Even after converting allevery-type jobs tocronexpressions as a workaround, the scheduler'sonTimercallback never fires. The scheduler reportsenabled: truewith a validnextWakeAtMs, but when that time passes, no jobs execute.
Steps to Reproduce
- Configure several cron jobs (mix of
everyandcronexpression types) - Observe that
every-type jobs never execute (known issue) - Convert all
every-type jobs tocronexpressions - Restart gateway (both SIGUSR1 and full systemd restart attempted)
- Run
cron status— showsenabled: true, validnextWakeAtMs - Wait past
nextWakeAtMs— no jobs execute cron runsshows no new entries after restartcron run <jobId> --forceworks (bypasses due-check), confirming jobs themselves are valid
Root Cause Analysis
Issue 1: every-type computeNextRunAtMs
In gateway-cli-c_8Yf5s6.js (lines ~2925-2945), computeNextRunAtMs for every kind:
- Calculates intervals based on
anchorMsandeveryMs - Always returns a future timestamp relative to
Date.now() - When
onTimer→ensureLoaded(forceReload: true)→recomputeNextRunsis called, it recalculates allnextRunAtMsvalues - This pushes
every-type jobs perpetually into the future runDueJobs(which checksnextRunAtMs <= now) never finds them due
Issue 2: Timer never fires
After converting all jobs to cron expressions:
cron statusreports valid state with propernextWakeAtMs- Gateway logs show the cron module starting with different
nextWakeAtMsvalues on restart - But
onTimeris never actually invoked when the wake time arrives - No log entries for
runDueJobs,armTimer, or any timer-firing events - Gateway shows timeout errors on
ws://127.0.0.1:18789(60000ms) which may indicate a broken internal connection preventing scheduler operation
Workarounds Attempted
| Workaround | Result |
|---|---|
Converting every → cron expressions |
❌ Did NOT fix auto-execution |
cron wake --mode now |
❌ No effect |
| Full gateway restart (systemd) | ❌ No effect |
| OpenClaw update (2026.2.3-1 → 2026.2.6) | ❌ Same behavior |
cron run <id> --force |
✅ Works (bypasses due-check) |
Only viable workaround: external system crontab calling openclaw cron run --force
Expected Behavior
every-type jobs should execute at their configured intervalscronexpression jobs should execute when their schedule matches- The scheduler timer should reliably fire at
nextWakeAtMs
Related Issues
- [Bug]: CRON jobs not executing at scheduled time with upgrade to 2026.2.3-1 #10812 (Open) —
every-type cron bug - Cron scheduler advances nextRunAtMs but doesn't execute jobs #10655 (Closed) — related cron scheduling issue
Impact
- 12 cron jobs completely non-functional for 7+ hours
- Includes investment analysis, marketing automation, coding agent, and daily briefings
- All automated workflows halted; requires manual intervention with
--forceflag