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

Zappa doesn't report if it fails to add a event source that is already listened-to #506

Open
horenmar opened this issue Dec 1, 2016 · 7 comments

Comments

@horenmar
Copy link
Contributor

horenmar commented Dec 1, 2016

I had a zappa_settings.json with this event source (the bucket name is fake obviously).

"event_source": {
    "arn":  "arn:aws:s3:::bucket-name",
    "events": [
        "s3:ObjectCreated:*"
    ]
}

by mistake, I specified a bucket that already was used as event source for a different lambda.

Because AWS S3 does not support sending more than one event per uploaded file (multiple notifications can be set for a bucket, but they must not overlap), setting this event source as a trigger for the lambda fails, but zappa reports successful deployment.

I would expect/like zappa to abort the deployment with some error message.

@Miserlou
Copy link
Owner

Miserlou commented Dec 1, 2016

+1, excellent bug. Was there a warning, or anything at all, in the output?

Do you want to submit a Pull Request for this?

@horenmar
Copy link
Contributor Author

horenmar commented Dec 2, 2016

Zappa outputs this
s3:ObjectCreated:* event schedule for archiver.lambda_handler already exists - Nothing to do here. when this happens. When overwriting actual event source for given lambda, it writes the same message as when creating it for the first time, that is Created s3:ObjectCreated:* event schedule for archiver.lambda_handler!.

I don't have a PR and I am not sure when I can get around to fixing this.

@horenmar
Copy link
Contributor Author

horenmar commented Dec 3, 2016

Upon little investigations, the problem is in schedule_events in zappa.py, where if the response to rule creating is exists, its assumed to be okay. However, this whole if - elif chain is a bit weird, as even return status of failed lets the deployment keep going, with only a single line printed to stdout notifying user of the problem.

@boarik
Copy link

boarik commented Aug 5, 2018

Hi,

Sorry to bring up the past here but was this issue ever solved?

We recently encountered it while deploying to one of our production functions. The result was that the lambda function was updated, but as far as I understand it, the ObjectCreated* event wasn't recreated with it, which lead to the updated lambda to not being invoked.

Specifically, for working updates I see these CLI output lines:

Removed event handler.handler_main ([u's3:ObjectCreated:*']).
Created s3:ObjectCreated:* event schedule for handler.handler_main!

But for the update that resulted in the issue I saw this output:

Removed event handler.handler_main ([u's3:ObjectCreated:*']).
s3:ObjectCreated:* event schedule for handler.handler_main already exists - Nothing to do here.

Appreciate your feedback,
Thanks

@maheshmadhusudanan
Copy link

Any way to reuse the trigger for the same bucket or clear the settings?

@NickCellino
Copy link

Seems like this has not been resolved. I'm experiencing the same behavior as @boarik

@mchagas90
Copy link

Actually if you have any error creating the event the deploy won't stop...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants