docker login to GitLab Registry: Better error message, or better documentation
Everyone can contribute. Help move this issue forward while earning points, leveling up and collecting rewards.
I spent almost 3h today trying to docker login -u myUsername -p myPassword registry.gitlab.com.
The only error message it showed me was Error response from daemon: Get https://registry.gitlab.com/v2/: error parsing HTTP 403 response body: unexpected end of JSON input: "", which - from the "403" - I could identify as "Forbidden" but I didn't get any clue why I could not login, my password was definitely correct.
Then, looking through 3-years-old issues I found out that when using 2FA, you have to get an access token and use that as the password. Only problem: I didn't have 2FA activated, so it should not have affected me. Then I thought: Ok, let me just try to activate 2FA, create an accesss token and then try to login again - no luck: Still getting the 403.
After more research and trying out different approaches, I read something about IP blocks. So I connected to a VPN and boom: Login successful.
So here is what I suggest. Would it be possible to
- first of all, not have the docker client throw an "unexpected end of json" error? Would it be possible to send a valid json although the requested resource might be forbidden?
- Can the error message then distinguish between
- a) Sorry, username/password is wrong.
- b) Sorry, username/password is wrong. We noticed you're using 2FA, so your account password won't work here! Please try an access key instead.
- b) Sorry, too many login attempts. Please wait [x] minutes.
- Last but not least, can the documentation resemble the current workflow? Is it still possible to login with username and password, when 2FA is disabled? Does docker have problems with special chars on the command line?
Thanks for building this amazing software. :)