https://dagster.io/ logo
#announcements
Title
# announcements
p

Paul Wyatt

02/12/2021, 7:53 PM
I've got schedules running successfully in 0.10 , but the actual schedule page is showing a croniter error
Copy code
Operation name: RunsRootQuery

Message: failed to find prev date

Path: ["repositoriesOrError","nodes",1,"schedules",1,"futureTicks"]

Locations: [{"line":183,"column":3}]

Stack Trace:
  File "/usr/local/lib/python3.6/dist-packages/graphql/execution/executor.py", line 452, in resolve_or_error
    return executor.execute(resolve_fn, source, info, **args)
  File "/usr/local/lib/python3.6/dist-packages/graphql/execution/executors/sync.py", line 16, in execute
    return fn(*args, **kwargs)
  File "/usr/local/lib/python3.6/dist-packages/dagster_graphql/schema/schedules/schedules.py", line 96, in resolve_futureTicks
    tick_times.append(next(time_iter).timestamp())
  File "/usr/local/lib/python3.6/dist-packages/dagster/utils/schedules.py", line 20, in schedule_execution_time_iterator
    date_iter.get_prev(datetime.datetime)
  File "/usr/local/lib/python3.6/dist-packages/croniter/croniter.py", line 133, in get_prev
    return self._get_next(ret_type or self._ret_type, is_prev=True)
  File "/usr/local/lib/python3.6/dist-packages/croniter/croniter.py", line 210, in _get_next
    nth_weekday_of_month, is_prev)
  File "/usr/local/lib/python3.6/dist-packages/croniter/croniter.py", line 479, in _calc
    raise CroniterBadDateError("failed to find prev date")
Any advice?
d

daniel

02/12/2021, 8:10 PM
Hi Paul, could you share your cron string?
(Assuming you're using @schedule and a custom cronstring - if not this bug is even more surprising 🙂 )
p

Paul Wyatt

02/12/2021, 8:55 PM
Full suite of cron strings:
Copy code
"5 22 * * *"
"5 17 * * *"
"10 17 * * *"
"*/5 * * * *"
"0 0 31 2 *"
"30 17 * * *"
"0 0 31 2 *"
"30 16 * * *"
d

daniel

02/12/2021, 8:56 PM
hmmm, nothing too out-of-the-ordinary there, I'll see if I can repro
p

Paul Wyatt

02/12/2021, 8:58 PM
^sorry hit enter too soon. There are invalid dates (that are valid cronstrings according to croniter) in the form of Feb 31st, but I don't think that's the issue
d

daniel

02/12/2021, 8:59 PM
ah, if I had to hazard a guess, I bet it's the ones that have day of the month=31? What's the intention for how those should behave during months with fewer than 31 days?
or, ok, rather, what's the intention for how the 2/31 one should behave?
p

Paul Wyatt

02/12/2021, 8:59 PM
It's a placeholder for a schedule that shouldn't run yet
I suspect the issue is that the feb 31 are replacing previously invalid "" cron strings that were simply dropped silently in dagster 0.9
d

daniel

02/12/2021, 9:02 PM
Yeah, I think that's it as well. We just added some more validation on cron strings, but it looks like croniter doesn't throw on the 2/31 string until you try to use it to actually calcualte a date.
While we sort that out, is leaving the schedule off an option here to keep it from running? Or setting the should_execute field to always be False?
(rather than setting it to 2/31)
p

Paul Wyatt

02/12/2021, 9:04 PM
I can see if dropping those schedules resolves the error
d

daniel

02/12/2021, 9:04 PM
I was able to reproduce the problem by adding a schedule at 2/31, so I'm optimistic that that'll work
p

Paul Wyatt

02/12/2021, 9:15 PM
👍 thank you, instance is rebuilding
(it did fix the issue. we can find another route to our non-schedules)
d

daniel

02/12/2021, 9:51 PM
awesome. we'll see if we can detect that cronstring earlier rather than erroring out in graphql