awslabs / amazon-ecr-credential-helper

Automatically gets credentials for Amazon ECR on docker push/docker pull
Apache License 2.0
2.48k stars 336 forks source link

Marathon unable to pull the docker image from ECR #68

Closed ashwin-nagarajan closed 5 years ago

ashwin-nagarajan commented 7 years ago

marathon is unable to pull the the docker image from ecr to one of the slaves below is the following error

Failed to launch container: Failed to run 'docker -H unix:///var/run/docker.sock pull XXXXXXXXXXX.dkr.ecr.eu-west-1.amazonaws.com/XXXXXXX:latest': exited with status 1; stderr='unauthorized: authentication required. i

  1. I had custom EMI from centos and installed the ecr helper.
  2. aws cli installed and configured with credentials.
  3. IAM role added to access ecr.
  4. custom EMI part of DC/OS cluster.

Docker version 1.13.1, build 092cba3, ~/.ecr/logs nothing captured or no records.

log from the mesos slave

2017-09-27 03:30:18: time="2017-09-27T03:30:18.965161602Z" level=error msg="Handler for GET /v1.26/containers/XXXXXX.dkr.ecr.eu-west-1.amazonaws.com/XXXXXX:39679ccd72b6e5f94f1d32f8fb5cc03d05e3270d/json returned error: No such container: XXXXXX.dkr.ecr.eu-west-1.amazonaws.com/XXXXXX:39679ccd72b6e5f94f1d32f8fb5cc03d05e3270d" 2017-09-27 03:30:18: time="2017-09-27T03:30:18.965753645Z" level=error msg="Handler for GET /v1.26/images/XXXXXX.dkr.ecr.eu-west-1.amazonaws.com/XXXXXX/json returned error: No such image: XXXXXX.dkr.ecr.eu-west-1.amazonaws.com/XXXXXX:39679ccd72b6e5f94f1d32f8fb5cc03d05e3270d"

i logged in to the system and was able to pull the Image via "docker pull" , but via marathon deployment it is throwing an error.

jhaynes commented 7 years ago

Hi @ashwin-nagarajan. Sorry to hear you're running into some snags. I've got a few ideas about what might be happening.

When you're docker pull-ing manually, are you doing it as the same user that marathon is running under? If not, can you try pulling as that user and/or verify that the helper binary is on the marathon user's path?

samuelkarp commented 5 years ago

Closing as there has been no response in over a year.