Bug 1309739 - docker push fails when pushing image to docker hub
docker push fails when pushing image to docker hub
Status: CLOSED ERRATA
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: docker (Show other bugs)
7.2
Unspecified Unspecified
unspecified Severity low
: rc
: ---
Assigned To: Daniel Walsh
atomic-bugs@redhat.com
: Extras
: 1300808 (view as bug list)
Depends On:
Blocks: 1298318
  Show dependency treegraph
 
Reported: 2016-02-18 10:12 EST by Avesh Agarwal
Modified: 2016-05-12 11:17 EDT (History)
7 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2016-05-12 11:17:15 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)


External Trackers
Tracker ID Priority Status Summary Last Updated
Red Hat Product Errata RHSA-2016:1034 normal SHIPPED_LIVE Moderate: docker security, bug fix, and enhancement update 2016-05-12 15:15:01 EDT

  None (edit)
Description Avesh Agarwal 2016-02-18 10:12:53 EST
Description of problem:

docker logging fails when pushing image to docker hub:

[root@openshift-112 ~]# docker push docker.io/deshuai/hello-openshift:v1

Do you really want to push to public registry? [y/n]: y
The push refers to a repository [docker.io/deshuai/hello-openshift] (len: 1)
f7591c834e4d: Image already exists 
0a9b9b6b06fb: Preparing 
unauthorized: access to the requested resource is not authorized

2. Some error log in docker demon
 msg="Handler for POST /v1.21/images/docker.io/deshuai/hello-openshift/push returned error: Error: Status 403 trying to push repository docker.io/deshuai/hello-openshift to official registry: needs to be forced"
 msg="HTTP Error" err="Error: Status 403 trying to push repository docker.io/deshuai/hello-openshift to official registry: needs to be forced" statusCode=403


Version-Release number of selected component (if applicable):
docker-1.9.1-16.el7.x86_64

How reproducible:
always

Steps to Reproduce:
http://fpaste.org/324435/62955145/

Actual results:
Pushing image to docker hub fails

Expected results:
Pushing image to docker hub works.

Additional info:
Changing docker.io to https://index.docker.io/v1/ in config.json solve the problem.
Comment 1 Antonio Murdaca 2016-02-18 10:16:54 EST
Avesh, can you 'cat' $HOME/.docker/config.json? (be aware, hide the auth token pls)
Comment 2 Avesh Agarwal 2016-02-18 10:20:12 EST
{
"auths": {
"docker.io": {
"auth": ..,
"email": "dma@redhat.com"
}
}
}

And changing docker.io to  https://index.docker.io/v1/ solved the problem
Comment 4 Antonio Murdaca 2016-02-18 10:28:28 EST
Alright, thanks Avesh, this is definitely fixed in docker-1.10.x
An attempt was made to backport the fix to 1.9.x (https://github.com/runcom/docker/commit/c561d441a8a268a87be15ea19829b0dff56da35d) but it didn't make into the code base (even if it's shown merged)
Comment 7 Michal Minar 2016-02-29 07:42:15 EST
*** Bug 1300808 has been marked as a duplicate of this bug. ***
Comment 8 Dusty Mabe 2016-04-11 13:10:49 EDT
The docker version in latest RHEL/centos has this problem still.

docker-1.9.1-25.el7.centos.x86_64
docker-1.9.1-25.el7.x86_64

```
[root@cloudhost ~]# docker push docker.io/dustymabe/bb

Do you really want to push to public registry? [y/n]: y
The push refers to a repository [docker.io/dustymabe/bb] (len: 1)
307ac631f1b5: Image push failed 
unauthorized: access to the requested resource is not authorized
```
Comment 10 Antonio Murdaca 2016-04-22 03:56:21 EDT
we merged https://github.com/projectatomic/docker/pull/130 which fixes this bug. Will rebuild docker 1.9 for rhel.
Comment 11 Luwen Su 2016-04-28 03:43:03 EDT
In docker-1.9.1-38.el7.x86_64, 

# docker login
Username: timesu
Password: 
Email: 
WARNING: login credentials saved in /root/.docker/config.json
Login Succeeded

# docker push docker.io/timesu/busybox
Do you really want to push to public registry? [y/n]: y
The push refers to a repository [docker.io/timesu/busybox] (len: 1)
307ac631f1b5: Pushed 
4b51ded9aed1: Pushed 
latest: digest: sha256:293ee253bd4949e2ef7e4437337543cc8132dd9abc2f4899df01b96508f87236 size: 2738


Move to verified
Comment 13 errata-xmlrpc 2016-05-12 11:17:15 EDT
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://rhn.redhat.com/errata/RHSA-2016-1034.html

Note You need to log in before you can comment on or make changes to this bug.