Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

unable to push my image to Docker Hub #31760

Closed
vivekkrdubey opened this issue Mar 12, 2017 · 21 comments
Closed

unable to push my image to Docker Hub #31760

vivekkrdubey opened this issue Mar 12, 2017 · 21 comments
Labels
area/distribution kind/enhancement Enhancements are not bugs or new features but can improve usability or performance.

Comments

@vivekkrdubey
Copy link

Hi I am able to successfully login but unable to push my local image to Docker Hub.

#-> docker login
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: vivekkrdubeyhub
Password:
Login Succeeded
#-> docker push vivekkrdubeyhub/myrepo
The push refers to a repository [docker.io/vivekkrdubeyhub/myrepo]
3602cd2b738c: Preparing
ad12c47d819e: Preparing
074e78f994f8: Preparing
c15c995bb6bf: Preparing
00343924ca78: Preparing
56827159aa8b: Waiting
440e02c3dcde: Waiting
29660d0e5bb2: Waiting
85782553e37a: Waiting
745f5be9952c: Waiting
denied: requested access to the resource is denied

I have tried logging out, re-login, create new Docker Hub user but still nothing helps.

My config.json looks like

{
"auths": {
"https://index.docker.io/v1/": {
"auth": "Some Text Here"
}
}

Please help !!

@thaJeztah
Copy link
Member

Can you provide the information that's requested in the issue template? At least the output of docker version and docker info; checking if the daemon or system logs contain anything useful may be helpful as well

Alsl keep in mind that the GitHub issue tracker is not intended as a general support forum,
but for reporting bugs and feature requests. For other type of questions, consider using one of;

@vivekkrdubey
Copy link
Author

DOCKER VERSION

#-> docker version
Client:
Version: 17.03.0-ee-1
API version: 1.26
Go version: go1.7.5
Git commit: 9094a76
Built: Wed Mar 1 01:18:47 2017
OS/Arch: linux/amd64

Server:
Version: 17.03.0-ee-1
API version: 1.26 (minimum version 1.12)
Go version: go1.7.5
Git commit: 9094a76
Built: Wed Mar 1 01:18:47 2017
OS/Arch: linux/amd64
Experimental: false

Docker Info

#-> docker info
Containers: 0
Running: 0
Paused: 0
Stopped: 0
Images: 7
Server Version: 17.03.0-ee-1
Storage Driver: overlay
Backing Filesystem: xfs
Supports d_type: false
Logging Driver: json-file
Cgroup Driver: cgroupfs
Plugins:
Volume: local
Network: bridge host macvlan null overlay
Swarm: inactive
Runtimes: runc
Default Runtime: runc
Init Binary: docker-init
containerd version: 977c511eda0925a723debdc94d09459af49d082a
runc version: a01dafd48bc1c7cc12bdb01206f9fea7dd6feb70
init version: 949e6fa
Security Options:
seccomp
Profile: default
Kernel Version: 3.10.0-514.2.2.el7.x86_64
Operating System: Red Hat Enterprise Linux Server 7.3 (Maipo)
OSType: linux
Architecture: x86_64
CPUs: 2
Total Memory: 7.388 GiB
Name:
ID: ITLG:Z7GF:B7ZJ:IJ3X:KINS:PI2M:U2V6:F4TK:VFWK:3LVT:B4IA:74SJ
Docker Root Dir: /var/lib/docker
Debug Mode (client): false
Debug Mode (server): true
File Descriptors: 16
Goroutines: 23
System Time: 2017-03-13T20:15:35.969561193-04:00
EventsListeners: 0
Username: vivekkrdubeyhub
Registry: https://index.docker.io/v1/
Experimental: false
Insecure Registries:
127.0.0.0/8
Live Restore Enabled: false

Please let me know in case of any queries.

@thaJeztah
Copy link
Member

I don't see anything standing out from that output; do you still have damon logs from when the push failed Ideally of the daemon in debug mode)? If you're still able to reproduce, can you put the daemon in debug mode; easiest way is to create a file named /etc/docker/daemon.json, containing the following;

{ "debug":true }

And restart the daemon (systemctl restart docker), then try pushing a gain, and check the daemon logs

@defsprite
Copy link

defsprite commented Mar 21, 2017

I'm seeing the same issue with Docker version 17.03.0-ce, build 3a232c8

Here is the relevant log output:

Mar 21 07:38:09 hostname dockerd[31421]: time="2017-03-21T07:38:09.354483299Z" level=debug msg="Calling GET /_ping"
Mar 21 07:38:09 hostname dockerd[31421]: time="2017-03-21T07:38:09.355579414Z" level=debug msg="Calling GET /v1.26/info"
Mar 21 07:38:12 hostname dockerd[31421]: time="2017-03-21T07:38:12.600841789Z" level=debug msg="Calling POST /v1.26/auth"
Mar 21 07:38:12 hostname dockerd[31421]: time="2017-03-21T07:38:12.604708916Z" level=debug msg="form data: {\"password\":\"*****\",\"serveraddress\":\"docker.io\",\"username\":\"defsprite\"}"
Mar 21 07:38:12 hostname dockerd[31421]: time="2017-03-21T07:38:12.607932895Z" level=debug msg="attempting v2 login to registry endpoint https://registry-1.docker.io/v2/"
Mar 21 07:38:13 hostname dockerd[31421]: time="2017-03-21T07:38:13.618740252Z" level=error msg="Handler for POST /v1.26/auth returned error: Get https://registry-1.docker.io/v2/: unauthorized: incorrect username or password"
Mar 21 07:39:04 hostname dockerd[31421]: time="2017-03-21T07:39:04.710711078Z" level=debug msg="Calling GET /_ping"
Mar 21 07:39:04 hostname dockerd[31421]: time="2017-03-21T07:39:04.711745251Z" level=debug msg="Calling GET /v1.26/info"
Mar 21 07:39:07 hostname dockerd[31421]: time="2017-03-21T07:39:07.484527772Z" level=debug msg="Calling POST /v1.26/auth"
Mar 21 07:39:07 hostname dockerd[31421]: time="2017-03-21T07:39:07.490007530Z" level=debug msg="form data: {\"password\":\"*****\",\"serveraddress\":\"docker.io\",\"username\":\"defsprite\"}"
Mar 21 07:39:07 hostname dockerd[31421]: time="2017-03-21T07:39:07.491427572Z" level=debug msg="attempting v2 login to registry endpoint https://registry-1.docker.io/v2/"
Mar 21 07:39:13 hostname dockerd[31421]: time="2017-03-21T07:39:13.078546658Z" level=debug msg="Calling GET /_ping"
Mar 21 07:39:13 hostname dockerd[31421]: time="2017-03-21T07:39:13.079511949Z" level=debug msg="Calling GET /v1.26/info"
Mar 21 07:39:13 hostname dockerd[31421]: time="2017-03-21T07:39:13.092462544Z" level=debug msg="Calling POST /v1.26/images/defsprite/build-tools/push?tag="
Mar 21 07:39:13 hostname dockerd[31421]: time="2017-03-21T07:39:13.092803420Z" level=debug msg="Trying to push docker.io/defsprite/build-tools to https://registry-1.docker.io v2"
Mar 21 07:39:13 hostname dockerd[31421]: time="2017-03-21T07:39:13.872555284Z" level=debug msg="Pushing repository: defsprite/build-tools:latest"
Mar 21 07:39:13 hostname dockerd[31421]: time="2017-03-21T07:39:13.873680513Z" level=debug msg="Pushing layer: sha256:07f72cc3d57ed9ca7260467503e8aaf273efaf961c66f46d74274c06b60c6479"
Mar 21 07:39:13 hostname dockerd[31421]: time="2017-03-21T07:39:13.874162602Z" level=debug msg="Pushing layer: sha256:9f8566ee5135862dd980160c27bd7721448a6f7f385bbb81f7f001f1b78a5fbf"
Mar 21 07:39:13 hostname dockerd[31421]: time="2017-03-21T07:39:13.873953245Z" level=debug msg="Checking for presence of layer sha256:7f794a66cff20f39dd0e136f3b0cb27ee6a04f3e2c7e10cbede7eebca310e5ba (sha256:f82e70e369d6626ba93a96879a09b8a0ce713aa01f9c947f7b5cec69bd80d03c) in docker.io/defsprite/build-tools"
Mar 21 07:39:14 hostname dockerd[31421]: time="2017-03-21T07:39:14.960454621Z" level=error msg="Upload failed: denied: requested access to the resource is denied"
Mar 21 07:39:14 hostname dockerd[31421]: time="2017-03-21T07:39:14.964934717Z" level=error msg="Upload failed: denied: requested access to the resource is denied"
Mar 21 07:39:15 hostname dockerd[31421]: time="2017-03-21T07:39:15.019166795Z" level=debug msg="Pushing layer: sha256:7f794a66cff20f39dd0e136f3b0cb27ee6a04f3e2c7e10cbede7eebca310e5ba"
Mar 21 07:39:15 hostname dockerd[31421]: time="2017-03-21T07:39:15.611918887Z" level=error msg="Upload failed: denied: requested access to the resource is denied"
Mar 21 07:39:15 hostname dockerd[31421]: time="2017-03-21T07:39:15.612043162Z" level=error msg="Attempting next endpoint for push after error: denied: requested access to the resource is denied"

It seems to fail the first time, but at docker login succeeds and I'm using the same password I use on hub.docker.com

Any ideas?

@AndrewFWolfe
Copy link

I too am hitting exactly the same issue. Can login, but can't push. Have restarted Docker and rebooted.

@vivekkrdubey
Copy link
Author

@AndrewFWolfe
please check if you are trying Docker Push from client machine (in case its different than Docker Host). if yes, then try it once from Docker Host.

@AndrewFWolfe
Copy link

@vivekkrdubey
The Docker host is my PC. I am trying to push an image from my Windows PC (which is running Docker Version 17.03.1-ce-win5 (10743)) to Docker Hub. No Docker env variables have been set. So I think I am doing as you suggest.

@mbhatia
Copy link

mbhatia commented Jun 20, 2017

I was running into the same issue and narrowed it down to Dockerhub repo settings.

Since the free plan on Dockerhub only allows one private repo, my subsequent pushes would create an empty private repo on the hub, but fail to push an actual image (the compressed size of the latest tag would show as 0 B), even though the client said its successful.
I had to log in to the web ui and make the repository public for it to push successfully.

Here are the steps to reproduce the issue (assuming you already have at least 1 private repo on Dockerhub):

$ docker tag hello-world:latest manujbhatia/hello-world:latest

$ docker push manujbhatia/hello-world:latest
The push refers to a repository [docker.io/manujbhatia/hello-world]
5f70bf18a086: Mounted from prom/node-exporter
33e7801ac047: Pushed
latest: digest: sha256:bf49513b06f261953b0df9bf9dfcfd491adfd358a13cfdba0268a4b2b1e7a3c0 size: 730
## No error is reported, but the repository is created as a private repo on Dockerhub and latest tag has a compressed size of 0 bytes.

## The pull fails, as the image is not on the hub
$ docker pull manujbhatia/hello-world:latest
Error response from daemon: repository manujbhatia/hello-world not found: does not exist or no pull access

## Subsequent push fails too
$ docker push manujbhatia/hello-world:latest
The push refers to a repository [docker.io/manujbhatia/hello-world]
5f70bf18a086: Preparing
33e7801ac047: Preparing
denied: requested access to the resource is denied

## Make the repository on Dockerhub public and the push is successful
$ docker push manujbhatia/hello-world:latest
The push refers to a repository [docker.io/manujbhatia/hello-world]
5f70bf18a086: Layer already exists
33e7801ac047: Layer already exists
latest: digest: sha256:bf49513b06f261953b0df9bf9dfcfd491adfd358a13cfdba0268a4b2b1e7a3c0 size: 730

@thaJeztah
Copy link
Member

@mbhatia interesting; could you check your configuration on Docker Hub? There's an option if new repositories should default to "public" or "private"; wondering if that plays a role here;

screen shot 2017-06-20 at 09 27 58

@mbhatia
Copy link

mbhatia commented Jun 20, 2017

@thaJeztah, that was it. My account was setup to default to private.
It worked fine after changing the default to public.

$ docker tag hello-world:latest manujbhatia/hello-world1:latest

$ docker push manujbhatia/hello-world1:latest
The push refers to a repository [docker.io/manujbhatia/hello-world1]
45761469c965: Mounted from library/hello-world
latest: digest: sha256:f3b3b28a45160805bb16542c9531888519430e9e6d6ffc09d72261b0d26ff74f size: 524

$ docker pull manujbhatia/hello-world1:latest
latest: Pulling from manujbhatia/hello-world1
Digest: sha256:f3b3b28a45160805bb16542c9531888519430e9e6d6ffc09d72261b0d26ff74f
Status: Image is up to date for manujbhatia/hello-world1:latest

$ docker push manujbhatia/hello-world1:latest
The push refers to a repository [docker.io/manujbhatia/hello-world1]
45761469c965: Layer already exists
latest: digest: sha256:f3b3b28a45160805bb16542c9531888519430e9e6d6ffc09d72261b0d26ff74f size: 524

@thaJeztah
Copy link
Member

@mbhatia great! that mystery is resolved then.

We still need to look into the original issue; I'm not familiar with the way quota limits are implemented in Docker Hub, so I'd have to try to reach the Docker Hub team to get more information on that; questions I'll have get answered;

  • does Docker Hub return a different error message if push failed due to the quota limit?
  • if not; can it be added?
  • if it already does so; docker most likely needs to be updated to take this error into account and print a better error message
  • why does the initial push succeed? is the quota-check performed after the push (can it be done before the push)?

Thanks so much for your reproduction steps!

@thaJeztah thaJeztah added kind/enhancement Enhancements are not bugs or new features but can improve usability or performance. and removed kind/question status/more-info-needed labels Jun 22, 2017
@wzheng2310
Copy link

wzheng2310 commented Jul 20, 2017

I am having a very similar issue now.

I can push if the image path only contains two components, i.e. something like:
docker push my-user-name/foo:latest
But I can't push if the path contains more component, like:
docker push my-user-name/foo/bar:latest.

It gave the same error: denied: requested access to the resource is denied

In my account settings I have set the default visibility of my repos as public.

$ docker version
Client:
 Version:      17.03.2-ce
 API version:  1.27
 Go version:   go1.7.5
 Git commit:   f5ec1e2
 Built:        Tue Jun 27 03:11:13 2017
 OS/Arch:      linux/amd64

Server:
 Version:      17.03.2-ce
 API version:  1.27 (minimum version 1.12)
 Go version:   go1.7.5
 Git commit:   f5ec1e2
 Built:        Tue Jun 27 03:11:13 2017
 OS/Arch:      linux/amd64
 Experimental: false

I tried:

docker login https://registry-1.docker.io/v2
// enter my user name and password

// If I just do "docker login", I can still login but when I push, I got the same result

then

docker push an image whose path has 3 components.

The docker daemon log I got is:

time="2017-07-20T01:04:39.001001230-07:00" level=debug msg="Calling POST /v1.27/auth" 
time="2017-07-20T01:04:39.001122785-07:00" level=debug msg="form data: {\"password\":\"*****\",\"serveraddress\":\"registry-1.docker.io\",\"username\":\"wzheng2310\"}" 
time="2017-07-20T01:04:39.053417146-07:00" level=debug msg="hostDir: /etc/docker/certs.d/registry-1.docker.io" 
time="2017-07-20T01:04:39.053475049-07:00" level=debug msg="attempting v2 login to registry endpoint https://registry-1.docker.io/v2/" 
time="2017-07-20T01:08:02.730321282-07:00" level=debug msg="Calling GET /_ping" 
time="2017-07-20T01:08:02.731025369-07:00" level=debug msg="Calling GET /v1.27/info" 
time="2017-07-20T01:08:02.769832752-07:00" level=debug msg="Calling POST /v1.27/images/wzheng2310/try-manifest-list/alpine/push?tag=latest" 
time="2017-07-20T01:08:02.770132596-07:00" level=debug msg="Trying to push docker.io/wzheng2310/try-manifest-list/alpine to https://registry-1.docker.io v2" 
time="2017-07-20T01:08:03.124489740-07:00" level=debug msg="Pushing repository: wzheng2310/try-manifest-list/alpine:latest" 
time="2017-07-20T01:08:03.125239942-07:00" level=debug msg="Pushing layer: sha256:5bef08742407efd622d243692b79ba0055383bbce12900324f75e56f589aedb0" 
time="2017-07-20T01:08:03.785097618-07:00" level=error msg="Upload failed: denied: requested access to the resource is denied" 
time="2017-07-20T01:08:03.785190745-07:00" level=error msg="Attempting next endpoint for push after error: denied: requested access to the resource is denied

It kind of look like I can not push V2 images (as a 3 component path image can only be a V2 image).
Really frustrating as there is no useful information/log I can get on my side to debug the problem, and I am completely blocked.

@thaJeztah
Copy link
Member

@wzheng2310 I suspect this is restricted on Docker Hub (possibly for compatibility reasons); even though the specifications allow it.

I agree that a better error message would be nice to have. I asked these questions internally;

  • does Docker Hub return a different error message if push failed due to the quota limit?
  • if not; can it be added?

And, currently Docker Hub does not return a different error message for the "quota" limit. There were no plans to add different errors, but I can try opening a feature request.

With the information discussed in this issue; there's nothing that can be done in this repository, because these changes need to be made on Docker Hub.

I'll close this issue for that reason, but feel free to continue the discussion; I'll update if I receive more information about possible enhancements on Docker Hub

@wzheng2310
Copy link

Sorry I still do not understand the reason. Are you saying this is due to quota problem? Could you be more specific about what kind of quota is limited?

My account only has a few images, which are very small.

Can I delete something to make more room under my current quota?

Or are you saying that pushing image whose name is a 3 path component is not allowed on Docker Hub? If this is the case, will upgrade to paid account solve this problem? Or can I set up a new account so the new account will support this?

My account was created when only V1 image was supported.

Thank you very much!

@thaJeztah
Copy link
Member

@wzheng2310 I summarised the issues being reported here (which are two separate issues);

  • the first issue reported is unable to push my image to Docker Hub #31760 (comment), which was that creating more private repositories than is allowed in the free plan on Docker Hub ("quota"), an " requested access to the resource is denied" error is reported
  • the second issue (your issue), is that Docker Hub currently doesn't support 3 (or more) path components. For this issue I suspect this was done to keep backwards compatible, but possibly there are plans to support this in future (don't have any insight in that though)

@chrisyeung1121
Copy link

I ran into the same problem because I named my images by username/image/name. After changing it to username/image-name it works fine. Hope it helps.

@italojs
Copy link

italojs commented Sep 25, 2017

rename your image to username/image-name
docker tag your-current-image/current-image dockerhub-username/some-name:your-tag(example: latest)

@helloakn
Copy link

first you have to login
docker login -u username -p <password>
second, you have to tag your repository.
docker tag imagename:tag namespace/name
third, push
docker push namespace/name:tag

@denomon
Copy link

denomon commented Nov 10, 2017

@mgsomeone Thank you. After i logged in on terminal i able to push my image

@peterducai
Copy link

had a same problem, fixed by unlinking my Github project... so it's clear where is the issue... :)

@FrankDev-327
Copy link

@mbhatia interesting; could you check your configuration on Docker Hub? There's an option if new repositories should default to "public" or "private"; wondering if that plays a role here;

screen shot 2017-06-20 at 09 27 58

dude, you saved my life!!! thanks a lot!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/distribution kind/enhancement Enhancements are not bugs or new features but can improve usability or performance.
Projects
None yet
Development

No branches or pull requests