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.

1개 답변
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
답변함 일 년 전

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

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

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

관련 콘텐츠