0
votes

I am getting below response when I hit AWS API gateway.

502: Bad Gateway

{
    "message": "Internal server error"
}

I know that API gateway request payload limit is 10MB and I haven't exceeded that, but response size might be beyond 10 MB. Can response size affect?

Could find nothing in CloudWatch, not even getting logs related to this invocation.

Tried to follow this, but could find nothing.

1
If you cannot find even logs of this invocation then it's not a problem in response size. Were you looking just for AWS Lambda logs, or API Gateway logs as well? If you don't have those already, turning on the API gateway execution logs can help. One very likely cause can be that your API gateway doesn't have proper rights to invoke your Lambda function (especially if you have multiple aliases, this can easily happen)Caldazar
@Caldazar turns out that lambda response size limit is 6 MB and actual response was exceeding this limit. Was not getting logs stating so on test setup I was trying to debug this issue on, so I replicated the same on my own account and came to find this 6MB limit.Kartik73

1 Answers

0
votes

First, Try to test your lambda function by invoking it in the api gateway Console or in the test part in the lambda console. If the lambda function works, then maybe its a problem related to the parameters, content ( Integration request / response) or the permissions of the API Gateway + lambda.

Check also the time out of the lambda /!\