I am trying run a task definition I have in AWS ECS. I have a default cluster, and I've got a Container Instance launched on it, and I'm trying to run a task definition I've got on the instance. The task goes straight from PENDING status to STOPPED, with reason:

STOPPED (Essential container in task exited)

I dug into the instance and pulled logs from /var/log/ecs/ and was found:

Error converting stats for container XXX: Invalid container statistics reported, no cpu core usage reported

Any idea why this may be happening? I've been googling around and looking through different stack exchange sites and I'm not seeing anything helpful. Forgive me if I overlooked something.

3 Answers 3


The log message you included is not the reason your task did not continue to run. What has happened is ECS launched your container with the command and parameters you specified, but the container exited on it's own. This can be difficult to debug.

It would be helpful to find the logs for the containers which have stopped. You can view all containers, including stopped containers using docker ps -a. When you have located a stopped container, you can view it's logs with docker logs <container_id>, assuming you are using the default logging driver.

  • It was impossible to find any clear logs in AWS anywhere but with stopped container logs, thank you! :)
    – Littletime
    Feb 21, 2020 at 0:04

Enable Cloudwatch logs. See details about how to set up cloud watch & use here: http://docs.aws.amazon.com/AmazonECS/latest/developerguide/using_cloudwatch_logs.html


The problem is with "Task tagging configuration" > DISABLE "Enable ECS managed tags"

When this parameter is enabled, Amazon ECS automatically tags your tasks with two tags corresponding to the cluster and service names. These tags allow you to identify tasks easily in your AWS Cost and Usage Report.

Billing permissions are separate and not by default assigned when you create a new ECS cluster and task definition with the default setting. This is why ECS was failing with "STOPPED: Essential container in task exited"

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.