Amazon ECS API failure reasons - Amazon Elastic Container Service

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 region parameter.

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

DescribeClusters

MISSING

The specified cluster wasn't found. Verify the spelling of the cluster name.

DescribeInstances

MISSING

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.

DescribeServices

MISSING

The specified service wasn't found. Verify that the correct cluster or Region is specified and that the service ARN or name is valid.

DescribeTasks

MISSING

The specified task wasn't found. Verify the correct cluster or Region is specified and that both the task ARN or ID is valid.

DescribeTasks

TaskFailedToStart: RESOURCE:*

For RESOURCE:CPU errors, the number of CPUs requested by the task are unavailable on your container instances. This generally happens when the CPU unit requirement in your task definition is larger than the CPU size of the Amazon EC2 instances defined in the Auto Scaling group mapped to the capacity provider. You need to check your capacity provider configuration.

For RESOURCE:MEMORY errors, the amount of memory requested by the task are unavailable on your container instances. This generally happens when the memory amount requirement in your task definition is larger than the supported memory on the Amazon EC2 instances defined in the Auto Scaling group mapped to the capacity provider. You need to check your capacity provider configuration.

TaskFailedToStart: AGENT

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.

TaskFailedToStart: MemberOf placement constraint unsatisfied

There is no container instance that meets the placement constraints defined in your task definition.

TaskFailedToStart: ATTRIBUTE

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 awsvpc network mode, but there are no instances in your specified subnets with the ecs.capability.task-eni attribute. For more information about which attributes are required for specific task definition parameters and agent configuration variables, see Amazon ECS task definition parameters and Amazon ECS container agent configuration.

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.

TaskFailedToStart: EMPTY CAPACITY PROVIDER

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.

GetTaskProtection

MISSING

The specified task wasn't found. Verify that the cluster name or ARN and the task ARN or ID are valid.

TASK_NOT_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.

RunTask or StartTask

RESOURCE:*

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 RESOURCE:ENI errors, your cluster doesn't have any available elastic network interface attachment points, which are required for tasks that use the awsvpc network mode. Amazon EC2 instances have a limit to the number of network interfaces that can be attached to them, and the primary network interface counts as one. For more information about how many network interfaces are supported for each instance type, see IP Addresses Per Network Interface Per Instance Type in the Amazon EC2 User Guide.

For RESOURCE:GPU errors, the number of GPUs requested by the task are unavailable and you might need to add GPU-enabled container instances to your cluster. For more information, see Amazon ECS task definitions for GPU workloads.

AGENT

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.

LOCATION

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 awsVpcConfiguration.

ATTRIBUTE

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 awsvpc network mode, but there are no instances in your specified subnets with the ecs.capability.task-eni attribute. For more information about which attributes are required for specific task definition parameters and agent configuration variables, see Amazon ECS task definition parameters and Amazon ECS container agent configuration.

StartTask

MISSING

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.

INACTIVE

The container instance that you attempted to launch a task onto was previously deregistered with Amazon ECS and can't be used.

UpdateTaskProtection

DEPLOYMENT_BLOCKED

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.

MISSING

The specified task wasn't found. Verify that the cluster name or ARN and the task ARN or ID are valid.

TASK_NOT_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.