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.

posta 2 anni fa317 visualizzazioni
1 Risposta
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
con risposta un anno fa

Accesso non effettuato. Accedi per postare una risposta.

Una buona risposta soddisfa chiaramente la domanda, fornisce un feedback costruttivo e incoraggia la crescita professionale del richiedente.

Linee guida per rispondere alle domande