ECS EC2 launch type and event was unable to place a task because no container instance met all of its requirements

0

I'm trying to learn more about ECS with EC2 launch type.

Sometimes, when updating the Task Definition or Service I see the following error in the Service events

service ecs-service was unable to place a task because no container instance met all of its requirements. The closest matching container-instance XXX has insufficient CPU units available. For more information, see the Troubleshooting section.

I checked the suggested docs: https://docs.aws.amazon.com/AmazonECS/latest/developerguide/troubleshooting.html

I also checked: https://docs.aws.amazon.com/AmazonECS/latest/developerguide/service-event-messages.html

In my Task Definition I have:

  • For the Task Definition CPU 2048 and Memory 1024
  • For the container CPU 1024 and Memory 1024 (I tried also setting the CPU value to 2048).

Why this happens randomly? What can I do to fix it? When this happens the service seems to get stuck and even after long waits, nothing happens.

preguntada hace 2 años317 visualizaciones
1 Respuesta
0

Hi, here there is a nice summary of all the reason behind the issue that you are facing https://repost.aws/knowledge-center/ecs-container-instance-requirement-error

  • Not enough memory for your tasks
  • Not enough CPU units for your container instance
  • No container instances were found in your cluster
  • The port needed by the task is already in use
  • Not enough available elastic network interface attachment points
  • A required attribute is missing for your container instance

The first 2 of the list are the one that most likely happening if you select a small EC2 instance to perform your tests

AWS
respondido hace un año

No has iniciado sesión. Iniciar sesión para publicar una respuesta.

Una buena respuesta responde claramente a la pregunta, proporciona comentarios constructivos y fomenta el crecimiento profesional en la persona que hace la pregunta.

Pautas para responder preguntas