> ## Documentation Index
> Fetch the complete documentation index at: https://docs.fjall.io/llms.txt
> Use this file to discover all available pages before exploring further.

# ecs.task_start_failed

> Tasks from the new version kept stopping

ECS launched tasks for your new version, but they kept stopping before the service could stabilise. The failure came from the application's code or configuration.

## Why this happens

A task that stops shortly after launch points at one of three causes:

* The container exits shortly after start. The process crashes, hits an unhandled error during initialisation, or completes and exits when it should keep running.
* The image cannot be pulled. The tag does not exist in the registry, or the pull fails partway through.
* An environment value the application requires is missing, so startup aborts.

The deployment failure sits in the `ecs_stabilise` phase. The provider reason from ECS may include the stopCode for the stopped tasks, which distinguishes an application exit from an image or provisioning problem.

## How to fix it

1. Check the application logs for the stopped tasks. The final log lines before exit name the cause in most cases.
2. Read the stopCode in the provider reason. An essential-container exit points at your application, while an image-pull error points at the tag or registry.
3. Run the image locally with the same environment. If it exits there too, fix the startup failure before deploying again.
4. If the logs show a missing environment value or secret, add it to the application's configuration and redeploy.
5. Deploy again once the tasks stay up locally.

## What Fjall shows you

The deployment's detail page on fjall.io shows this code, the affected service, the verbatim ECS reason, and the deploy-time ECS event tail. The CLI prints the same information in its Error Detail block, and the deployments list shows the failure title on the deployment's row.

## Related

<CardGroup cols={2}>
  <Card title="Deployment safety" icon="shield-check" href="/deployment/deployment-safety">
    How the circuit breaker and the ECS event tail protect your rollouts.
  </Card>

  <Card title="Deploy an application" icon="rocket" href="/deployment/deploy-application">
    The full deployment flow, phase by phase.
  </Card>

  <Card title="fjall deploy" icon="terminal" href="/cli/deploy">
    Deploy from the CLI and read its failure output.
  </Card>

  <Card title="fjall releases" icon="list-check" href="/cli/releases">
    Check what is currently running after a failed rollout.
  </Card>
</CardGroup>
