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 may assist in
troubleshooting the cause. The failure will return 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 you might receive when running API commands.
API action |
Failure 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. |
|
|
The specified task wasn't found. Verify that the cluster name or ARN and the task ARN or ID are valid. |
|
The specified task is not 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 you attempted to launch the task onto can't be found. Perhaps 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. |
|
|
|
Cannot 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 is not part of an Amazon ECS service. Only Amazon ECS service-managed tasks can be protected. Verify the task ARN or ID and try again. |
Besides the failure scenarios described here, APIs can also fail due to exceptions, resulting in error responses. For a list of such exceptions, see Common Errors.