Search code examples
amazon-ecsaws-batch

AWS Batch Timeout connecting to ECR


I get the following error running an AWS batch job:

ResourceInitializationError: unable to pull secrets or registry auth: execution resource retrieval failed: unable to retrieve ecr registry auth: service call has been retried 3 time(s): RequestError: send request failed caused by: Post https://api.ecr.us-east-1.amazonaws.com/: dial tcp 54.239.19.155:443: i/o timeout

I am using Fargate option for the AWS batch compute environment.

My VPC contains a subnet with 'auto assign public IPv4 address', an internet gateway, and a matching route table. I thought that this might be a problem in my VPC, so to verify that, I've launched a new EC2 instance in the VPC, and run in the EC2 instance curl to https://api.ecr.us-east-1.amazonaws.com. The curl can connect without any issues.

What could be the problem?


Solution

  • The VPC setting "auto assign public IPv4 address" only applies to EC2 instances I believe. For Fargate tasks in ECS or Batch you need to enable the assignPublicIp setting.