Questions tagged with Elastic Load Balancing

Content language: English

Sort by most recent

Browse through the questions and answers listed below or filter and sort to narrow down your results.

ECS Fargate and ALB failed the health check with timeout (Node.js app)

I have been trying for two days to run a Node.js application on ECS Fargate connected to a Load Balancer, but somehow it does not pass the health check. I use CDK to create the infrastructure and already use other applications with the same setup that work perfectly. The Dockerfile image works perfectly locally with docker-compose. I am not convinced that's a problem at the SG and infrastructure level, but I think more that it's application side, maybe you have an idea where to go to check. The application is not developed by me and uses Express as server with listener on port 9000. IMPORTANT: I created a small application to test with the same port and endpoint for heath check = it worked perfectly. (health check passed) I increased the ECS idle timeout etc. but nothing Looking at the Task Logs (see image), I see that the application returns a 200 status on the heath check endpoint, however if I try to call the load balancer from its address, the call goes to 504 timeout. I tried from an EC2 machine to connect to the task on the private IP-address: with telnet it seems to work, but if I curl on the health check endpoint, it goes to timeouts. Sometimes if I try to call the load balancer several times (perhaps while the task is starting), the application responds (i.e. I see that the endpoint is working), but immediately afterwards it goes into timeout Any idea? ![Enter image description here](/media/postImages/original/IMBRZWTodnTqu_cmYco5cULQ)
1
answers
0
votes
17
views
asked a day ago