How can I get my task to run in my Amazon ECS cluster?

Last updated: 2019-12-09

I'm trying to place a task in my Amazon Elastic Container Service (Amazon ECS) cluster. However, my task placement is failing, and my task won't change to the RUNNING state in my cluster. How can I resolve this issue?

Short Description

To successfully place your task in your cluster, choose one of the following solutions:

  • If you placed your task with the Amazon ECS service, complete the steps in the Check your service event messages section.
  • If you ran your task using a service, run task, or scheduled task, then follow the steps in the Check the stopped task for errors section.

Resolution

Check your service event messages

  1. Open the Amazon ECS console.
  2. In the navigation menu, choose Clusters, and then select the cluster that contains your service.
  3. On the Services tab of your cluster's page, in the Service Name column, select the service that you want to inspect.
  4. On your service's page, choose Events.
  5. In the Message column, look for errors or other useful information.

Based on your findings from step 5, choose one of the following resources to resolve your error:

Note: Service events display only the last 100 events.

Check the stopped task for errors

Important: You can see a stopped task that was stopped only in the last 30 minutes.

  1. Open the Amazon ECS console.
  2. In the navigation menu, choose Clusters, and then select the cluster that contains your stopped task.
  3. On your cluster's page, choose the Tasks tab.
  4. In the Desired task status table header, choose Stopped, and then select the stopped task to inspect. The most recent stopped tasks are listed first.
  5. On the Details tab of your stopped task, inspect the Stopped reason field to find out why your task was stopped.
  6. If you have a container that's stopped, expand the container, and then inspect the Status reason row to see what caused the task state to change.

Based on your findings from step 6, choose one of the following resources to resolve your error:

Note: If you're using any task placement constraints or strategies, your cluster must use instances that meet the requirements of your constraints or strategies.


Did this article help you?

Anything we could improve?


Need more help?