Task Definition runtimePlatform: unable to place a task ... the closest matching container-instance is missing an attribute required by your task

0

When I create a new task definition revision from an existing definition now it automatically adds a runtimePlatform but deployment gets stuck with

unable to place a task because no container instance met all of its requirements. The closest matching container-instance is missing an attribute required by your task.

If create my new revision with JSON and ignore the runtimePlatform my service deploys with no issues. This is the part that confuses me the most, it does deploy if I ignore runtimePlatform. I've tried Linux/X86_64 (which is the OS we use), Linux/ARM64, and some of the Windows options and none of them work, always get the same issue as quoted above. What attribute am I missing?

moises
已提問 9 個月前檢視次數 617 次
2 個答案
0
已接受的答案

I assume that you got a recent AMI for your EC2 with all updates. To be sure, you can restart all EC2 in your ECS Cluster or restart all ECS agents in each EC2 instance.

Also, the ECS agent must be updated, if it's not the case. According to the documentation, the version of ECS agent must be 1.74.1. https://github.com/aws/amazon-ecs-agent/blob/master/CHANGELOG.md

profile picture
Donov
已回答 9 個月前
  • @Donov, that was the issue. I had an old Amazon Linux 1. Updated it to Amazon Linux 2023 AMI and it deploys. Thanks!

0

Hi,

Are you sure about your spelling ? It's **LINUX ** instead of Linux And you have to define separately

    "runtimePlatform": {
        "operatingSystemFamily": "LINUX",
        "cpuArchitecture": "X86_64"
    },

https://docs.aws.amazon.com/AmazonECS/latest/developerguide/task_definition_parameters.html#runtime-platform

profile picture
Donov
已回答 9 個月前
  • @Donov. I only edit the JSON to remove the whole runtimePlatform object option when creating a new revision. Because now the new updated UI adds it automatically as a default option under Operating system/Architecture. So no editing or spelling errors from my side. It is when I remove the whole object that you posted, that the deployment works.

您尚未登入。 登入 去張貼答案。

一個好的回答可以清楚地回答問題並提供建設性的意見回饋,同時有助於提問者的專業成長。

回答問題指南