docker / hub-feedback

Feedback and bug reports for the Docker Hub
https://hub.docker.com
235 stars 39 forks source link

push fails: 'denied: requested access to the resource is denied' #1222

Closed drewmullen closed 4 years ago

drewmullen commented 7 years ago

solution: https://github.com/docker/hub-feedback/issues/1222#issuecomment-591599629

Expected behavior

docker should push the image to public docker hub registry

Actual behavior

$ docker push drewmullen/tc-common The push refers to a repository [docker.io/drewmullen/tc-common] c6d78ef51be8: Preparing cf516324493c: Preparing denied: requested access to the resource is denied

Information

Verified repo is public (https://hub.docker.com/r/drewmullen/tc-common/)

Docker for Mac: version: 17.06.2-ce-mac27 (4cdec4294a50b2233146b09469b49937dabdebdd) macOS: version 10.12.6 (build: 16G29) logs: /tmp/FF32B403-4A84-4923-BBAB-9D08CD3B10E3/20171025-145959.tar.gz [OK] db.git [OK] vmnetd [OK] dns [OK] driver.amd64-linux [OK] virtualization VT-X [OK] app [OK] moby [OK] system [OK] moby-syslog [OK] db [OK] env [OK] virtualization kern.hv_support [OK] slirp [OK] osxfs [OK] moby-console [OK] logs [OK] docker-cli [OK] menubar [OK] disk Failure: Could not upload diagnostic data to remote server (docker-diagnose exit code is 1)

Steps to reproduce the behavior

  1. git clone https://github.com/docker-teamcenter/tc-common/blob/master/Dockerfile
  2. docker build -t tc-common .
  3. docker tag <container-id> drewmullen/tc-common
  4. docker login (successful)
  5. docker push drewmullen/tc-common
hrmmmwhynot commented 6 years ago

same here. exact same steps can't push my image to public repo. my image is around 850MB if that makes a difference (it was downloaded from another public image on docker hub that I am making my own).

Edit: Alright, here's what I did as a workaround. I changed my repository on docker hub to private. Then I did:

  1. docker login docker.io
  2. docker push username/reponame and then it worked.

Aftwards, I went back into docker hub and made the repo public.

ghost commented 6 years ago

I meet the same issue, use hrmmmwhynot's way is ok. @hrmmmwhynot thank you very much !

jianzhangbjz commented 6 years ago

I encounter this issue too, below is details:

[root@qe-jiazha-30master-etcd-1 ~]# docker login https://hub.docker.com
Username: 
Password: 
Login Succeeded
[root@qe-jiazha-30master-etcd-1 ~]# docker push docker.io/zjianbjz/rds-mysql-apb:latest
The push refers to a repository [docker.io/zjianbjz/rds-mysql-apb]
41d083b98632: Preparing 
624a426c6654: Preparing 
9ce030f02697: Preparing 
436fdce83513: Preparing 
5ea52d19cfbd: Preparing 
724fdd07fd6a: Waiting 
b362758f4793: Waiting 
denied: requested access to the resource is denied

But, It works after I changed the docker login https://hub.docker.com to docker login docker.io. Just for your reference.

[root@qe-jiazha-30master-etcd-1 ~]# docker login docker.io
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: zjianbjz
Password: 
Login Succeeded
[root@qe-jiazha-30master-etcd-1 ~]# docker push docker.io/zjianbjz/rds-mysql-apb:latest
The push refers to a repository [docker.io/zjianbjz/rds-mysql-apb]
41d083b98632: Pushed 
624a426c6654: Pushed 
9ce030f02697: Pushed 
436fdce83513: Pushed 
5ea52d19cfbd: Pushed 
724fdd07fd6a: Pushed 
b362758f4793: Pushed 
latest: digest: sha256:6671ac80fdef678fe30295abccd378556e46d9b215bbbb43b54641d658980622 size: 1785
arnold-parge commented 6 years ago

I tried: docker login OR docker login docker.io

I get Login Succeeded

But when I push: docker push arnoldnonsotp/match_microservice OR docker push arnoldnonsotp/match_microservice:latest OR docker push docker.io/arnoldnonsotp/match_microservice

It gives me bellow error:

denied: requested access to the resource is denied

I have to build and tag the image every time which takes lot of time.

My other images get pushed properly. I am not understanding what is the problem with this image!

arnold-parge commented 6 years ago

OK the problem is solved!

username in docker push arnoldnonsotp/match_microservice was wrong.

gwaixin commented 6 years ago

I had the same weird experience, i tried to re-login my docker account and restarted docker itself but the denied prompt still persist not until I restarted my terminal and magically i was able to push

hbirkdale commented 6 years ago

I'm getting the same problem - I think this is a Docker issue as I can't login at all via the Docker menus in the toolbart.

pyramation commented 6 years ago

still getting this issue as well

mks-d commented 6 years ago

This happened to me just now and @hrmmmwhynot's suggestion here did work.

hbirkdale commented 6 years ago

Doesn't work for me.

mks-d commented 6 years ago

@hbirkdale I could now push again simply with the sequence:

docker login
docker push <tag>

And without switching the repo to private. None of this really makes sense, but somehow it unlocked my problem on this one repo.

ysicing commented 6 years ago

Doesn't work for me too.

# use bash
Successfully tagged ysicing/api:3.7.2
The push refers to repository [docker.io/ysicing/api]
5e25d539972a: Preparing
9219798a8c0b: Preparing
664478f11dfc: Preparing
cdac3ff2d084: Preparing
e544f3de5cc6: Preparing
2b0fb280b60d: Waiting
denied: requested access to the resource is denied
# use cmd
docker push ysicing/api:3.7.2
The push refers to repository [docker.io/ysicing/api]
5e25d539972a: Pushed
9219798a8c0b: Pushed
664478f11dfc: Pushed
cdac3ff2d084: Layer already exists
e544f3de5cc6: Layer already exists
2b0fb280b60d: Layer already exists
3.7.2: digest: sha256:63605021b6b1827df01ebf37725b6c4fd40a5b300efb69387a669cabc71173f5 size: 1575
thiagodasilva commented 6 years ago

I'm running into a similar error, but only when I push to an organization that I'm a member of. I'm able to push to my own account: docker push thiagodasilva/nas-connector but if I try pushing to an organization that I'm a member of, then I get the resource is denied error:

[vagrant@server0 ~]$ docker push swiftstack/nas-connector
The push refers to repository [docker.io/swiftstack/nas-connector]
6207310412a4: Preparing 
18a5ab427641: Preparing 
e9c54c6d3495: Preparing 
08265176ca79: Preparing 
a02473facb8f: Preparing 
eb36051657b4: Waiting 
20a25c4da571: Waiting 
05f6f6538865: Waiting 
5cc8a79bb376: Waiting 
981a69e5b47e: Waiting 
7a1bb740e0d0: Waiting 
5c283207b9bd: Waiting 
6f2cfb60533f: Waiting 
5b76ca25962e: Waiting 
2da59ce9faf1: Waiting 
7bcff99b1b80: Waiting 
ebf12965380b: Waiting 
denied: requested access to the resource is denied

any ideas?

pyramation commented 6 years ago

I've tried all of the above workarounds. This issue seems widespread with no legit explanations or resolutions. I've continuously had this issue and ultimately resorted to hosting a private registry.

Is this just a legitimate bug? Any light shed would be greatly appreciated :)

anthonyskipper commented 6 years ago

We have been having this issue as well since yesterday... still happening today. This is on a CI/CD process that worked before and nothing changed. Can't find any indication of a problem, so kinda feel this is on the docker hub side. Is there a way to open a support ticket?

jmwong commented 6 years ago

Hi @thiagodasilva , @pyramation, @anthonyskipper @ysicing , sorry for the inconvenience caused. Our team is looking into the issue. In the meantime, do you mind reaching out to support@docker.com with more details?

thiagodasilva commented 6 years ago

Ok, I was just able to solve my issue. It was a change required on our side. My understanding now is that only "owners" can create new repos, once an owner creates a repo they can add other teams in the organization as "collaborators" and set the right permissions for that team/repo combination.

jcrodriguezu commented 6 years ago

Any update with this issue? we are having the same problem with a private repo.

anthonyskipper commented 6 years ago

I opened up a support request but no resolution or contact back.

On Tue, Nov 13, 2018 at 7:31 PM Juan Carlos notifications@github.com wrote:

Any update with this issue? we are having the same problem with a private repo.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/docker/hub-feedback/issues/1222#issuecomment-438491969, or mute the thread https://github.com/notifications/unsubscribe-auth/AAEr4oHvQUUIIbVVAZyP8ERsMT-JPRn2ks5uu2R2gaJpZM4QGgqI .

vanities commented 6 years ago

same here. exact same steps can't push my image to public repo. my image is around 850MB if that makes a difference (it was downloaded from another public image on docker hub that I am making my own).

Edit: Alright, here's what I did as a workaround. I changed my repository on docker hub to private. Then I did:

1. docker login docker.io

2. docker push username/reponame
   and then it worked.

Aftwards, I went back into docker hub and made the repo public.

Did this but from private to public to private again.

jeffrey-aguilera commented 6 years ago

I have the same problem when I push from Linux (on a Travis xenial instance), but NOT from my MacBook ... using same commands, username, and password.

anthonyskipper commented 6 years ago

Jeffery, One potentiall issue if you see it on linux but not macbook... it is typically that when you run the docker login command it saves the credentials to filesystem and sometimes on linux the file system permissions refuse to let you save be default. Then when you try the push it fails. Docker, should verify on a login command that the credentials that logged-in were successfully saved before they return everything is ok.

Regards, Anthony Skipper

On Wed, Nov 28, 2018 at 2:33 AM Jeffrey Aguilera notifications@github.com wrote:

I have the same problem when I push from Linux (on a Travis xenial instance), but NOT from my MacBook ... using same commands, username, and password.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/docker/hub-feedback/issues/1222#issuecomment-442347976, or mute the thread https://github.com/notifications/unsubscribe-auth/AAEr4i9fti1RCdTxMY319iGKg6ea5kUbks5uzjxMgaJpZM4QGgqI .

xtrasimplicity commented 6 years ago

I had this issue too and none of the methods above worked for me. I did find, however, that running docker login --username [myusername] and then running docker push resolved the issue. :)

Edit: Interestingly, docker login (without the username) didn't work for me.

dtytomi commented 5 years ago

After trying a few of the examples above and didn't work I did some google search and I was able to get this link: https://ropenscilabs.github.io/r-docker-tutorial/04-Dockerhub.html and did the followings: docker login --username=yourhubusername --email=youremail@company.com

docker images example of output:

REPOSITORY TAG IMAGE ID CREATED SIZE

verse_gapminder_gsl latest 023ab91c6291 3 minutes ago 1.975 GB

verse_gapminder latest bb38976d03cf 13 minutes ago 1.955 GB

rocker/verse latest 0168d115f220 3 days ago 1.954 GB

and then did this: docker tag bb38976d03cf yourhubusername/verse_gapminder:firsttry Lastly docker push yourhubusername/verse_gapminder

But I believe you understand where you need to replace things appropriately.

wistonk commented 5 years ago

You need to remove maintained credentials then login again;

  1. sudo rm -f ~/.docker/config.json
  2. docker login
  3. docker push [DOCKER_ID]/[DOCKER_IMAGE_NAME]:[IMAGE_TAG]
theopskart22 commented 5 years ago

docker login -u=abc -p password -- Login to hub account Create a new repo in docker tag ur image with repo name : -- from docker hub run command: docker tag jenkins/ubuntu:v1.3.0 reponame/image:lts then push : docker push image:version

miry commented 5 years ago

I had the same issue. Disabled in Docker preference usage of Keychain for docker credentials. It seems from terminal it requires to have special security permissions to access Keychain.

JorgeRSG commented 5 years ago

Happened to me today, completely out of the blue, some repositories work and some others just don'e allow me to do anything...

nrabia commented 5 years ago

Deas,

in my case i wasn't able to push my changes using jenkins

but after login to docker using docker login from the server and re run the build on jenkins it's work

cynen commented 5 years ago

same here. exact same steps can't push my image to public repo. my image is around 850MB if that makes a difference (it was downloaded from another public image on docker hub that I am making my own).

Edit: Alright, here's what I did as a workaround. I changed my repository on docker hub to private. Then I did:

  1. docker login docker.io
  2. docker push username/reponame and then it worked.

Aftwards, I went back into docker hub and made the repo public.

aha~i did't do like this, but it give me some ideas ,so i change the tag ,then , it's work.... The push refers to repository [docker.io/alpine/ssr] 22ec9120fd63: Preparing ef96edf599a7: Preparing 76a28ae5bf60: Preparing 13e92f8c3e10: Preparing d9ff549177a9: Preparing denied: requested access to the resource is denied

after i new tag this image , i can push it docker tag 2a5216f21be1 cynen/alpinessr:1.0 [root@vultr ssr]# docker push cynen/alpinessr:1.0 The push refers to repository [docker.io/cynen/alpinessr] 22ec9120fd63: Pushed ef96edf599a7: Pushed 76a28ae5bf60: Pushed 13e92f8c3e10: Pushed d9ff549177a9: Pushed 1.0: digest: sha256:336a7db80b8de77b6e84b68dff95d7d43c4e6e1d1581fcf51ab42d41d7628bbb size: 1365

palakonda5 commented 5 years ago

docker push rao1005/docker_09may19/build The push refers to repository [docker.io/rao1005/docker_09may19/build] 32e77d4f999b: Preparing 332fa54c5886: Preparing 6ba094226eea: Preparing 6270adb5794c: Preparing denied: requested access to the resource is denied

Please suggest me

seunaa commented 5 years ago

I've been having this same issue over and over. docker push still does not work after I used docker login. My password has no special characters. Besides the method I have been using to tag and push images to dockerhub has not changed.

zackbakkal commented 5 years ago

After trying a few of the examples above and didn't work I did some google search and I was able to get this link: https://ropenscilabs.github.io/r-docker-tutorial/04-Dockerhub.html and did the followings: docker login --username=yourhubusername --email=youremail@company.com

docker images example of output:

REPOSITORY TAG IMAGE ID CREATED SIZE

verse_gapminder_gsl latest 023ab91c6291 3 minutes ago 1.975 GB

verse_gapminder latest bb38976d03cf 13 minutes ago 1.955 GB

rocker/verse latest 0168d115f220 3 days ago 1.954 GB

and then did this: docker tag bb38976d03cf yourhubusername/verse_gapminder:firsttry Lastly docker push yourhubusername/verse_gapminder

But I believe you understand where you need to replace things appropriately.

This method worked for me like a charm. Thanks

Aftabalamrana commented 5 years ago

well this worked for me

abdullah-nawaz commented 5 years ago

make sure you have added your user id as collaborator in your repository.

someshvaidya commented 5 years ago

I created the images as repository path with different tag then pushed the image.. it worked for me. docker build -t username/repositoryname:tagTestPush . docker push username/repositoryname:tagTestPush

nomoreboredom commented 5 years ago

For reference putting here, in my case the documentation https://circleci.com/docs/2.0/custom-images/#creating-a-custom-image-manually was directing me to create the build with

$ docker build -t circleci/cci-demo-docker-primary:0.0.1 <path-to-dockerfile> and push with $ docker push circleci/cci-demo-docker-primary:0.0.1

however had to change 'circleci' to MYUSERNAME so use it like:

$ docker build -t MYUSERNAME/cci-demo-docker-primary:0.0.1 <path-to-dockerfile> and $ docker push MYUSERNAME/cci-demo-docker-primary:0.0.1

chasticfy commented 5 years ago

For me, the answer was simple but annoying to find I forgot to tag my image with the username also I made it private do not know if that's really necessary please let me know if that's the case. so other people can learn from it and me :)

thnx for this post it was helpful. btw sorry I am a little bit off-topic.

swistak35 commented 5 years ago

What helped for me:

rm -f ~/.docker/config.json
docker login
docker login docker.io

Don't ask me why this exact combination of magic commands, only removing + login didn't help, only changing login to docker.io didn't help neither

EDIT: This is what I think what helped me

ruqianl commented 5 years ago

tag my image with the username

That worked for me.

deepakjoseph08 commented 5 years ago

For reference putting here, in my case the documentation https://circleci.com/docs/2.0/custom-images/#creating-a-custom-image-manually was directing me to create the build with

$ docker build -t circleci/cci-demo-docker-primary:0.0.1 <path-to-dockerfile> and push with $ docker push circleci/cci-demo-docker-primary:0.0.1

however had to change 'circleci' to MYUSERNAME so use it like:

$ docker build -t MYUSERNAME/cci-demo-docker-primary:0.0.1 <path-to-dockerfile> and $ docker push MYUSERNAME/cci-demo-docker-primary:0.0.1

*** This worked for me..

johannarojasgonzalez commented 5 years ago

I am on macos, and I am already logged with Docker Desktop.

I am able to login on docker hub.

However it is impossible to push an image, I get : requested access to the resource is denied.

I tried logout from GUI, then login by CLI but I am always getting Error saving credentials: error storing credentials - err: exit status 1, out: The user name or passphrase you entered is not correct.

I already tried everything with no success. Do you have any idea ?

chasticfy commented 5 years ago

Well it seems its telling you that your username or password is incorrect if it is actully correct. And i do know if soms one tels you tot try again the password and username that it can be very frustrating. But Just do it and test it before from a sourc that works.

Maybe a different approach is necessary can you try this: https://www.google.com/url?sa=t&source=web&rct=j&url=https://docs.docker.com/engine/reference/commandline/login/%23credentials-store&ved=2ahUKEwj6jebwmsLjAhUD6KQKHaYlC-4QygQwAXoECAUQDg&usg=AOvVaw1nllDUEzoCVmae0eeUBlUi&cshid=1563581491221

Please let us know what happens. Also can you specify more information about what commands you have used.

Greetz Rick

AtinMaiti commented 5 years ago

Steps that resolved for me were:

  1. Re-login
  2. command: docker run docker.io/dockerid/imagename:latest
gomsi8882 commented 5 years ago

here are the steps we need to follow if we want deploy in private repository

1) docker login 2) docker images ( we need to run this command to get the image id, repository name) 3) docker tag username/repository:latest 4) docker push repository:latest

or

1) docker login 2) docker images ( we need to run this command to get the image id, repository name) example of output:

REPOSITORY TAG IMAGE ID CREATED SIZE 3) docker tag repository name username/repository:latest 4) docker push repository:latest

here are the steps we need to follow if we want deploy in azure portal container registry we need to follow below steps

1) az login --use-device-code 2) az acr login -n container registries name 3) docker images 4) docker tag repository name .azurecr.io/repository:latest 5) docker push .azurecr.io/repository:latest

johannarojasgonzalez commented 5 years ago

@chasticfy

Finally I made it work

I delete the file config.json in /home/.docker I restart docker And finally I was able to login again

xperjon commented 5 years ago

For me it was never related to credentials. I had just exceeded the limit for number of private repositories on docker hub.

Okirshen commented 5 years ago

same error, I switched my image name with docker tag <old tag> <new tag> to username/image_name and it worked

jyotty commented 5 years ago

For me it was never related to credentials. I had just exceeded the limit for number of private repositories on docker hub.

Apparently they set a flag on a repository when you create a it in excess of the limit, because after deleting extraneous repos pushes still failed until I deleted and recreated the repo in question.

This really ought to have a better error message.

xiaguoxin commented 5 years ago

I got "denied" message while using sudo docker push, fixed by using docker push.