Skip to content
This repository has been archived by the owner on Jan 2, 2025. It is now read-only.

Lambda is not triggered if S3 server was already started by another serverless project sharing the same S3 service with noStart=true attribute #91

Open
amar02041988 opened this issue Mar 28, 2020 · 1 comment

Comments

@amar02041988
Copy link

amar02041988 commented Mar 28, 2020

Suppose if we have two serverless project Project 1 and 2.
Project 1: Executed with serverless-offline and starts the S3 server
Project 2: In serverless.yml, custom section, noStart=true. This will ensure that it will reuse the s3 server started by Project 1. This project contains a lambda with an S3 bucket trigger even source mapping.

When an object is pushed in bucket, lambda defined in project 2 is not triggered.
However, if we remove the noStart=true and start the project 2 before project 1. Lambda of Project 2 gets triggered.

This means lambda will not be triggered if S3 server was started by some other project, although the S3 is shared accross all the project using noStart=true in other projects.

When we execute the project 2(which has noStarts=true) and if it contains any s3 event source mappings with lambda in function section of serverless.yml, then we CANNOT see a line in log:

Serverless: Found S3 event listener for

But this line appear if S3 server was started by project 2 itself by executing it before project 1.

@amar02041988 amar02041988 changed the title Lambda is not triggered in S3 server was already started by another serverless project Lambda is not triggered if S3 server was already started by another serverless project sharing the same S3 service with noStart=true attribute Mar 28, 2020
@ar90n
Copy link
Owner

ar90n commented Mar 29, 2020

Hi @amar02041988 .
Thanks for your comment. And I’m sorry for your inconvenience.
serverless-s3-local doesn’t support noStart option and S3 event at the same time.
Because serverless-s3-local assigns its event handlers to S3 server at the launching.
If you don’t mind, please try to collect all event handlers into one serverless.yml.

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

No branches or pull requests

2 participants