0
votes

I'm new to using AWS EBS and ECS, so please bear with me if I ask questions that might be obvious for others. To the issue:

I've got a single-container Node/Express application that runs on EBS. The local docker container works as expected. On EBS, I can access one endpoint of the API and get the expected output. For the second endpoint, which runs longer (around 10-15 seconds) I get no response and run after 60 seconds into a time out: "504 Gateway Time-out".

I wonder how I would approach debugging this as I can't connect to the container directly? Currently there isn't any debugging functionality in the code included either as I'm not sure what the best node approach for a EBS container is - any recommendations are highly appreciated.

Thank you in advance!

2
Why you can't connect to the EB instance? Also what do you mean by the second-endpoint? Which endpoint?Marcin
Hey Marcin, with endpoint I mean a Restful API endpoint - kinda of a page in app. The application has two: a simple one that works without any issues and one more complex one that fails for whatever reason. So the container itself works. What do you mean with connect to the EB instance? Log into the container? Not sure how to do this.spekulatius
Yes, you could ssh into instance, and check from inside if your contains work, do the endpoints respond using curl.Marcin
Okay, I'm not sure how I would ssh into it. simply ssh URL doesn't work - I haven't even defined an SSH key anywhere yet. Could you point me in the right direction here?spekulatius

2 Answers

0
votes

You can see the EC2 instances running on EBS in your AWS, and you can choose to give them IP addresses in your EBS options. That will let you SSH directly into them if you need to.

Otherwise check the keepAliveTimeout field in your server (the value returned by app.listen() of you're using express).

I got a decent number of 504s when my Node server timeout was less than my load balancer timeout.

0
votes

Your application takes longer than expected (> 60 seconds) to respond, so either nginx or the Load Balancer terminates your request.

See my answer here