Skip to content

Gateway crashes at startup: NameError: name 'InProcessCronScheduler' is not defined (gateway/run.py start_gateway) #169

Description

@nicezic

Gateway crashes at startup with NameError: name 'InProcessCronScheduler' is not defined

Environment

  • Python 3.14.7 (uv-managed cpython)
  • Fresh managed install, cron enabled (default cron/ state in ~/.hermes)
  • Command: hermes gateway

Symptom

The gateway banner prints, adapters begin connecting, then the process crashes:

Traceback (most recent call last):
  File ".../hermes_cli/gateway.py", line 5371, in run_gateway
    success = asyncio.run(start_gateway(replace=replace, verbosity=verbosity))
  ...
  File ".../gateway/run.py", line 28757, in start_gateway
    isinstance(cron_provider, InProcessCronScheduler)
NameError: name 'InProcessCronScheduler' is not defined

Every gateway start with cron enabled crashes; messaging platforms never finish coming up.

Root cause

start_gateway() resolves the cron scheduler via:

from cron.scheduler_provider import resolve_cron_scheduler   # gateway/run.py:28741

but then references the class itself for two isinstance checks:

InProcessCronScheduler is only imported inside a different function scope (_start_cron_ticker, line 28166), so it is not visible here.

Fix

One line — import both symbols where they are used:

from cron.scheduler_provider import InProcessCronScheduler, resolve_cron_scheduler

PR follows.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions