itaiman5
itaiman5

Reputation: 61

action: push: unauthorized to access repository docker harbor registry

I’m trying to push to harbor registry 2.2. It works with ssl and the storage is on locally mounted NFS share. The error I get is: unauthorized to access repository: test/flask, action: push: unauthorized to access repository: test/flask, action push.

I tried to push with the admin user to project that I’ve created it with.

I tried to change the permission of the nfs share and it didn’t work.

The registry is on compose and not on Kubernetes.

Upvotes: 5

Views: 31010

Answers (6)

WKstraw
WKstraw

Reputation: 67

In case anyone finds this now and has setup pass for credential store, I had the same issue, except my docker login myregistry.example.com worked, and performing a logout-login didn't solve it (using docker logout myregistry.example.com).

The solution was that I had to "refresh" my pass token, by manually showing one of my saved passwords (e.g.: pass show docker-credential-helpers/docker-pass-initialized-check if you also followed this tutorial for setting up pass with docker). This prompted for my GPG key password. After successfully entering it, re-running docker push myregistry.example.com/<my project>/<my tag> worked without errors!

Upvotes: 0

francisco
francisco

Reputation: 2119

I had this problem on linux.

If you use sudo docker login ..., you need to do sudo docker pull ....

If you don't use sudo in the docker login, you don't need the sudo for docker pull.

Upvotes: 0

derv-dice
derv-dice

Reputation: 70

If anybody here, my solution is remove sudo from command if exists.

sudo docker pull --> docker pull and try

Upvotes: 2

Ahad Dastbelaraki
Ahad Dastbelaraki

Reputation: 119

I had the same issue. In my case, the problem was that the username and password that were used in the GitLab pipeline were protected. This means that they were only shared with pipelines from a protected branch like master for example. Since I was testing my changes in the pipeline in a feature branch, all I had to do was to go to variable settings and uncheck the protected flag for harbor user and password so it can be shared with the pipelines that were running from feature branches.

Upvotes: 0

Kevin Baroni
Kevin Baroni

Reputation: 91

Had the same inexplicable issue, just started happening one day after several months with no issues. Required me to explicitly logout of Harbor registry and then login.

  1. docker logout registry.example.com
  2. docker login registry.example.com

After this sequence, the "unauthorized to access" went away, and pushes began working again.

Upvotes: 9

Sim
Sim

Reputation: 382

I had the similar problem and the solution was docker login registry.example.com .

Upvotes: 1

Related Questions