New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to docker login through CLI - unauthorized: incorrect username or password #935

Open
subbu05 opened this Issue Jan 20, 2017 · 92 comments

Comments

Projects
None yet
@subbu05
Copy link

subbu05 commented Jan 20, 2017

using CLI I am unable to login.

docker login
Login with your Docker ID to push and pull images from Docker Hub. If you don't have a Docker ID, head over to https://hub.docker.com to create one.
Username: USERNAME@gmail.com
Password:
Error response from daemon: Get https://registry-1.docker.io/v2/: unauthorized: incorrect username or password

OS MAC

docker version
Client:
Version: 1.13.0
API version: 1.25
Go version: go1.7.3
Git commit: 49bf474
Built: Wed Jan 18 16:20:26 2017
OS/Arch: darwin/amd64

Server:
Version: 1.13.0
API version: 1.25 (minimum version 1.12)
Go version: go1.7.3
Git commit: 49bf474
Built: Wed Jan 18 16:20:26 2017
OS/Arch: linux/amd64
Experimental: true

NOTE:
I am able to login when I mention server name.
docker login hub.docker.com
Username (username@gmail.com):
Password:
Login Succeeded

Also I able to login using browser - https://id.docker.com/login

@nick-freitas

This comment has been minimized.

Copy link

nick-freitas commented May 10, 2017

Your email and your docker id are 2 separate things. It looks like you can use your email to log in the site but not the CLI. To get your docker id log into https://www.docker.com/ with your email and password. On the top right is docker id. Use that in the CLI and you'll probably be fine.

@sandalle

This comment has been minimized.

Copy link

sandalle commented Jul 9, 2017

@nick-freitas I was having the same issue and this fixed it for me, thanks!

@Rancho06

This comment has been minimized.

Copy link

Rancho06 commented Jul 17, 2017

@nick-freitas This fixed my issue too. Thanks for the clarification.

@mojoblanco

This comment has been minimized.

Copy link

mojoblanco commented Jul 21, 2017

Thanks @nick-freitas .... Problem solved!

@lanimall

This comment has been minimized.

Copy link

lanimall commented Jul 28, 2017

thanks solved here too!

@tchcxp

This comment has been minimized.

Copy link

tchcxp commented Aug 2, 2017

Thanks for the clarification

@petertiedemann

This comment has been minimized.

Copy link

petertiedemann commented Aug 3, 2017

Just ran into this as well, perhaps this should be made clear in the CLI? It asks for "username", its not surprising that people try to reuse the credentials hub.docker.com is it?

@jamesfry

This comment has been minimized.

Copy link

jamesfry commented Aug 8, 2017

Just ran into this too on Docker for Mac - signed into the GUI using email address successfully, so assumed all fine but then CLI tools fail to pull images from dockerhub etc. Slightly confusing!

@ClintEsteMadera

This comment has been minimized.

Copy link

ClintEsteMadera commented Aug 12, 2017

Dear Docker developers: this distinction between ID and e-mail is quite 10 years old...please allow users successfully logged into the Docker GUI, automatically be logged when using the CLI...or at the very least allow them to use the default option you are suggesting which is their e-mail address. Thanks!

@DangChien

This comment has been minimized.

Copy link

DangChien commented Aug 21, 2017

FYI, on Mac, login using Docker ID on CLI is not good enough, you also need to login into the Docker for Mac GUI, then you can pull images. This is confusing too.

@hagnat

This comment has been minimized.

Copy link

hagnat commented Aug 27, 2017

imho, docker could either remove the email from the default username, or use email as login field if the user provides an email :P

@hero0926

This comment has been minimized.

Copy link

hero0926 commented Sep 6, 2017

How can I re-log in by CLI on Mac? I still have yo log into Docker with email.

@KWenn

This comment has been minimized.

Copy link

KWenn commented Sep 7, 2017

docker login

@andyliddle

This comment has been minimized.

Copy link

andyliddle commented Sep 20, 2017

I think this should allow me to set it as i would do if i was running docker normally.

I use Portainer.io and because of this I cannot get portainer to access the docker host its running on.

locahost:2375, 172.0.0.1:2375 or 192.168.192.1:2375 does not work from the container

@rodoxx

This comment has been minimized.

Copy link

rodoxx commented Oct 9, 2017

@nick-freitas thanks... solved!

@mcandre

This comment has been minimized.

Copy link

mcandre commented Oct 15, 2017

I admit I'm confused. Is CLI docker login separate from the GUI login?

@hero0926

This comment has been minimized.

Copy link

hero0926 commented Oct 16, 2017

@mcandre GUI and CLI is separated. If you loggged in by GUI, it doesn't mean you also logged in CLI

@spoobert

This comment has been minimized.

Copy link

spoobert commented Oct 28, 2017

LOL ME TOO! what a trivial problem that could have cost me some serious time tytyty.

@MetalArend

This comment has been minimized.

Copy link

MetalArend commented Nov 3, 2017

If you login with your email in the GUI (on Docker for Mac), you'll see that in the menu item Repositories stays empty, and you cannot pull (like mentioned before). However, if you logout, and login with your Docker ID instead of your email, everything works fine. There is even no need to login separately in the CLI.

@dmitry-chisw

This comment has been minimized.

Copy link

dmitry-chisw commented Nov 18, 2017

Hello everyone. If I use docker login and step-by-step I'm providing a creds, then docker Login Succeeded. But if I'm doing the same via single command, like docker login -u -p, then I got an error. I have noted, that in the first case Docker uses https://index.docker.io/v1/ but in the second it's https://registry-1.docker.io/v2/, then Get https://registry-1.docker.io/v2/: unauthorized: incorrect username or password. Why this is happens?

@zbeckman

This comment has been minimized.

Copy link

zbeckman commented Nov 18, 2017

Yea, the UI is very badly done. It will seem to let you login using your email, but this is only logging you in to your Docker account on docker.com as I understand. It does not log you in with the docker hub, and the only indication you have that something is wrong is 1) on a Mac, your repositories menu is empty, and 2) if you try to do "things" that require being logged in with the docker CLI, it won't work. Instead, login with your docker ID (the username you specified when you signed up). Then everything works. (Why the UI lets you login using email is beyond me...)

@jjqq2013

This comment has been minimized.

Copy link

jjqq2013 commented Nov 20, 2017

Not only for Mac, On my Windows 10 (Docker for Windows, Version 17.09.0-ce-win33 (13620),
I found a strange problem of the UI:
Being able to use docker pull, i sign in from the Docker icon, then i can not use docker pull (with same error as this issue).

@maxtortime

This comment has been minimized.

Copy link

maxtortime commented Nov 20, 2017

I also had this issue. (Windows 10) But I resolved this issue by using docker username instead of email at CLI.

@badjano

This comment has been minimized.

Copy link

badjano commented Dec 4, 2017

I had problem with my password, I used a password generator to create it and it worked fine on the browser, but on my mac on terminal it wouldn't let me login, the password was: `ZsM2y=3P5vEM\h , so I changed it to only letters and numbers and it worked

@huyngkh

This comment has been minimized.

Copy link

huyngkh commented Dec 11, 2017

the first answer solved my problem as well. Thank you!

@CoderPoet

This comment has been minimized.

Copy link

CoderPoet commented Dec 12, 2017

you can 'docker login'

@ijbhxhu

This comment has been minimized.

Copy link

ijbhxhu commented Dec 15, 2017

Thank you for solve my problem

@gegillam

This comment has been minimized.

Copy link

gegillam commented Dec 18, 2017

Thumbs up

@PabloEzequiel

This comment has been minimized.

Copy link

PabloEzequiel commented Dec 23, 2017

thanks @nick-freitas ... same error... same solution :)

@Issen007

This comment has been minimized.

Copy link

Issen007 commented Aug 22, 2018

I found following issue with Docker ID.

I found out like this.
If you are using Docker Community Edition on your Windows 10 Client you need to use your E-Mail as a Docker ID.
If you want to use a Linux CLI or PowerShell CLI and login to the same place you need to use your UserID.
And make sure your UserID is the same as the hub.docker.com and not the cloud.docker.com, and make sure you are case sensitive. If hub.docker.com spells your DockerID with lower case then your should use lower case in your CLI login also.

@chrisbeach

This comment has been minimized.

Copy link

chrisbeach commented Aug 26, 2018

Caught by this as well. The user experience issue could be fixed by accepting email address (in addition to username), or by warning the user if they try to login with email address.

A trivial fix will save Docker users a lot of wasted time.

@sumeng2014

This comment has been minimized.

Copy link

sumeng2014 commented Aug 30, 2018

docker login

@tzafar

This comment has been minimized.

Copy link

tzafar commented Sep 8, 2018

had same issue on Mac, login through CLI using your username (not email address) and that will fix the issue

@SonlyF5020

This comment has been minimized.

Copy link

SonlyF5020 commented Sep 11, 2018

in CLI, we can not use email as username, we need to login with the exact username. In dockerhub website we can login by email&password.

@kennedynyaga

This comment has been minimized.

Copy link

kennedynyaga commented Sep 14, 2018

screen shot 2018-09-14 at 15 09 40

Visual effects

@akashagarwal7

This comment has been minimized.

Copy link

akashagarwal7 commented Sep 20, 2018

Go to hub.docker.com. If you're already logged in, your username is on the top left, as a drop-down menu. Use that for CLI login using docker login.

@MessiahHoly

This comment has been minimized.

Copy link

MessiahHoly commented Sep 28, 2018

In my case, my password contains a single double quotation mark and a double quotation mark... I reset my password so that it does not contain any of those and this fixed the problem.

@rjain15

This comment has been minimized.

Copy link

rjain15 commented Sep 29, 2018

login doesn't work on zsh, I had to switch to sh to login.

@Krocsky

This comment has been minimized.

Copy link

Krocsky commented Oct 24, 2018

save my hours, thanks

@pentaphobe

This comment has been minimized.

Copy link

pentaphobe commented Oct 29, 2018

Pretty amazed this is still a thing - it's so old that I have stumbled across this thread over a year since I last did (probably shouldn't admit my memory is that bad)

@michaelaye

This comment has been minimized.

Copy link

michaelaye commented Nov 7, 2018

Same here. I fixed this a year ago. Now got a new machine, needed to install Docker, and that's STILL here. By the way, the install script on Mac really needs a #! to determine which shell it requires. Like instructed, it fails with fish.

@m0ver

This comment has been minimized.

Copy link

m0ver commented Nov 8, 2018

I got the issue in Windows, my solution is to remove the credential from Credential Manager. It works fine.

@trepidacious

This comment has been minimized.

Copy link

trepidacious commented Nov 16, 2018

I ran into this as well - I could imagine there are reasons for not resolving it by e.g. allowing use of either email or username to log in anywhere (e.g. maybe there are people who chose usernames that are other user's emails?).

However I can't see any reason at all that the docker CLI could not have a simple change to some strings to add the following when to all authentication errors:

use docker login to provide your credentials. This requires your username rather than your email. Your username is displayed when logged in to docker.com.

@agussudarmanto

This comment has been minimized.

Copy link

agussudarmanto commented Nov 18, 2018

To solve it properly.. you need to logout first.

docker logout
docker login
"enter ID, instead of email"
"enter password"

It should resolve this issue.

Thanks @nick-freitas for pointing out Email and ID confusion.

Regards,
Aziz

Do this, it resolve my problem

@jdelgit

This comment has been minimized.

Copy link

jdelgit commented Nov 20, 2018

This is still a thing.
No combination of email/username password is accepted. Some error
Windows 10 Home
Docker Toolbox

"Error response from daemon: Get https://registry-1.docker.io/v2/: unauthorized: incorrect username or password"

docker logout results in
"Not logged in to https://index.docker.io/v1/"

@hackhat

This comment has been minimized.

Copy link

hackhat commented Nov 28, 2018

I'm also getting "Get https://registry-1.docker.io/v2/library/node/manifests/9.11.2-alpine: unauthorized: incorrect username or password" what is going on?

@daeh

This comment has been minimized.

Copy link

daeh commented Dec 2, 2018

Yea, the UI is very badly done. It will seem to let you login using your email, but this is only logging you in to your Docker account on docker.com as I understand. It does not log you in with the docker hub, and the only indication you have that something is wrong is 1) on a Mac, your repositories menu is empty, and 2) if you try to do "things" that require being logged in with the docker CLI, it won't work. Instead, login with your docker ID (the username you specified when you signed up). Then everything works. (Why the UI lets you login using email is beyond me...)

what a weird ux fail. 1.5 year later and it's still an issue

@alexandresobolevski

This comment has been minimized.

Copy link

alexandresobolevski commented Dec 3, 2018

Hit this issue just now. I don't understand why it's not fixed yet.

@lugq1990

This comment has been minimized.

Copy link

lugq1990 commented Dec 4, 2018

We have to notice that for docker-hub and docker email login is not the same for me. So CLI using 'docker login' with hub username and hub password will solve this problem.

@EdDeAlmeidaJr

This comment has been minimized.

Copy link

EdDeAlmeidaJr commented Dec 8, 2018

I've tried all solutions given here, but I still get

Get https://registry-1.docker.io/v2/: net/http: request canceled while waiting for connection (Client.Timeout exceeded while awaiting headers)

@ninrod

This comment has been minimized.

Copy link

ninrod commented Dec 9, 2018

Just hit this issue now. seriously guys it's been 2 years. I suggest merging the id and the email.

@Ares513

This comment has been minimized.

Copy link

Ares513 commented Dec 12, 2018

When on a VirtualBox Ubuntu 16.04 with a Windows 10 host, login fails. I ssh'd into a pure Ubuntu box and it worked fine there. Really annoying and difficult to find.

@tholiao

This comment has been minimized.

Copy link

tholiao commented Dec 13, 2018

Telling users they aren't logged in in CLI when they are logged in to the GUI is extremely counter-intuitive and should be considered an anti-pattern. Just ran into this issue and it was a complete waste of my time.

@patelrikin

This comment has been minimized.

Copy link

patelrikin commented Dec 22, 2018

I had this CLI issue and it seems they are probably now pointing you to enter your user ID instead of your email. I logged in to Docker installed app using email/password but in CLI initially it was not letting me in but below worked for me:

$ docker login
Authenticating with existing credentials...
Stored credentials invalid or expired
Login with your Docker ID to push and pull images from Docker Hub. If you don't have a Docker ID, head over to https://hub.docker.com to create one.
Username (xxxx@gmail.com): docker_username
Password:
Login Succeeded

Try it for yourself to see if it fixes it. I did not had to do docker logout as FYI.

@kamilgregorczyk

This comment has been minimized.

Copy link

kamilgregorczyk commented Jan 2, 2019

I can login to hub.docker.com with my docker ID and password, I can log in the mac app but through CLI I'm getting:

➜  bank git:(master) docker login --username uniqe15
Password: 
Error saving credentials: error storing credentials - err: exit status 1, out: `The user name or passphrase you entered is not correct.`

I also copied the password to GUI and CLI

Edit:
I found solution, it's a MacOS problem. Open Keychain Access.app. Right-click on the login group, lock and unlock it.

@ctrlaltdylan

This comment has been minimized.

Copy link

ctrlaltdylan commented Jan 4, 2019

This is ridiculous but it worked for me on Mac:

  • Login through the docker UI WITH YOUR DOCKER ID. Yes by Docker ID I mean your username NOT your email
  • Verify your cli is in sync by running docker login. It should automatically attempt to login with your docker ID instead of your docker email.

The problem stems from the GUI allowing you to login with your email but the CLI not allowing you to login with anything but your docker ID. Pretty bad mismatch there.

@ehallander9591

This comment has been minimized.

Copy link

ehallander9591 commented Jan 14, 2019

So, why isn't it stated in the Getting Started that your docker id, and the email id used to establish an account are different? That would have saved some time and at least one staring at the inside of my eyelids sessions as I kept hitting the same wall time and time again.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment