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

0

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

1개 답변
0

Are you using IPv6? If so, I am wondering if IPv6 CIDR block is allowed in your security group.

Sorry if this is the wrong consideration.

y
답변함 일 년 전

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인

관련 콘텐츠