---
title: "AWS deployment failure signatures: startup, placement, health, routing or scaling | Proofline"
description: "When an AWS deployment fails, its first record, such as a stop code, service event, target health reason or scaling activity, names the layer that failed."
url: https://proofline.sh/learn/aws-deployment-failure-signatures/
---

[Learning center](/learn/)

# AWS deployment failure signatures: startup, placement, health, routing or scaling

When an AWS deployment fails, its first record, such as a stop code, service event, target health reason or scaling activity, names the layer that failed. Read it before you read application logs, then run the one check that separates that layer from its nearest neighbor.

Deployment failures The Proofline team November 22, 2026 9 min read

## One symptom, five layers

"The deployment failed" is what the pipeline reports. On Amazon ECS the same red build can come from five places, and each leaves a different record:

-   **Startup.** ECS placed the task but it never reached `RUNNING`: an image, a secret, a log group or a volume was missing or unreachable.
-   **Placement.** ECS could not find capacity for the task at all, so no task exists to inspect.
-   **Process exit.** The container started and its main process exited.
-   **Health.** The process kept running but failed a load balancer or container health check, and the service scheduler replaced it.
-   **Routing and scaling.** Every new task is healthy, yet requests fail at the load balancer, or the task count moved for a reason that has nothing to do with the release.

The layer decides who acts next. A startup failure is usually a configuration or permission change in the release. A placement failure is capacity or quota. A health failure can be the release or a dependency the health check calls. Reading the logs of a task that never started wastes the first ten minutes of an incident, because there are no logs.

## Where each signature is recorded

ECS records why every service task stopped in two fields: `stopCode`, a fixed category, and `stoppedReason`, free text with the details. The API currently defines seven stop codes. AWS notes that stopped-reason text can change, so sort on the stop code and read the reason for detail. [Task fields](https://docs.aws.amazon.com/AmazonECS/latest/APIReference/API_Task.html) · [Viewing stopped task errors](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/stopped-task-errors.html) · [Stopped-task message updates](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/stopped-tasks-error-messages-updates.html)

| Layer and record | Documented signature | What separates it from the next layer |
| --- | --- | --- |
| Placement (service events) | `service (SERVICE) was unable to place a task because no container instance met all of its requirements.` | No stopped task exists for the new deployment. |
| Startup (stopped task) | Stop code `TaskFailedToStart`; reason begins with a category such as `CannotPullContainerError` or `ResourceInitializationError` | The task has no `startedAt`. |
| Process exit (stopped task) | Stop code `EssentialContainerExited`; the container's `exitCode` | `startedAt` is set and the container reports an exit code. |
| Health (stopped task and target health) | Stop code `ServiceSchedulerInitiated`; reason beginning `Task failed ELB health checks` or `Task failed container health checks` | The process was still running when ECS stopped it. |
| Scaling (stopped task) | Stop code `ServiceSchedulerInitiated`; reason `Scaling activity initiated by (deployment ...)` | ECS stopped a healthy task to hold the desired count. On an old deployment's task during a rollout, that is a normal retirement. On a new deployment's task, either the desired count went down or a rollback or later deployment is retiring it; the service events and scaling activity tell which. |
| Outside the release (stopped task) | Stop codes `SpotInterruption`, `TerminationNotice`, `UserInitiated` | Capacity was reclaimed, or a person or tool stopped the task. |

Routing failures leave no stopped task at all. The tasks are healthy and the load balancer's own metrics carry the signature: `HTTPCode_ELB_5XX_Count` counts errors the load balancer generated, while `HTTPCode_Target_5XX_Count` counts errors your tasks returned. [ALB CloudWatch metrics](https://docs.aws.amazon.com/elasticloadbalancing/latest/application/load-balancer-cloudwatch-metrics.html)

## Collect every signature in one pass

Run these three reads as soon as the deployment fails. ECS keeps stopped tasks for at least one hour and returns only the latest 100 service events, so a slow incident loses the evidence. Use a read-only profile and replace the uppercase placeholders. [Stopped task retention](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/stopped-task-errors.html) · [Service fields](https://docs.aws.amazon.com/AmazonECS/latest/APIReference/API_Service.html)

```
aws ecs describe-services \
  --profile PROFILE --region REGION --cluster CLUSTER --services SERVICE \
  --query 'services[0].{deployments:deployments[].{id:id,status:status,definition:taskDefinition,rollout:rolloutState,reason:rolloutStateReason,failed:failedTasks,created:createdAt},events:events[:20].[createdAt,message]}' \
  --output json --no-cli-pager

aws ecs list-tasks \
  --profile PROFILE --region REGION --cluster CLUSTER \
  --service-name SERVICE --desired-status STOPPED \
  --query 'taskArns' --output json --no-cli-pager

aws ecs describe-tasks \
  --profile PROFILE --region REGION --cluster CLUSTER --tasks TASK_ARN_1 TASK_ARN_2 \
  --query 'tasks[].{deployment:startedBy,definition:taskDefinitionArn,started:startedAt,stopped:stoppedAt,code:stopCode,reason:stoppedReason,containers:containers[].{name:name,exit:exitCode,reason:reason}}' \
  --output json --no-cli-pager
```

`startedBy` holds the ECS deployment ID for tasks a service started, so it splits the new deployment's tasks from the old ones. `failedTasks` counts consecutive failures in a deployment: tasks that could not launch, never reached `RUNNING`, or failed a health check and were stopped. It resets once the deployment has a running task. [Deployment fields](https://docs.aws.amazon.com/AmazonECS/latest/APIReference/API_Deployment.html)

Then sort. If the new deployment has no stopped tasks and the events mention placement, go to [placement](#placement). If its tasks stopped, group them by stop code and read [the stop code guide](/learn/ecs-task-stop-codes/) for each group.

## An illustrative event sequence

The service `orders` moves from task definition `orders:57` to `orders:58`. The pipeline reports a failed deployment at 10:14. These are fictional records, trimmed to the fields above; reasons are summarized where AWS does not publish the full text.

| Time | Record | Value |
| --- | --- | --- |
| 09:58 | Deployment | `ecs-svc/2211` created for `orders:58`, desired count 4 |
| 10:00 | Stopped task, deployment `ecs-svc/2211` | `TaskFailedToStart`; the reason begins `ResourceInitializationError` and names the awslogs log group, which does not exist |
| 10:01 | Stopped task, deployment `ecs-svc/2211` | Same stop code and reason |
| 10:03 | Stopped task, deployment `ecs-svc/1987` (old) | `SpotInterruption`, `Your Spot Task was interrupted.` |
| 10:06 | Service event | `service (orders) is unable to consistently start tasks successfully.` |
| 10:14 | Deployment | `ecs-svc/2211` rollout state `FAILED` |

Three of these records look alarming and only two belong to the release. The two `TaskFailedToStart` tasks belong to the new deployment and never started, so there are no application logs to read. Their reason names the awslogs log driver: `orders:58` points at a log group that does not exist in this Region. The Spot interruption hit an old task from `ecs-svc/1987`. It explains a dip in running count during the rollout but not the failure. Rolling back to `orders:57` would restore service, and the fix is the log group reference in revision 58. [Missing log group](/learn/ecs-awslogs-log-group-does-not-exist/)

Change one record and the reading changes. If the 10:00 tasks had stopped with `EssentialContainerExited` and exit code 1, the release started and crashed, and the container logs are the next read. If they had stopped with a reason beginning `Task failed ELB health checks`, check whether the old tasks were failing the same check before you blame the release.

## Startup: the task never ran

A task with no `startedAt` failed before its essential container ran. The stopped reason starts with a category that names the failing step:

-   Image pull failures: [the image or tag was not found](/learn/ecs-cannotpullcontainer-image-not-found/), [the image was built for another CPU architecture](/learn/ecs-image-platform-mismatch/), [a lifecycle policy deleted an image a running revision still uses](/learn/ecr-lifecycle-policy-deleted-running-image/), or [the pull timed out from a private subnet](/learn/ecs-image-pull-timeout-private-subnet/).
-   Initialization failures: [a Secrets Manager secret](/learn/ecs-secrets-startup-errors/), [a missing log group](/learn/ecs-awslogs-log-group-does-not-exist/) or [an EFS volume that would not mount](/learn/ecs-efs-volume-mount-failed/).
-   Container creation failures: [the command or entry point does not exist in the image](/learn/ecs-cannotstartcontainer-command-not-found/).
-   Registration failures, before any task exists: [an invalid CPU and memory combination](/learn/ecs-task-definition-invalid-cpu-memory/).
-   Ordering failures: [a container dependency that never reached its condition](/learn/ecs-container-dependency-blocks-start/).

## Placement: no task to inspect

When no stopped task belongs to the new deployment, the service events explain why ECS did not place one. The event text names the constraint that failed, such as CPU, memory, ports, an attribute or an account limit. [Service event messages](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/service-event-messages-list.html)

-   EC2 capacity: [no container instance has enough CPU or memory](/learn/ecs-unable-to-place-task-insufficient-resources/), [the new task needs a host port the old task holds](/learn/ecs-host-port-conflict-during-deploy/), [tasks wait in `PROVISIONING` for a capacity provider](/learn/ecs-capacity-provider-tasks-stuck-provisioning/), or [the container agent is disconnected](/learn/ecs-container-instance-agent-disconnected/).
-   Deployment settings and quotas: [`minimumHealthyPercent` and `maximumPercent` leave no room](/learn/ecs-deployment-configuration-blocks-replacement/), or [the rollout's peak crosses the Fargate vCPU quota](/learn/ecs-fargate-task-or-vcpu-limit-during-deploy/).
-   Network capacity: [the subnets run out of IP addresses while old and new tasks overlap](/learn/ecs-awsvpc-subnet-out-of-ip-addresses/).

## Running tasks that stopped or never retired

Once a task has a `startedAt`, the stop code and the deployment ID sort it. [Read the stop code](/learn/ecs-task-stop-codes/) first, then:

-   [`EssentialContainerExited` and its exit code](/learn/ecs-exit-codes-after-deploy/), or [a container health check that fails](/learn/ecs-container-health-check-unhealthy/).
-   Stops that are not about the release: [Fargate Spot reclaimed the capacity](/learn/ecs-fargate-spot-interruption-or-release/), or [service auto scaling changed the desired count mid-rollout](/learn/ecs-service-auto-scaling-during-deployment/).
-   Old tasks that never leave: [scale-in protection holds them](/learn/ecs-protected-tasks-block-steady-state/).

## Routing: healthy tasks, failing requests

-   [Requests still reach the old target group](/learn/alb-traffic-on-wrong-target-group-after-deploy/) after a blue/green or listener change.
-   [ALB 504s](/learn/alb-504-after-deploy/): a target that never accepted the connection, or one slower than the idle timeout.
-   Network Load Balancers: [targets unhealthy because of a security group](/learn/nlb-targets-unhealthy-security-group/), and [long-lived connections dropped during deregistration](/learn/nlb-deregistration-long-lived-connections/).

## Other AWS deployment tools

Each AWS deployment service has its own fixed field for the same question.

EC2 Auto Scaling records each launch and termination as a scaling activity with a `StatusCode` and `StatusMessage`. The guides cover [insufficient capacity](/learn/asg-launch-failed-insufficient-capacity/), [a launch template version that fails every launch](/learn/asg-launch-template-change-launch-failures/), [`Client.InternalError` on encrypted volumes](/learn/asg-encrypted-volume-kms-client-internalerror/), [ELB health checks replacing new instances](/learn/asg-elb-health-check-replaces-new-instances/), [a failed instance refresh](/learn/asg-instance-refresh-failed/) and [a lifecycle hook that abandoned the launch](/learn/asg-lifecycle-hook-timeout-abandon/). [Activity](https://docs.aws.amazon.com/autoscaling/ec2/APIReference/API_Activity.html)

CodeDeploy puts a code such as `HEALTH_CONSTRAINTS` or `TIMEOUT` in `errorInformation`, and each instance or task set records the lifecycle event that failed. The guides cover [`ScriptFailed`](/learn/codedeploy-scriptfailed-lifecycle-event/), [`HEALTH_CONSTRAINTS`](/learn/codedeploy-health-constraints/), [events stuck in Pending](/learn/codedeploy-agent-timeout/) and [an ECS blue/green hook](/learn/codedeploy-ecs-blue-green-hook-failed/). [ErrorInformation](https://docs.aws.amazon.com/codedeploy/latest/APIReference/API_ErrorInformation.html)

Lambda reports a failed deploy in `LastUpdateStatus` and `LastUpdateStatusReasonCode`, such as `SubnetOutOfIPAddresses`. The guides cover [failed updates by reason code](/learn/lambda-update-failed-reason-codes/), [init errors after a deploy](/learn/lambda-init-errors-after-deploy/) and [a canary that rolled back](/learn/lambda-alias-canary-rollback/). [Function states](https://docs.aws.amazon.com/lambda/latest/dg/functions-states.html)

CloudFormation puts the cause in `ResourceStatusReason` on the first failed resource event. The guides cover [an ECS service that did not stabilize](/learn/cloudformation-ecs-service-did-not-stabilize/), [`UPDATE_ROLLBACK_FAILED`](/learn/cloudformation-update-rollback-failed/) and [a custom-named resource that needs replacing](/learn/cloudformation-custom-named-resource-replacement/). [Stack events](https://docs.aws.amazon.com/AWSCloudFormation/latest/APIReference/API_StackEvent.html)

EKS managed node groups list health issues with a `code` such as `NodeCreationFailure`. The guides cover [health issue codes](/learn/eks-nodegroup-health-issues/) and [`PodEvictionFailure` during an update](/learn/eks-nodegroup-update-pod-eviction-failure/). [Issue](https://docs.aws.amazon.com/eks/latest/APIReference/API_Issue.html)

## Where a signature stops helping

A signature names the layer, not the cause behind it. A reason beginning `Task failed ELB health checks` says the scheduler replaced a running task; it does not say whether the new code broke the health endpoint or the database the endpoint queries went down. The stopped reason is free text that AWS may reword, so do not build alerting on its exact wording; use `stopCode` and keep the reason as evidence. A stopped task also expires: if you arrive more than an hour after the failure, the service events and any EventBridge task state change events you retained are what remains. [Task state change events](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/ecs_task_events.html)

## Bring the signature into the pull request

Most startup signatures trace back to one changed line in a task definition, IAM policy or log configuration. Put the failing revision's diff and the signature you recorded in the pull request that fixes it, so the reviewer can check the fix against the evidence. Proofline reviews GitHub pull requests; new organizations get one calendar month of hosted code review without a cloud connection. [Start a free GitHub review](https://proofline.sh/orgs/plan?offer=free150) · [Eligibility and fair-use terms](/free-code-review/) · [Current product availability](/how-it-works/)

## Questions

### What is the difference between stopCode and stoppedReason in ECS?

`stopCode` is one of a fixed set of categories, such as `TaskFailedToStart` or `EssentialContainerExited`. `stoppedReason` is free text with the details, such as which image or log group failed. Sort and alert on the stop code, and read the reason for the specific cause.

### Why does my failed ECS task have no logs?

If the task has no `startedAt`, its essential container never ran, so it wrote nothing. The failure happened during image pull or resource initialization. The stopped reason is the evidence; application logs are not.

### How long does ECS keep stopped tasks?

AWS shows stopped tasks for at least one hour after they stop. Capture `describe-tasks` output early, or keep ECS task state change events in EventBridge if you need the records later.

## One month of free code review.

New organizations get one calendar month of hosted code review for private and public GitHub repositories. No card or cloud connection required. [Eligibility and fair-use terms](/free-code-review/).

[Start free with GitHub](https://proofline.sh/orgs/plan?offer=free_month)

## Related reading

-   ### [Which ECS task stops came from your deployment? Read the stop code](/learn/ecs-task-stop-codes/)
    
    Deployment failures The Proofline team November 22, 2026 6 min read
    
-   ### [Fix ECS ResourceInitializationError when pulling secrets](/learn/ecs-secrets-startup-errors/)
    
    Missing secrets The Proofline team November 15, 2026 8 min read
