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
asked 9 months ago573 views
2 Answers
0
Accepted Answer

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
answered 9 months ago
  • @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
answered 9 months ago
  • @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.

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions