0

First of all, I must tell this is an operation I have done many times, with no issues.

I have a docker image registry.gitlab.com/company/metadata_api with dev tag.

➜  metadata_api git:(no_basic_auth) ✗ docker images | grep registry.gitlab.com/company/metadata_api
    registry.gitlab.com/company/metadata_api           dev                 80cdbdb33ec9        7 minutes ago       12.2MB
    registry.gitlab.com/company/metadata_api           latest              d9918d874a55        3 weeks ago         12.3MB

I have a deploy token for the project with both scopes read_repository, read_registry

I also have a global personal access token that I will use to discard rigths issues

➜  metadata_api git:(no_basic_auth) ✗ docker login registry.gitlab.com -u oauth2 
Password: 
Login Succeeded

When I try to push, I get :

requested access to the resource is denied

Why ?

➜  metadata_api git:(no_basic_auth) ✗ docker push registry.gitlab.com/company/metadata_api:dev
The push refers to repository [registry.gitlab.com/company/metadata_api]
a9ae54b0eb8c: Preparing 
denied: requested access to the resource is denied
Juliatzin
  • 18,455
  • 40
  • 166
  • 325

2 Answers2

0

I have a deploy token for the project with both scopes read_repository, read_registry

[...]

When I try to push, I get : requested access to the resource is denied

You lack the proper scope to push to registry (you only have read permission). With deploy tokens you cannot push to registry, as per Gitlab indication on the Deploy Token page:

Deploy tokens allow read-only access to your repository and registry images.

There an open issue for write_registry permissions on registry for Deploy Tokens being discussed.

Maybe try using an access token with scope api

Community
  • 1
  • 1
Pierre B.
  • 11,612
  • 1
  • 37
  • 58
  • api scope is for Personal Access Token, not for Deploy Token – Juliatzin Jul 26 '19 at 13:19
  • I already tried to use a personal token with all rights on all repo and it was not working... As I answered before, a reboot fixed the issue. Je peux partir en week end :) – Juliatzin Jul 26 '19 at 14:03
0

I rebooted my computer, and it worked!

Juliatzin
  • 18,455
  • 40
  • 166
  • 325