amazon-web-servicesamazon-ec2amazon-ecs

All tasks on a ECS service stuck in PROVISIONING state


I'm trying to set up a service that launches 20 single-container tasks with an application load balancer. The problem is that every task stays stuck on PROVISIONING

The service has logged an error saying that "service service_name is unable to consistently start tasks successfully", which does not seem very helpful since the documentation basically explains that the task launch failed and there were many retries.

My cluster is using an AutoScaleGroup capacity provider whose launch template is using an ecs-enabled AMI, with a role that has AmazonEC2ContainerServiceforEC2Role policy attached to it. The instance type is t2.micro (tried t2.small with no results)

Can anybody help me troubleshoot this situation? May the task definition be a cause for this? Thanks in advance


Solution

  • At the end, I realized that each task must have an HTTP endpoint called /health that should return 200. By calling that endpoint, the load balancer determines whether the container is PROVISIONING or READY