Open BroderPeters opened 9 months ago
Thank you for opening your first issue here! ๐
๐ค
Hey @BroderPeters, back again to keep us on our toes, huh? ๐ Always a pleasure seeing your name pop up here!
The error you're encountering is likely due to the fact that the cron expression 0 6 * * MON#1
is not supported by the cron parser used in Flyte. The #
symbol is not a standard cron expression and is not mentioned in the cron implementation described in the comments of the CronSchedule
message in the schedule.proto
file.
The cron implementation used by Flyte is based on the standard cron as described by Wikipedia and also supports nonstandard predefined scheduling definitions as described by Amazon CloudWatch, except @reboot
.
To resolve this issue, you have two options:
Modify your cron expression to fit the supported format. For example, if you want to schedule a job for the first Monday of every month at 6:00, you could use a cron expression like 0 6 1-7 * MON
. This will schedule the job to run at 6:00 on Monday, but only if the date is between the 1st and the 7th, effectively ensuring that it runs on the first Monday of the month.
If you need to use the #
symbol or other non-standard cron expressions, you would need to modify the cron parser used by Flyte to support these expressions. This would involve changing the source code of Flyte and may not be feasible depending on your situation.
Please note that any changes to the cron parser would need to be thoroughly tested to ensure they don't introduce any new issues. You can find more information about the cron parser used by Flyte in the schedule.proto file.
After some triaging I found out:
flyteadmin/scheduler/schedule_executor.go
is delegating cron expression parsing to the library robfig/cron
robfig/cron
is no more maintained since ca. Jan.2020unionai/cron
(see go.mod file)robfig/cron
has plenty of bug-fixes as open PRs, e.g. there is one to add the 'day of week in a month' feature, see https://github.com/robfig/cron/pull/394My recommendation:
Reasoning
robfig/cron
is no more maintained, and the replacement used neitherInterested please assign
Close with https://github.com/flyteorg/flyte/pull/5951
Describe the bug
Cron expressions like
0 6 * * MON#1
are currently able to being registered, display and executed, but flytescheduler produces the following error logs:Which according to the flyte docs should also be the expected behavior, as the
#
symbol is not listed here. Generally,#
is used for the nth occurrence of a day of a week in a month.From a discussion in the community slack
Expected behavior
Either cron expression that don't fit the allowed symbols from the docs are properly validated while registering the launch plan or expressions with symbols like
#
are also supported in the flytescheduler validation.Additional context to reproduce
Used Launchplan:
Screenshots
Are you sure this issue hasn't been raised already?
Have you read the Code of Conduct?