Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Invalid CRON expression cron(* ? * * * *) #261

Open
zsidez opened this issue Jan 4, 2024 · 6 comments
Open

Invalid CRON expression cron(* ? * * * *) #261

zsidez opened this issue Jan 4, 2024 · 6 comments
Labels
bug triaged Has been triaged by solutions team

Comments

@zsidez
Copy link

zsidez commented Jan 4, 2024

Is this a valid cron expression? cron(* ? * * * *)

EventBridge's Define schedule shows error: Invalid CRON expression

Latest version (v4.0.2) of Security Automation still have this setting

Originally posted by @zsidez in #186 (comment)

@abewub abewub added bug triaged Has been triaged by solutions team labels Jan 10, 2024
@abewub
Copy link
Member

abewub commented Jan 10, 2024

Thanks for reporting. Will be fixed in the next release.

@aijunpeng
Copy link
Member

@zsidez cron(* ? * * * *)defines a job that runs at the top of the hour. How did you get the error? Please provide steps to reproduce.

@zsidez
Copy link
Author

zsidez commented Mar 18, 2024

@aijunpeng This is how it will be at the beginning of the hour: cron(0 * ? * * *) or cron(0 * * * ? *)

Can't put question mark ? at any position. Allowed only for Day-of-month and Day-of-week

To reproduce can open created(or create new) events bridge rule in aws console:

EventBridge's Define schedule shows error: Invalid CRON expression

@zsidez
Copy link
Author

zsidez commented Mar 18, 2024

eventbridge-rules-edit

@zsidez
Copy link
Author

zsidez commented Mar 18, 2024

Also I suggest to run this add_athena_partitions job not at the top of the hour. But every minute. To be sure that partition is created.

Current code that adds partition already doesn't add it if partition exists: ALTER TABLE ... ADD IF NOT EXISTS PARTITION . So every minute should work

So cron can be: cron(* * * * ? *)

@aijunpeng
Copy link
Member

Thanks for providing more information. I've validated that cron(* ? * * * *) works fine in CFN template. So if you deploy the solution template, there won't be an issue. However for some reason (could be due to some service change) it doesn't work on AWS console any more. If you want to update the expression via the console, please enter the correct cron expression to pass the error. We have added this issue to our backlog and will address it in future release. I am not experiencing any problem with running hourly query to add hourly partition on my end though.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug triaged Has been triaged by solutions team
Projects
None yet
Development

No branches or pull requests

3 participants