Sporadic 502 Errors with Lambda and API Gateway

0

Hi, I have my Express "server" (serverless routes) configured in AWS Lambda behind API Gateway, with the Lambda having 20 units of provisioned concurrency to prevent cold starts. My API serves our Android and iOS mobile apps and our web backend. Often, on seemingly random requests, I get a 502 failed to fetch response. I don't believe I have the timeout set to anything crazy low that would be causing this, and it shouldn't be the status code it returns as the same request works upon refresh of the web app, as an example (retrying the request). It almost seems like this happens when there is less server volume rather than more. Thanks.

1 Answer
0

Hi,

Please, read this KC article about 502 errors with API GTW: https://repost.aws/knowledge-center/malformed-502-api-gateway

It details possible causes and provides solutions to fix.

Best,

Didier

profile pictureAWS
EXPERT
answered 2 months ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions