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.

質問済み 2年前317ビュー
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
回答済み 1年前

ログインしていません。 ログイン 回答を投稿する。

優れた回答とは、質問に明確に答え、建設的なフィードバックを提供し、質問者の専門分野におけるスキルの向上を促すものです。

質問に答えるためのガイドライン

関連するコンテンツ