Skip to content

[Bug] v2026.6.6: Cron scheduler loads 0 jobs after upgrade — SQLite WAL not committed at first startup #93032

Description

@Haderach-Ram

Summary

After upgrading to v2026.6.6, the cron scheduler initialises with 0 jobs in memory even though state/openclaw.sqlite contains the correct job count in cron_jobs. The cron list tool returns an empty array. A second restart (bootout + bootstrap) fixes the issue.

Environment

  • OpenClaw v2026.5.28 → v2026.6.6
  • macOS, multi-agent fleet
  • LaunchAgent-managed gateway processes

Steps to Reproduce

  1. Upgrade from v2026.5.28 to v2026.6.6
  2. Restart gateway (launchctl bootout + bootstrap)
  3. cron list returns {"jobs": []} (0 jobs)
  4. Direct SQLite query confirms jobs are present: SELECT COUNT(*) FROM cron_jobs; → 73
  5. Second hard restart → cron list now returns all 73 jobs correctly

Root Cause (suspected)

The v2026.6.6 migration runs synchronously during startup, writing jobs to SQLite's WAL file. The cron scheduler initialises before the WAL is checkpointed into the main database file. The in-process SQLite connection sees the pre-migration state (0 jobs); the WAL is invisible to the scheduler at the moment it reads.

On the second restart, the WAL has been checkpointed and the scheduler sees the full job list.

Verified: After running PRAGMA wal_checkpoint(TRUNCATE) manually, the jobs were visible in external SQLite queries, but the running process still returned 0 via the cron API — confirming the issue is the in-memory scheduler state, not the on-disk data.

Workaround

Do a second hard restart after upgrade:

launchctl bootout gui/501/ai.openclaw.gateway
sleep 5
launchctl bootstrap gui/501 ~/Library/LaunchAgents/ai.openclaw.gateway.plist

\n## Expected Behaviour

After a single restart, the scheduler should correctly load all migrated cron jobs from SQLite.

Impact

  • All cron jobs (transcript loggers, memory consolidation, heartbeats) fail to fire after upgrade
  • No error is reported — cron list returns empty, gateway is healthy
  • Requires operator awareness to diagnose and a second restart to fix

Affected Versions

  • v2026.6.6 (confirmed)

Metadata

Metadata

Assignees

Labels

P1High-priority user-facing bug, regression, or broken workflow.clawsweeper:needs-live-reproClawSweeper needs live local, crabbox, or manual validation to confirm this issue.clawsweeper:needs-maintainer-reviewClawSweeper marked this issue as needing maintainer review before automation.clawsweeper:no-new-fix-prClawSweeper does not recommend queueing a new automated fix PR for this issue.impact:message-lossChannel message delivery can be lost, duplicated, or misrouted.impact:session-stateSession, memory, transcript, context, or agent state can drift or corrupt.issue-rating: 🐚 platinum hermitGood issue quality with a plausible reproduction path needing some confirmation.

Type

No type

Fields

Priority

None yet

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions