A deployment fails with `ErrImagePull ... manifest unknown` (or ECS `CannotPullContainerError: ... not found`) for an image that used to work.
BeginnerTroubleshootingECS, EKS, ECR and Lambda
Answer
Likely causes → The tag does not exist in that repository or Region. A typo, a pipeline that never pushed, or an ECR lifecycle policy that expired old tags.
Diagnose →
aws ecr describe-images --repository-name api --image-ids imageTag=1.4.2
aws ecr get-lifecycle-policy --repository-name api
aws ecr describe-images --repository-name api --query 'sort_by(imageDetails,&imagePushedAt)[-5:].imageTags'
Fix →
- Push the missing tag again, or deploy an existing digest
- Change the lifecycle policy so it keeps images that are still deployed (for example, keep the last 50, and expire only untagged images after 14 days)
Prevent → Deploy by immutable digest, turn on tag immutability, and make lifecycle rules generous enough for rollbacks.
More on ECS, EKS, ECR and Lambda
`docker push 111111111111.dkr.ecr.us-east-1.amazonaws.com/api:1.4` fails with `no basic auth credentials` (or `denied: Your authorization token has expired. Reauthenticate and try again.`).BeginnerFargate tasks stop with `CannotPullContainerError: pull image manifest has been retried 5 time(s): failed to resolve ref ... dial tcp 52.x.x.x:443: i/o timeout`.Intermediate`ResourceInitializationError: unable to pull secrets or registry auth: ... AccessDeniedException: User: arn:aws:sts::111111111111:assumed-role/ecsTaskExecutionRole/... is not authorized to perform: secretsmanager:GetSecretValue`.IntermediateA task stops with `Essential container in task exited`, exit code 137, and reason `OutOfMemoryError: Container killed due to memory usage`.BeginnerThe ECS service event says `service api was unable to place a task because no container instance met all of its requirements. The closest matching container-instance ... has insufficient memory available.`IntermediateAn ECS deployment rolls back automatically, and the event says `deployment failed: tasks failed to start` from the circuit breaker.Advanced