CannotPullContainerError aws runtime_error ai_generated true

STOPPED(CannotPullContainerError:守护进程错误响应:镜像:标签的清单未找到:清单未知)

STOPPED (CannotPullContainerError: Error response from daemon: manifest for image:tag not found: manifest unknown: manifest unknown)

ID: aws/ecs-task-stopped-cannotpullcontainer

其他格式: JSON · Markdown 中文 · English
90%修复率
88%置信度
1证据数
2023-11-05首次发现

版本兼容性

版本状态引入弃用备注
ecs-2024 active
docker-24.0.7 active
amazon-ecs-agent-1.78.0 active

根因分析

ECS任务定义中指定的容器镜像在ECR仓库中不存在,或标签不正确。

English

The container image specified in the ECS task definition does not exist in the ECR repository or the tag is incorrect.

generic

官方文档

https://docs.aws.amazon.com/AmazonECS/latest/developerguide/task-definition-template.html

解决方案

  1. Verify the image URI in the task definition using: aws ecs describe-task-definition --task-definition mytask:1 --query 'taskDefinition.containerDefinitions[0].image'. Then check ECR: aws ecr describe-images --repository-name myrepo --image-ids imageTag=mytag. If missing, push the correct image: docker tag myapp:latest account.dkr.ecr.region.amazonaws.com/myrepo:mytag && docker push account.dkr.ecr.region.amazonaws.com/myrepo:mytag
  2. If using 'latest' tag, ensure it is explicitly pushed. ECR does not automatically tag 'latest' on push. Use: docker tag myapp:latest account.dkr.ecr.region.amazonaws.com/myrepo:latest && docker push account.dkr.ecr.region.amazonaws.com/myrepo:latest

无效尝试

常见但无效的做法:

  1. 100% 失败

    重复部署相同的任务定义不会改变镜像URI,错误持续存在。

  2. 50% 失败

    错误是关于镜像是否存在,而不是访问权限;权限问题会显示不同的错误消息。