Skip to content

Bug: Cron scheduler timer never fires — every-type and all jobs affected #10849

@jh280722

Description

@jh280722

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:

  1. every-type jobs: computeNextRunAtMs always returns a future timestamp, so runDueJobs never 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.

  2. All job types (including cron expressions): Even after converting all every-type jobs to cron expressions as a workaround, the scheduler's onTimer callback never fires. The scheduler reports enabled: true with a valid nextWakeAtMs, but when that time passes, no jobs execute.

Steps to Reproduce

  1. Configure several cron jobs (mix of every and cron expression types)
  2. Observe that every-type jobs never execute (known issue)
  3. Convert all every-type jobs to cron expressions
  4. Restart gateway (both SIGUSR1 and full systemd restart attempted)
  5. Run cron status — shows enabled: true, valid nextWakeAtMs
  6. Wait past nextWakeAtMs — no jobs execute
  7. cron runs shows no new entries after restart
  8. cron run <jobId> --force works (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 anchorMs and everyMs
  • Always returns a future timestamp relative to Date.now()
  • When onTimerensureLoaded(forceReload: true)recomputeNextRuns is called, it recalculates all nextRunAtMs values
  • This pushes every-type jobs perpetually into the future
  • runDueJobs (which checks nextRunAtMs <= now) never finds them due

Issue 2: Timer never fires

After converting all jobs to cron expressions:

  • cron status reports valid state with proper nextWakeAtMs
  • Gateway logs show the cron module starting with different nextWakeAtMs values on restart
  • But onTimer is 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 everycron 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

  1. every-type jobs should execute at their configured intervals
  2. cron expression jobs should execute when their schedule matches
  3. The scheduler timer should reliably fire at nextWakeAtMs

Related Issues

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 --force flag

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions