Repository navigation
Description
After updating OpenClaw (from ~2026.5.x to 2026.6.1), all cron jobs disappear from the cron list API. The old JSON file at ~/.openclaw/cron/jobs.json still exists with all job configurations intact, but the new SQLite-backed store at ~/.openclaw/state/openclaw.sqlite has an empty cron_jobs table. Jobs are effectively lost despite the config file persisting on disk.
Root cause
OpenClaw 2026.6.1 switched cron job storage from a plain JSON file (~/.openclaw/cron/jobs.json) to a SQLite database (~/.openclaw/state/openclaw.sqlite, table cron_jobs). The upgrade path does not migrate the JSON contents into the new database — the cron_jobs table exists but is empty after update.
Evidence
Before update:
- Cron jobs stored in
~/.openclaw/cron/jobs.json(text file) - Runtime state in
~/.openclaw/cron/jobs-state.json
After update (2026.6.1):
~/.openclaw/cron/jobs.jsonstill exists with all job configs (unmigrated)~/.openclaw/state/openclaw.sqlitehas acron_jobstable — 0 rowscron listAPI returns emptyopenclaw cron listCLI returns "No cron jobs."
Steps to reproduce
- Create cron jobs via
cron add(stores to~/.openclaw/cron/jobs.json) - Update OpenClaw to 2026.6.1+
- Restart gateway
- Run
cron list— jobs are gone - Check
~/.openclaw/cron/jobs.json— jobs are still there - Check
~/.openclaw/state/openclaw.sqlite→cron_jobstable — empty
Affected versions
2026.6.1+ (transition to SQLite-backed cron store)
Suggested fix
On startup (or during upgrade), the cron store loader should detect if the SQLite cron_jobs table is empty but ~/.openclaw/cron/jobs.json exists with job data, and import those jobs into the database. Alternatively, maintain backward compatibility by checking the JSON file when the SQLite store is empty.
Workaround (manual)
Recreate jobs via cron add using the config data from ~/.openclaw/cron/jobs.json.
Metadata
Metadata
Assignees
Labels
Type
Fields
Priority
Activity
clawsweeper commentedon Jun 8, 2026
Thanks for the context here. I did a careful shell check against current
main, and this is already implemented.Current main already fixes the reported cron JSON-to-SQLite upgrade gap through the shared CLI/doctor preflight migration path; the fix is main-only after v2026.6.1 and has focused regression coverage.
So I’m closing this as already implemented rather than keeping a duplicate issue open.
Review details
Best possible solution:
Keep the current doctor/preflight import path on main and ship it in the next release; avoid adding a steady-state runtime JSON fallback reader.
Do we have a high-confidence way to reproduce the issue?
Yes. The high-confidence source path is a v2026.6.1 install with legacy cron JSON rows and empty SQLite cron rows; current main adds regression coverage for importing those legacy rows into SQLite.
Is this the best way to solve the issue?
Yes. The current fix uses the shared CLI/doctor preflight migration path, which matches the repository policy that legacy state migration belongs in doctor/preflight instead of runtime fallback readers.
Security review:
Security review: Non-PR issue triage; no patch security review applies.
AGENTS.md: found and applied where relevant.
What I checked:
src/cli/program/config-guard.ts:173, da401341b685)src/commands/doctor-config-preflight.ts:185, da401341b685)src/commands/doctor/cron/index.ts:107, da401341b685)src/commands/doctor/cron/index.test.ts:446, da401341b685)src/commands/doctor-config-preflight.ts:185, 66b91d78feb3)Likely related people:
src/cli/program/config-guard.ts,src/commands/doctor-config-preflight.ts,src/commands/doctor/cron/index.ts)Codex review notes: model gpt-5.5, reasoning high; reviewed against da401341b685; fix evidence: commit 66b91d78feb3, main fix timestamp 2026-06-07T12:45:43+02:00.