- Newest
- Most votes
- Most comments
Hi
Error 504 Indicates that the load balancer closed a connection because a request did not complete within the idle timeout period. You can increase the idle timeout following guideline on this document[1]https://docs.aws.amazon.com/elasticloadbalancing/latest/classic/config-idle-timeout.html
Troubleshooting steps for API Gateway Network error communicating with endpoint
Try a curl request to your backend integration endpoint using the same parameters that you expect API Gateway to pass. Confirm that the request completes and takes less than 29 seconds, which is the API Gateway Integration timeout.
Investigate Logs:
try calling the API via the Test facility in the API Gateway console and inspect the output to get more information.
Confirm that API Gateway is calling the correct endpoint and is passing the header and body values that you expect. Also, observe any error messages from calling the integration endpoint.
Sometimes the error can be caused if the backend NLB (if used) does not have Cross-Zone Load Balancing enabled and you do not have healthy resources in all AZs selected for the NLB. So, ensure that the “cross_zone.enabled” is set to “true” on the NLB. You can find this information on the ELBV2 toollinker tool → NLB → Load Balancer properties → cross_zone.enabled
