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

Creation of Input Folder in S3 Bucket Triggers First Lambda Invocation #330

Open
gmolto opened this issue Sep 5, 2019 · 0 comments
Open
Assignees

Comments

@gmolto
Copy link
Member

gmolto commented Sep 5, 2019

Initializing a SCAR function triggers the creation of the input S3 bucket (defined in the YAML) and the creation of the input folder, which results in triggering the s3:ObjectCreated event and, thus, performing the first invocation to the Lambda function, which results in an execution failure of the supervisor (since it is a folder, not a file):

Steps to reproduce this. YAML definition of a function:

functions:
  alucloud00-plants:
    image: deephdc/deep-oc-plant-classification-theano
    memory: 1024
    execution_mode: batch
    s3:
      input_bucket: alucloud00-iber
    init_script: bootstrap-plants.sh

CloudWatch logs of the function (for the first invocation):

2:19
START RequestId: f388accc-5fe3-439c-9115-d0c71129dab0 Version: $LATEST
08:02:19
2019-09-05 08:02:19,210 - supervisor - INFO - Storage event found.
08:02:19
2019-09-05 08:02:19,210 - supervisor - INFO - S3 event created
08:02:19
2019-09-05 08:02:19,211 - supervisor - INFO - Reading storage authentication variables
08:02:19
2019-09-05 08:02:19,211 - supervisor - INFO - SUPERVISOR: Initializing AWS Lambda supervisor
08:02:19
2019-09-05 08:02:19,212 - supervisor - INFO - Found 'S3' input provider
08:02:19
2019-09-05 08:02:19,212 - supervisor - INFO - Downloading input file using 'S3' event
08:02:19
2019-09-05 08:02:19,212 - supervisor - INFO - Downloading item from bucket 'alucloud00-iber' with key 'alucloud00-plants/input/'
08:02:19
[Errno 21] Is a directory: '/tmp/tmp_uolgwjp/': IsADirectoryError Traceback (most recent call last): File "/var/task/alucloud00-plants.py", line 21, in lambda_handler return supervisor.main(event=event, context=context) File "/opt/python/faassupervisor/supervisor.py", line 138, in main return supervisor.run() File "/opt/python/faassupervisor/exceptions.py", line 30, in wrapper re
08:02:19
END RequestId: f388accc-5fe3-439c-9115-d0c71129dab0
08:02:19
REPORT RequestId: f388accc-5fe3-439c-9115-d0c71129dab0	Duration: 3.95 ms	Billed Duration: 100 ms	Memory Size: 1024 MB	Max Memory Used: 68 MB	Init Duration: 249.15 ms	XRAY TraceId: 1-5d70c10a-7576d5e97aa0bc585b01f307	SegmentId: 50e475aa6ab569e3	Sampled: false

If the creation of the input folder is done before creating the Lambda function (or at least) before defining the bucket as the event source for the Lambda function may solve this.

@alpegon alpegon self-assigned this Sep 5, 2019
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

2 participants