Error unauthorized: HTTP Basic: Access denied on docker push registry.gitlab.com
Asked Answered
T

2

9

I have error with:

docker push registry.gitlab.com/user/rep-name

The push refers to repository [registry.gitlab.com/user/rep]
f319ccdf8ee4: Preparing 
..
7032a7172c0a: Preparing 
b16cd70f3a2c: Waiting 
...
unauthorized: HTTP Basic: Access denied

But prev login is Succeeded:

docker login registry.gitlab.com
Username: user
Password: 
Login Succeeded

Docker ver:

docker -v
Docker version 19.03.8, build afacb8b7f0

I use Personal Access Token is "api" https://gitlab.com/profile/personal_access_tokens

because I have 2-factor athorization.

Turmoil answered 13/4, 2020 at 22:33 Comment(0)
T
7

I change:

now it is works.

Seems issue is in "read_registry" scope. And it is strange because "api" also have read access. From Gitlab:

Grants complete read/write access to the API, including all groups and projects, the container registry, and the package registry.

Turmoil answered 13/4, 2020 at 22:33 Comment(1)
No need to check api.Osmious
L
2

The above answer didn't work for me.

In my case - I too had SSO - had to use the token name instead of my username/email

  1. Generated a token with read_registry and api persmission
  2. docker login -u <PERSONAL_ACCESS_TOKEN_NAME> -p <PERSONAL_ACCESS_TOKEN_KEY> registry.gitlab.com

Hope this helps someone.

Lollop answered 3/8, 2022 at 3:36 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.