- Newest
- Most votes
- Most comments
For quick troubleshooting, you could check the CloudWatch Metrics for your Lambda function and setting the graph for 1-minute intervals. Look at "Invocations" specifically to see if an invocation appeared to happen at all when a file was uploaded and no sign of the Lambda having executed was observed. Then look at the "Errors" and "Throttles" metrics to see if something is obviously failing.
Aside from the quick troubleshooting, a more robust way to construct this setup would be to have EventBridge filter the events from S3 and send them to your own SQS queue (backed by a dead-letter queue, DLQ). You could then set that custom SQS queue to trigger your Lambda. The built-in integration between SQS and Lambda will naturally take care of governing concurrency for your Lambda function, perform retries in a way that you can configure, and give you visibility and metrics into events arriving in SQS and how long they wait there to be processed. The DLQ for the custom SQS queue would also give you a reliable means to catch any completely failing invocations and hold them for up to 14 days for troubleshooting and possibly attempting to process again later.
Hello.
Does it happen often that Lambda is not triggered?
The document below stated that it could take more than a minute to trigger.
So, is it possible that it's just taking time?
https://docs.aws.amazon.com/AmazonS3/latest/userguide/EventNotifications.html
Amazon S3 event notifications are designed to be delivered at least once. Typically, event notifications are delivered in seconds but can sometimes take a minute or longer.
Hello, thank you for your reply!
It happens ~5% of the successful uploads. The lambda does not trigger after some time, unfortunately, so it is not due to that. One of the successful uploads that did not trigger the lambda is 40minutes ago for example.
Do you have any other suggestions?
Relevant content
- asked a year ago
- AWS OFFICIALUpdated a year ago
- AWS OFFICIALUpdated 2 years ago
- AWS OFFICIALUpdated 2 months ago
Thank you for the tips on the quick troubleshooting! This troubleshooting has been helpful, since it showed that the lambda seems to be invoked for every file that has been uploaded successfully. Also, no Errors and Throttles are observed.
This pointed me to the root cause; another process running on the raspberry pi that creates items in DDB as well. In some cases, the lambda finishes storing its data faster than that process. Then that process overwrote the already-present item in DDB, causing it to miss data.
Thanks again for your reply!