-
Notifications
You must be signed in to change notification settings - Fork 5.7k
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
Issue in creating the Lambda invocation from S3 bucket #7536
Comments
Any news on this? We've had the following configuration work in production, and now that I'm redeploying, the deployment fails without any changes to the serverless.yml file:
Error we get is:
Tried updating the serverless framework to 1.67.3 but didn't help |
@tommedema thanks for report. It's hard for me to tell upfront what went wrong. It'll be great to obtain more debug information. If I read correctly error happens in custom resource lambda, and most likely crash occurs here:
It'll be nice to see exact payload that's rejected by AWS, having that we could probably drive a correct conclusion. Logging of custom resource lambda can be turned on via |
I don't know whether this is related or tangential, but we just removed a Lambda function that had an S3 event on it and attempted to deploy a different Lambda that had the same configuration. We're getting the same |
@kevlarr thanks for jumping in. Can you further clarify above part? |
@medikoo Yep, sorry about not including any detail. Assume I have two functions that respond to uploads in specific locations in the same bucket defined like...
Everything is fine; this works because the prefixes are different. If I go into S3 management console and look at that
And if I click "edit" I see the Lambda ARN pointing to each Lambda function. Now, assume that I need to deprecate
Deploying this will fail because, while it will tear down the Even if I attempt this across 2 deploys...
... it again fails, so it's not related to attempting the replacement of the Lambda function within the single deploy. When I inspect the S3 bucket's notifications, I still see the old event (even after just step #1 above) that points to an ARN for a Lambda that no longer exists. I can delete the notification manually and then deploy #2 above and it technically works, but it should be automated for (1) consistency, and (2) because we only have console access to 1 of 3 AWS accounts for a client, and now we need to instruct them to manually delete the notification, and getting that step wrong will break our application (the notifications are business-critical.) |
Okay, I think you can ignore me. I'm watching the verbose CF output right now and I'm seeing something similar to the following (with names changed)..
This is buried in the middle of other updates and it isn't causing the stack update to fail, so I simply never saw that Serverless had attempted (twice, actually) to remove the S3 event for the deleted Lambda. |
This is still an issue. We just had it again and I've created a screen recording with details here: https://app.usebubbles.com/7Gio7XbzsTteyHEXcM848M/comments-on-us-west-2-console-aws-amazon-com Basically, when the serverless framework creates a custom resource to handle the "existing" s3 bucket triggers, a next deployment may fail when the event rules have changed due to a false "overlapping events" error. In our case we removed all event triggers except one, and still had the issue (all described in above screen recording). |
Thanks Tom, indeed it helped and it worked fine for me.
On Mon, 6 Jul 2020 at 11:20 PM, Tom Medema ***@***.***> wrote:
This is still an issue.
We just had it again and I've created a screen recording with details here:
https://app.usebubbles.com/7Gio7XbzsTteyHEXcM848M/comments-on-us-west-2-console-aws-amazon-com
Basically, when the serverless framework creates a custom resource to
handle the "existing" s3 bucket triggers, a next deployment may fail when
the event rules have changed due to a false "overlapping events" error. In
our case we removed all event triggers except one, and still had the issue
(all described in above screen recording).
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#7536 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AKY3HLFCEOOGK7CF5T5IGTTR2IFFTANCNFSM4L2W43SQ>
.
--
Anshul Choudhary
|
Any news on this? Facing the same bug. |
@maxgr0 can you prepare some simple reproduction case? Ideally through a simple service with no plugins involved. |
Same here @medikoo, using
|
@cscetbon can you prepare a reproduction case? |
I just solved my issue by deleting the event notifications on the bucket that applied to my functions. |
A simple repro is:
I haven't dug into it a whole lot, but it seems like it only works when there's a new full stack created. Updated with sample setup.We are using serverless version 2.66.1. We do have the following plugins being used:
Here's a sample of what I'm running, this being just the # just to show I have two functions
my-first-function:
#... parameters omitted
my-function:
handler: src/handlers/my-function.handler
timeout: 60
events:
- s3:
bucket: my-existing-bucket
event: s3:ObjectCreated:*
existing: true Sample issue 2:After a successful deployment above (with the s3 trigger), commenting out the # just to show I have two functions
my-first-function:
#... parameters omitted
my-function:
handler: src/handlers/my-function.handler
timeout: 60
# events:
# - s3:
# bucket: my-existing-bucket
# event: s3:ObjectCreated:*
# existing: true In fact, the CLI outputs this message:
If I redeploy the entire app ( |
Hello @anshul1790 👋 The |
Issue in creating the Lambda invocation from S3 bucket
The requirement is to add a trigger in Lambda function on object creation in s3 bucket along with some VPC, s3 and cloud watch permissions, trying this using CF.
What did you do?
The fresh/initial deployment works fine with all new resources build like IAM role and associated policies, able to add new s3 bucket using CF and add an event trigger/invocation in Lambda from the same s3 bucket. On next/subsequent deployments, to skip the s3 bucket creation, I added in YAML: “existing: true”, from the official documentation of serverless deployment.
What happened?
It failed with below message: “Failed to create a resource. Configuration is ambiguously defined. Cannot have overlapping suffixes in two rules if the prefixes are overlapping for the same event type. See details in CloudWatch Log
What should've happened?
It should be redeployed my stack as I have changed anything
What's the content of your
serverless.yml
file?SLS_DEBUG=*
environment variable (e.g.SLS_DEBUG=* serverless deploy
)Similar or dependent issues:
The text was updated successfully, but these errors were encountered: