ECS/EC2 instances don't download ECR image from task definition

0

I uploaded my app image to a private repo on ECR, when I start my EC2 instances (autoscale group for ECS service) they hang and eventually fail with "Task failed to start". I have connected to the instances using ssh, and from what I can tell docker never tries to download the image from ECR. I have confirmed that the task definition has the ECR image url defined in the container definitions -> image field, and that the image listed there exists using docker manifest inspect. Anyone have any idea why this could be happening?

1개 답변
0

The task could fail owing to a variety of reasons. If you go under ECS --> Cluster --> service --> Events, you should see why that task failed.

profile pictureAWS
전문가
답변함 일 년 전
  • There are no events for the failures. The only events shown there are 'service ... has started 1 task'. When I view aws ecs describe-tasks --tasks [task_id] the stopped reason is as follows:
    "stopCode": "TaskFailedToStart", "stoppedAt": "2022-12-20T07:44:46.292000-08:00", "stoppedReason": "Task failed to start", "stoppingAt": "2022-12-20T07:44:46.292000-08:00",

    There is no evidence that the ecs-agent is even downloading the repo in the first place, but the image is defined in the task definition, and docker manifest inspect verifies that the image exists. It seems like the ecs-agent is just not even starting to process the container logic for the task definition.

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인