Using invoke to call another lambda function always timeout.
See original GitHub issueHello,
Apologies if this is not the right place to file this issues. But please let me try to explain my situation.
I have an API Gateway that can successfully call a lambda function. This lambda function base on a certain condition should invoke another lambda function. The code is very simple:
import boto3, json, logging
logger = logging.getLogger()
logger.setLevel(logging.INFO)
client = boto3.client('lambda')
def lambda_handler(event, context):
raw_event = event.get('body')
if raw_event.get('event') == "voicecall_final":
# trigger the next lambda function
res = client.invoke(
FunctionName='aggregate',
InvocationType='RequestResponse',
Payload=json.dumps({'engagement_id': raw_event.get('engagement_id')})
)
However I can’t seem to reach other function, the other function is just printing the payload for now. I cannot even get the res
variable. Here are the logs:
START RequestId: 21583ec8-a737-11e6-8d5b-a76626b2b591 Version: $LATEST
[INFO] 2016-11-10T11:16:30.994Z 21583ec8-a737-11e6-8d5b-a76626b2b591 Starting new HTTPS connection (1): lambda.us-west-2.amazonaws.com
END RequestId: 21583ec8-a737-11e6-8d5b-a76626b2b591
REPORT RequestId: 21583ec8-a737-11e6-8d5b-a76626b2b591 Duration: 3002.54 ms Billed Duration: 3000 ms Memory Size: 128 MB Max Memory Used: 22 MB
2016-11-10T11:16:33.977Z 21583ec8-a737-11e6-8d5b-a76626b2b591 Task timed out after 3.00 seconds
This is running under a VPC and I set the security group to accept all inbound and outbound connection. I use arn:aws:iam::aws:policy/AWSLambdaFullAccess
manage role for both of them.
Am I missing something here?
Issue Analytics
- State:
- Created 7 years ago
- Comments:7 (1 by maintainers)
Top Results From Across the Web
AWS Lambda timeout when another (long) Lambda is invoked
If I'd create a Lambda function with say 5 mins function execution timeout, and invoke it using AWS CLI using RequestResponse (synchronous) ...
Read more >Troubleshoot Lambda function retry and timeout issues when ...
When I invoke my AWS Lambda function using an AWS SDK, the function times out, the API request stops responding, or an API...
Read more >Lambda Functions in a VPC Timeout When Trying to Invoke ...
When the AWS SDK in a Lambda function inside a VPC tries to invoke another Lambda function, it's trying to send an HTTP...
Read more >Lambda Task Timed Out After X Seconds - Dashbird
The default timeout of a Lambda function is three seconds. This means, if you don't explicitly configure a timeout, your function invocations ...
Read more >AWS Lambda Timeout Best Practices - Lumigo
Use short timeout limits for event sources – set timeout to 3-6 seconds for API calls. · Monitor Lambda function timeouts – put...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I am running Lambda as Kinesis consumer and invoking function in itself.
@jgardezi as it turns out, my problem was I was running it on a public subnet, and lambda doesn’t have an elastic ip to use internet gateway. So switching to private subnet with a nat solves my problem. I hope that helps you or have more clue about your problem.