croniter.croniter.CroniterBadCronError: invalid range: range() arg 3 must not be zero

Hi, I’m seeing this error in the logs.

Traceback (most recent call last):
  File "/home/frappe/frappe-bench/apps/frappe/frappe/utils/scheduler.py", line 67, in enqueue_events_for_site
    enqueue_events(site=site)
  File "/home/frappe/frappe-bench/apps/frappe/frappe/utils/scheduler.py", line 88, in enqueue_events
    frappe.get_doc('Scheduled Job Type', job_type.name).enqueue()
  File "/home/frappe/frappe-bench/apps/frappe/frappe/core/doctype/scheduled_job_type/scheduled_job_type.py", line 25, in enqueue
    if self.is_event_due():
  File "/home/frappe/frappe-bench/apps/frappe/frappe/core/doctype/scheduled_job_type/scheduled_job_type.py", line 42, in is_event_due
    return self.get_next_execution() <= (current_time or now_datetime())
  File "/home/frappe/frappe-bench/apps/frappe/frappe/core/doctype/scheduled_job_type/scheduled_job_type.py", line 67, in get_next_execution
    get_datetime(self.last_execution or datetime(2000, 1, 1))).get_next(datetime)
  File "/home/frappe/frappe-bench/env/lib/python3.6/site-packages/croniter/croniter.py", line 91, in __init__
    self.expanded, self.nth_weekday_of_month = self.expand(expr_format)
  File "/home/frappe/frappe-bench/env/lib/python3.6/site-packages/croniter/croniter.py", line 523, in expand
    'invalid range: {0}'.format(exc))
croniter.croniter.CroniterBadCronError: invalid range: range() arg 3 must not be zero

Any idea what it is?

Facing Same issue

Traceback (most recent call last):
File “env/lib/python3.10/site-packages/croniter/croniter.py”, line 772, in _expand
rng = range(low, high + 1, step)
ValueError: range() arg 3 must not be zero

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File “apps/frappe/frappe/desk/doctype/system_health_report/system_health_report.py”, line 57, in wrapper
return func(*args, **kwargs)
File “apps/frappe/frappe/desk/doctype/system_health_report/system_health_report.py”, line 221, in fetch_scheduler
if job_type.is_event_due():
File “apps/frappe/frappe/core/doctype/scheduled_job_type/scheduled_job_type.py”, line 90, in is_event_due
return self.get_next_execution() <= (current_time or now_datetime())
File “apps/frappe/frappe/core/doctype/scheduled_job_type/scheduled_job_type.py”, line 127, in get_next_execution
next_execution = croniter(self.cron_format, last_execution).get_next(datetime)
File “env/lib/python3.10/site-packages/croniter/croniter.py”, line 190, in init
self.expanded, self.nth_weekday_of_month = self.expand(
File “env/lib/python3.10/site-packages/croniter/croniter.py”, line 851, in expand
return cls._expand(expr_format, hash_id=hash_id,
File “env/lib/python3.10/site-packages/croniter/croniter.py”, line 774, in _expand
raise CroniterBadCronError(
croniter.croniter.CroniterBadCronError: invalid range: range() arg 3 must not be zero