Useless Amazon ECS Error Message when creating tas

2019-07-11 19:05发布

Using the ecs agent container on an Ubuntu instance, I am able to register the agent with my cluster.

I also have a service created in that cluster and task definitions as well. When I try to add a task to the cluster I get the useless error message:

Run tasks failed
Reasons : ["ATTRIBUTE"]

The ecs agent log has no related error message. Any thoughts on how I can get better debugging or what the issue might be?

The cli also returns the same useless error message

{
    "tasks": [],
    "failures": [
        {
            "arn": "arn:aws:ecs:us-east-1:sssssss:container-instance/sssssssssssss",
            "reason": "ATTRIBUTE"
        }
    ]
}

2条回答
爱情/是我丢掉的垃圾
2楼-- · 2019-07-11 19:26

From the troubleshooting guide:

ATTRIBUTE (container instance ID)

Your task definition contains a parameter that requires a specific container instance attribute that is not available on your container instances. For more information on which attributes are required for specific task definition parameters and agent configuration variables, see Task Definition Parameters and Amazon ECS Container Agent Configuration.

You can find the attributes required for your task definition by looking at the requiredAttributes field. You can find the attributes that are present for your container instances in the result of the DescribeContainerInstances API call.

查看更多
萌系小妹纸
3楼-- · 2019-07-11 19:40

The ECS console webpage does not provide enough information, but you can connect to the EC2 instance to retrieve more logs.

You can try by manually restart ecs agent daemon, ecs agent docker. Sometimes, you need to manually delete the checkpoint file

A cheatsheet with location of logs, commands can be found at ecs-agent troubleshoot

查看更多
登录 后发表回答