question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

invalid cron expression get passed in boto3.client("event").put_rule() function

See original GitHub issue

For example this invalid cron expression, cron(0/5, 9-18, ?, *, MON-FRI, *)

import boto3

client = boto3.client("events")
rule_name = "test"
cron_expression = "cron(0/5, 9-18, ?, *, MON-FRI, *)"
client.put_rule(
    Name=rule_name,
    ScheduleExpression=cron_expression,
    State='ENABLED',
)

if you run the code, there’s no exception reported about invalid cron expression, is this a new feature or a bug? if this is not a bug, then there’s a bug in the aws console, if I put this cronexpression, I would not get any samples.

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
stobrien89commented, Jan 7, 2022

Hi @HCharlie,

Just wanted to let you know that the events team has been working on this, but we don’t have a definitive fix as of yet. For the time being, I’m going to close this and open a new issue in our shared SDKs repository for tracking. Please let me know if you have any questions!

1reaction
stobrien89commented, May 21, 2021

Hi @HCharlie,

Thanks for reporting! I just tested and confirmed that you can pass the expression in both the console and the SDKs. This would be an issue with the EventBridge PutRule API— I can see they do some shape and value validation, but it looks like it’s not refined enough to catch something like this. I’ll reach out to determine whether or not this is expected behavior.

Read more comments on GitHub >

github_iconTop Results From Across the Web

EventBridge — Boto3 Docs 1.26.31 documentation - AWS
A low-level client representing Amazon EventBridge ... Region when an "unhealthy" state is encountered and events will be routed back to the primary...
Read more >
python - Boto3 cron: Parameter ScheduleExpression is not valid
I am trying to schedule event just after 15 ...
Read more >
PutRule - Amazon EventBridge - AWS Documentation
A single rule watches for events from a single event bus. Events generated by AWS services go to your account's default event bus....
Read more >
Chalice - Open Source at AWS
MINUTES)) def rate_obj_handler(event): pass @app.schedule(Cron(15, 10, '? ... Create a lambda function and configure it to be invoked whenever an event that ...
Read more >
Lambda Function Is Not Triggered Using Cron - ADocLib
Example of creating a function that runs as a cron job using the serverless schedule Receive an email, store in S3 bucket, trigger...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found