Skip to content

cron: TypeError: runningAtMs crash on gateway restart (race condition) #64137

@artdaal

Description

@artdaal

Summary

Cron scheduler crashes with TypeError: runningAtMs when the gateway restarts while a cron job is in the running state. Observed twice on 2026-04-09 (at 11:56 and 12:26 MSK), causing missed job runs.

Steps to Reproduce

  1. Have a cron job currently executing (runningAtMs is set in job state)
  2. Restart the gateway (e.g. via openclaw gateway restart)
  3. On startup, the scheduler processes the job state and crashes with TypeError related to runningAtMs

Expected Behavior

Gateway restart should gracefully handle jobs that were in-flight at the time of restart — either mark them as failed/interrupted or safely re-queue them.

Actual Behavior

Scheduler throws TypeError: runningAtMs and crashes, causing scheduled jobs to be skipped for that cycle.

Environment

  • OpenClaw: 2026.4.2 (d74a122)
  • Host: macOS Darwin 25.x (arm64)
  • Gateway mode: local

Impact

Medium — missed cron runs on every gateway restart if any job was executing at the time. Could affect daily digests, health checks, memory sync etc.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions