4
votes

I have set up a Docker container running on port 5566 with a small Django application. The Docker image is uploaded into the ECR and later used by Fargate container(s).
I have set up an ECS cluster with a VPC.
After creating the Task Definition and Service, the Service starts up 2 tasks (as it is supposed to):

Fargate Service Running

Here's the Service's Network Access (with health check grace period on 300s):

enter image description here

I also set up an Application Load Balancer (with DNS) with a target group for the service, but the health checks seem to be failing:

enter image description here

Here's the health check configuration:

enter image description here

Because the health checks are failing the tasks are terminated and new ones are started after ~every 5 minutes.

Here's the container's port mapping:

enter image description here

As one cannot access the Fargate container (via SSH for example) and the logs are empty, how should I troubleshoot the issue?

I have tried to follow every step in the Troubleshoot Your Application Load Balancer.

Feel free to ask additional information.

1
What is your healthCheckGracePeriodSeconds defined in Service Definition? May be your application is taking time to load and in between ALB is checking the health and reporting the target health is 'unhealthy'. Try increasing the 'healthCheckGracePeriodSeconds' docs.aws.amazon.com/AmazonECS/latest/developerguide/…Haran
The health check grace period for the service was 0, I changed to 300 (5 minutes). This didn't change anything, though. Also edited the post with the service's network access.E. Muuli

1 Answers

0
votes

can you confirm once, your application is working on port 5566 inside docker?

you can check logs in cloudwatch. you'll get the link in cluster -> service -> tasks -> your task.

enter image description here

Can you post your ALB configuration? your Target group port?