Amazon ECS API failure reasons
When an API action that you have triggered through the Amazon ECS API, console, or the
AWS CLI exits with a failures
error message, the following might assist in
troubleshooting the cause. The failure returns a reason and the Amazon Resource Name (ARN) of the
resource associated with the failure.
Many resources are Region-specific, so when using the console ensure that you set the
correct Region for your resources. When using the AWS CLI, make sure that your AWS CLI
commands are being sent to the correct Region with the --region
parameter.region
For more information about the structure of the Failure
data type, see
Failure in the Amazon Elastic Container Service API Reference.
The following are examples of failure messages that you might receive when running API commands.
API action | Failure reason or Stopped reason | Cause |
---|---|---|
|
|
The specified cluster wasn't found. Verify the spelling of the cluster name. |
|
|
The specified container instance wasn't found. Verify that you specified the cluster the container instance is registered to and that both the container instance ARN or ID is correct. |
|
|
The specified service wasn't found. Verify that the correct cluster or Region is specified and that the service ARN or name is valid. |
|
|
The specified task wasn't found. Verify the correct cluster or Region is specified and that both the task ARN or ID is valid. |
|
|
For For |
|
The container instance that you attempted to launch a task onto has an agent that's currently disconnected. To prevent extended wait times for task placement, the request was rejected. For information about how to troubleshoot an agent that's
disconnected, see How do I troubleshoot a disconnected Amazon ECS
agent |
|
|
There is no container instance that meets the placement constraints defined in your task definition. |
|
|
Your task definition contains a parameter that requires a specific
container instance attribute that isn't available on your container
instances. For example, if your task uses the |
|
TaskFailedToStart: NO ACTIVE INSTANCES |
There are no active instances in your capacity provider. For information about how to manage your Auto Scaling groups, see Auto Scaling groups in the Amazon EC2 Auto Scaling User Guide. | |
|
There are no instances in your cluster. This is most likely because of an empty capacity provider, or because the instances in the capacity provider are not registered to the cluster. For information about how to manage your Auto Scaling groups, see Auto Scaling groups in the Amazon EC2 Auto Scaling User Guide. | |
|
|
The specified task wasn't found. Verify that the cluster name or ARN and the task ARN or ID are valid. |
|
The specified task isn't part of an Amazon ECS service. Only Amazon ECS service-managed tasks can be protected. Verify the task ARN or ID and try again. |
|
|
|
The resource or resources that are requested by the task are unavailable on the container instances in the cluster. If the resource is CPU, memory, ports, or elastic network interfaces, you might need to add additional container instances to your cluster. For For |
|
The container instance that you attempted to launch a task onto has an agent that's currently disconnected. To prevent extended wait times for task placement, the request was rejected. For information about how to troubleshoot an agent that's
disconnected, see How do I troubleshoot a disconnected Amazon ECS
agent |
|
|
The container instance that you attempted to launch a task onto is
in a different Availability Zone than the subnets that you specified
in your |
|
|
Your task definition contains a parameter that requires a specific
container instance attribute that isn't available on your container
instances. For example, if your task uses the |
|
|
|
The container instance that you attempted to launch the task onto can't be found. Check if the wrong cluster or Region is specified, or the container instance ARN or ID is misspelled. |
|
The container instance that you attempted to launch a task onto was previously deregistered with Amazon ECS and can't be used. |
|
|
|
Can't set task protection as one or more protected tasks are preventing the service deployment from reaching a steady state. Unset task protection on existing tasks or wait until task protection expires. |
|
The specified task wasn't found. Verify that the cluster name or ARN and the task ARN or ID are valid. |
|
|
The specified task isn't part of an Amazon ECS service. Only Amazon ECS service-managed tasks can be protected. Verify the task ARN or ID and try again. |
Note
Besides the failure scenarios described here, API operations can also fail due to exceptions, resulting in error responses. For a list of such exceptions, see Common Errors.