question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Pulling after logging in to ecr registry appears not to work

See original GitHub issue

Apologies if this is just an oversight on my part, but it stumped me today.

Assuming I have gotten the ecr credentials from boto already in an object called creds, when I do:

client = from_env()
client.login(creds.username, password=creds.password, registry=creds.endpoint)

I get:

{u'IdentityToken': u'', u'Status': u'Login Succeeded'}

Great so far! And I inspect:

client.api.__dict__

I get:

{'_auth_configs': {'auths': {'registry_i_just_logged_into': {'email': None,
'password': 'xxxxxxxxxxxxx',
'serveraddress': 'registry_i_just_logged_into',
'username': 'xxxxxxx'},
u'some_other_registry': {},
'credsStore': u'osxkeychain'}
.... (etc, etc)

Still so far, so good. But when I then do:

client.images.pull("registry_i_just_logged_into/some_repo", tag="latest")

Or when I do (from a command line, and not expecting this to work):

docker pull registry_i_just_logged_into/some_repo:latest

I always get:

Error response from daemon: pull access denied for some_repo, repository does not exist or may require 'docker login'

Despite the fact that, if I do (with the same username and password I used to log in):

client.images.pull("registry_i_just_logged_into/some_repo", tag="latest", auth_config={'username': creds.username, 'password': creds.password})

It works no problems.

I’m dumb. What am I doing wrong?

Thanks!

Issue Analytics

  • State:open
  • Created 5 years ago
  • Comments:5

github_iconTop GitHub Comments

3reactions
Karhidecommented, Oct 18, 2018

So to follow on, is there a way I can make this not happen? I’d like any users of my code to not have to go through the same thing.

1reaction
shin-commented, Oct 17, 2018

What version of the library are you using?

Your credsStore probably overrides the login you provided through the command. Try removing that from your config file and see if that resolves the issue (not saying the current behavior is correct though, just that it’s probably what’s happening)

Read more comments on GitHub >

github_iconTop Results From Across the Web

Troubleshooting errors with Docker commands when using ...
An error indicating that the image can't be found is most often caused by either the image not existing in the upstream registry...
Read more >
AWS ECR docker login succeeded, but can not pull/push (root ...
Briefly: I have IAM and I am able to both push and pull from a working Ubuntu 20 host. There is another host,...
Read more >
Cannot pull images from AWS ECR (login does not seem to ...
I've tried to get the AWS ECR credentials one of two ways: via boto3 and calling a subprocess for aws ecr get-login ....
Read more >
Credential helper for AWS ECR docker login not working
aws/credentials then a “docker pull” as a normal user on my runner machine can pull the image from Amazon's ECR registry. I have...
Read more >
GitLab CI: How to Pull a Private Docker Image from AWS ECR ...
Using AWS CLI to log in to the Amazon ECR registry ... Since the Docker container, we want to use is started by...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found