Stopped tasks error codes - Amazon ECS

Stopped tasks error codes

The following are the possible error messages you may receive when your Fargate task is stopped unexpectedly. The error messages are returned by the container agent and the prefix is dependent on the platform version the task is using.

To check your stopped tasks for an error message using the AWS Management Console, see Checking stopped tasks for errors.

ContainerRuntimeTimeoutError
DockerTimeoutError (Linux platform version 1.3.0 or earlier)

This error occurs when a container can't transition to either a RUNNING or STOPPED state within the timeout period. The reason and timeout value is provided in the error message.

Example: ContainerRuntimeTimeoutError: Could not transition to running; timed out after waiting 1m: <reason>

CannotStartContainerError

This error occurs when a container can't be started.

Example: CannotStartContainerError: failed to get container status: <reason>

CannotStopContainerError

This error occurs when a container can’t be stopped.

Example: CannotStopContainerError: failed sending SIGTERM to container: <reason>

CannotInspectContainerError

This error occurs when the container agent can't describe the container through the container runtime.

When using platform version 1.3 or prior, the ECS agent will return the reason from Docker.

When using platform version 1.4 or later 1.4.0 or later (Linux) or 1.0.0 or later (Windows), the Fargate agent will return the reason from containerd.

Example: CannotInspectContainerError: <reason>

ResourceInitializationError

This error occurs when the container agent for your Fargate task fails to create or bootstrap the resources required to start the container or the task is belongs to.

A common cause for this error is using a VPC that doesn't have DNS resolution enabled.

This error only occurs if you use platform version 1.4.0 or later (Linux) or 1.0.0 or later (Windows).

Example: ResourceInitializationError: failed to initialize logging driver: <reason>

CannotPullContainerError

This error occurs when the agent is unable to pull the container image specified in the task definition. For more information, see CannotPullContainer task errors.

Example: CannotPullContainerError: <reason>

CannotCreateVolumeError

This error occurs when the agent can't create the volume mount specified in the task definition.

This error only occurs if you use platform version 1.4.0 or later (Linux) or 1.0.0 or later (Windows).

Example: CannotCreateVolumeError: <reason>

ContainerRuntimeError

This error occurs when the agent receives an unexpected error from containerd for a runtime-specific operation. This error is usually caused by an internal failure in the agent or the containerd runtime.

This error only occurs if you use platform version 1.4.0 or later (Linux) or 1.0.0 or later (Windows).

Example: ContainerRuntimeError: failed to create container IO set: <reason>

OutOfMemoryError

This error occurs when a container exits due to processes in the container consuming more memory than was allocated in the task definition.

Example: OutOfMemoryError: container killed due to memory usage

InternalError

This error occurs when the agent encounters an unexpected, non-runtime related internal error.

This error only occurs if using platform version 1.4 or later.

Example: InternalError: <reason>

TaskFailedToStart

This error occurs when an ENI attachment is requested. Amazon EC2 asynchronously handles the provisioning of the ENI. The provisioning process takes time. Amazon ECS has a timeout in case there are long wait times or unreported failures. There are times when the ENI is provisioned, but the report comes to Amazon ECS after the failure timeout. In this case, Amazon ECS sees the reported task failure with an in-use ENI.

Example: InternalError: <reason>

TaskFailedToStart

This error occurs when the subnet that hosts the instances does not have enough IP addresses. The number of available IP addresses is available on the subnet details page, or by using describe-subnets. For more information, see View your subnet in the Amazon VPC User Guide.

Example: Unexpected EC2 error while attempting to Create Network Interface with public IP assignment enabled in subnet 'subnet-id': InsufficientFreeAddressesInSubnet