docker-archive / docker-registry

This is **DEPRECATED**! Please go to https://github.com/docker/distribution
Apache License 2.0
2.88k stars 879 forks source link

Unable to push image #904

Closed soupdiver closed 9 years ago

soupdiver commented 9 years ago

I'm running the registry via docker run -i -t -p 127.0.0.1:6000:5000 -e DEBUG=true registry I've got nginx in place with my own CA. The CA is added to the client as well.

docker login https://registry.XXX.com:8888

gives Login Succeeded

docker push registry.XXX.com:8888/foo results in

The push refers to a repository [registry.XXX.com:8888/foo] (len: 1)
Sending image list
Pushing repository registry..com:8888/foo (1 tags)
511136ea3c5a: Pushing [==================================================>] 1.536 kB/1.536 kB

and on the server side

172.17.42.1 - - [20/Jan/2015:23:57:02 +0000] "GET /v1/_ping HTTP/1.0" 200 1547 "-" "Go 1.1 package http"
172.17.42.1 - - [20/Jan/2015:23:57:02 +0000] "GET /v1/_ping HTTP/1.0" 200 1547 "-" "Go 1.1 package http"
20/Jan/2015:23:57:02 +0000 DEBUG: args = {'namespace': 'library', 'repository': u'foo'}
172.17.42.1 - - [20/Jan/2015:23:57:02 +0000] "PUT /v1/repositories/foo/ HTTP/1.0" 200 2 "-" "docker/1.3.3 go/go1.3.3 git-commit/d344625 kernel/3.13.0-36-generic os/linux arch/amd64"
20/Jan/2015:23:57:02 +0000 DEBUG: args = {'image_id': u'511136ea3c5a64f264b78b5433614aec563103b4d4702f3ba7d4d2698e22c158'}
20/Jan/2015:23:57:02 +0000 DEBUG: api_error: Image not found
172.17.42.1 - - [20/Jan/2015:23:57:02 +0000] "GET /v1/images/511136ea3c5a64f264b78b5433614aec563103b4d4702f3ba7d4d2698e22c158/json HTTP/1.0" 404 28 "-" "docker/1.3.3 go/go1.3.3 git-commit/d344625 kernel/3.13.0-36-generic os/linux arch/amd64"
20/Jan/2015:23:57:02 +0000 DEBUG: args = {'image_id': u'511136ea3c5a64f264b78b5433614aec563103b4d4702f3ba7d4d2698e22c158'}
172.17.42.1 - - [20/Jan/2015:23:57:02 +0000] "PUT /v1/images/511136ea3c5a64f264b78b5433614aec563103b4d4702f3ba7d4d2698e22c158/json HTTP/1.0" 200 4 "-" "docker/1.3.3 go/go1.3.3 git-commit/d344625 kernel/3.13.0-36-generic os/linux arch/amd64"

So there is a 404 occuring?

Trying docker push registry.XXX:8888/foo again gives

172.17.42.1 - - [20/Jan/2015:23:57:19 +0000] "GET /v1/_ping HTTP/1.0" 200 1547 "-" "Go 1.1 package http"
172.17.42.1 - - [20/Jan/2015:23:57:19 +0000] "GET /v1/_ping HTTP/1.0" 200 1547 "-" "Go 1.1 package http"
20/Jan/2015:23:57:19 +0000 DEBUG: args = {'namespace': 'library', 'repository': u'foo'}
172.17.42.1 - - [20/Jan/2015:23:57:19 +0000] "PUT /v1/repositories/foo/ HTTP/1.0" 200 2 "-" "docker/1.3.3 go/go1.3.3 git-commit/d344625 kernel/3.13.0-36-generic os/linux arch/amd64"
20/Jan/2015:23:57:19 +0000 DEBUG: args = {'image_id': u'511136ea3c5a64f264b78b5433614aec563103b4d4702f3ba7d4d2698e22c158'}
20/Jan/2015:23:57:19 +0000 DEBUG: api_error: Image is being uploaded, retry later
172.17.42.1 - - [20/Jan/2015:23:57:19 +0000] "GET /v1/images/511136ea3c5a64f264b78b5433614aec563103b4d4702f3ba7d4d2698e22c158/json HTTP/1.0" 400 49 "-" "docker/1.3.3 go/go1.3.3 git-commit/d344625 kernel/3.13.0-36-generic os/linux arch/amd64"
20/Jan/2015:23:57:19 +0000 DEBUG: args = {'image_id': u'511136ea3c5a64f264b78b5433614aec563103b4d4702f3ba7d4d2698e22c158'}
172.17.42.1 - - [20/Jan/2015:23:57:19 +0000] "PUT /v1/images/511136ea3c5a64f264b78b5433614aec563103b4d4702f3ba7d4d2698e22c158/json HTTP/1.0" 200 4 "-" "docker/1.3.3 go/go1.3.3 git-commit/d344625 kernel/3.13.0-36-generic os/linux arch/amd64"

Now it says, the image is being uploaded but nothing is happening. I also tried to push different images and always it only pushes

Pushing [==================================================>] 1.536 kB/1.536 kB

these 1.536 kB

nginx error log shows nothing and the client_max_body_size 2000M; should be big enough.

I basically followed this guide: https://www.digitalocean.com/community/tutorials/how-to-set-up-a-private-docker-registry-on-ubuntu-14-04

When I access /v1/_ping I get

{
  "host": ["Linux", "0da9265cd8c4", "3.5.0-37-generic", "#58~precise1-Ubuntu SMP Wed Jul 10 17:48:11 UTC 2013", "x86_64", "x86_64"],
  "launch": ["/usr/local/bin/gunicorn", "--access-logfile", "-", "--error-logfile", "-", "--max-requests", "100", "-k", "gevent", "--graceful-timeout", "3600", "-t", "3600", "-w", "4", "-b", "0.0.0.0:5000", "--reload", "docker_registry.wsgi:application"],
  "versions": {
    "M2Crypto.m2xmlrpclib": "0.22",
    "SocketServer": "0.4",
    "argparse": "1.1",
    "backports.lzma": "0.0.3",
    "blinker": "1.3",
    "cPickle": "1.71",
    "cgi": "2.6",
    "ctypes": "1.1.0",
    "decimal": "1.70",
    "distutils": "2.7.6",
    "docker_registry.app": "0.9.1",
    "docker_registry.core": "2.0.3",
    "docker_registry.server": "0.9.1",
    "email": "4.0.3",
    "flask": "0.10.1",
    "gevent": "1.0.1",
    "greenlet": "0.4.5",
    "gunicorn": "19.1.1",
    "gunicorn.arbiter": "19.1.1",
    "gunicorn.config": "19.1.1",
    "gunicorn.six": "1.2.0",
    "jinja2": "2.7.3",
    "json": "2.0.9",
    "logging": "0.5.1.2",
    "parser": "0.5",
    "pickle": "$Revision: 72223 $",
    "platform": "1.0.7",
    "pyexpat": "2.7.6",
    "python": "2.7.6 (default, Mar 22 2014, 22:59:56) \n[GCC 4.8.2]",
    "re": "2.2.1",
    "redis": "2.10.3",
    "requests": "2.3.0",
    "requests.packages.chardet": "2.2.1",
    "requests.packages.urllib3": "dev",
    "requests.packages.urllib3.packages.six": "1.2.0",
    "requests.utils": "2.3.0",
    "simplejson": "3.6.2",
    "sqlalchemy": "0.9.4",
    "tarfile": "$Revision: 85213 $",
    "urllib": "1.17",
    "urllib2": "2.7",
    "werkzeug": "0.9.6",
    "xml.parsers.expat": "$Revision: 17640 $",
    "xmlrpclib": "1.0.1",
    "yaml": "3.11",
    "zlib": "1.0"
  }
}

Any ideas what's going wrong here?

dmp42 commented 9 years ago

Hello,

Can you copy the headers of your _ping request?

(eg: curl -i myregistry/v1/_ping)

Also, what version of docker are you running? (docker version and docker info)

dmp42 commented 9 years ago

@shin- ping

soupdiver commented 9 years ago

The first output was taken from the browser. This is the curl one

curl -i https://registry.XXX.com:8888/v1/_ping
HTTP/1.1 200 OK
Server: nginx/1.1.19
Date: Wed, 21 Jan 2015 00:21:14 GMT
Content-Type: application/json
Content-Length: 1547
Connection: keep-alive
X-Docker-Registry-Config: dev
Expires: -1
X-Docker-Registry-Standalone: True
Pragma: no-cache
Cache-Control: no-cache

{"host": ["Linux", "b45034e2067d", "3.5.0-37-generic", "#58~precise1-Ubuntu SMP Wed Jul 10 17:48:11 UTC 2013", "x86_64", "x86_64"], "launch": ["/usr/local/bin/gunicorn", "--access-logfile", "-", "--error-logfile", "-", "--max-requests", "100", "-k", "gevent", "--graceful-timeout", "3600", "-t", "3600", "-w", "4", "-b", "0.0.0.0:5000", "--reload", "docker_registry.wsgi:application"], "versions": {"M2Crypto.m2xmlrpclib": "0.22", "SocketServer": "0.4", "argparse": "1.1", "backports.lzma": "0.0.3", "blinker": "1.3", "cPickle": "1.71", "cgi": "2.6", "ctypes": "1.1.0", "decimal": "1.70", "distutils": "2.7.6", "docker_registry.app": "0.9.1", "docker_registry.core": "2.0.3", "docker_registry.server": "0.9.1", "email": "4.0.3", "flask": "0.10.1", "gevent": "1.0.1", "greenlet": "0.4.5", "gunicorn": "19.1.1", "gunicorn.arbiter": "19.1.1", "gunicorn.config": "19.1.1", "gunicorn.six": "1.2.0", "jinja2": "2.7.3", "json": "2.0.9", "logging": "0.5.1.2", "parser": "0.5", "pickle": "$Revision: 72223 $", "platform": "1.0.7", "pyexpat": "2.7.6", "python": "2.7.6 (default, Mar 22 2014, 22:59:56) \n[GCC 4.8.2]", "re": "2.2.1", "redis": "2.10.3", "requests": "2.3.0", "requests.packages.chardet": "2.2.1", "requests.packages.urllib3": "dev", "requests.packages.urllib3.packages.six": "1.2.0", "requests.utils": "2.3.0", "simplejson": "3.6.2", "sqlalchemy": "0.9.4", "tarfile": "$Revision: 85213 $", "urllib": "1.17", "urllib2": "2.7", "werkzeug": "0.9.6", "xml.parsers.expat": "$Revision: 17640 $", "xmlrpclib": "1.0.1", "yaml": "3.11", "zlib": "1.0"}}

Registry machine:

docker info
Containers: 18
Images: 24
Storage Driver: aufs
 Root Dir: /var/lib/docker/aufs
 Dirs: 60
Execution Driver: native-0.2
Kernel Version: 3.5.0-37-generic
Operating System: Ubuntu precise (12.04.4 LTS)
CPUs: 8
Total Memory: 31.29 GiB
Name: foobar
ID: MD2M:HVXM:4CNZ:OMOG:KR6E:ANQ2:KLQA:KVTT:AIOE:RCLH:P7BS:VNE5
docker version
Client version: 1.4.1
Client API version: 1.16
Go version (client): go1.3.3
Git commit (client): 5bc2ff8
OS/Arch (client): linux/amd64
Server version: 1.4.1
Server API version: 1.16
Go version (server): go1.3.3
Git commit (server): 5bc2ff8

Client machine:

docker info
Containers: 2
Images: 458
Storage Driver: aufs
 Root Dir: /var/lib/docker/aufs
 Dirs: 462
Execution Driver: native-0.2
Kernel Version: 3.13.0-36-generic
Operating System: Ubuntu 14.04.1 LTS
WARNING: No swap limit support
docker version
Client version: 1.3.3
Client API version: 1.15
Go version (client): go1.3.3
Git commit (client): d344625
OS/Arch (client): linux/amd64
Server version: 1.3.3
Server API version: 1.15
Go version (server): go1.3.3
Git commit (server): d344625
noxiouz commented 9 years ago

Looks like #823. And nginx version is the same. What's ur nginx configuration file? Is it proper for version < 1.3.9?

soupdiver commented 9 years ago

Ok thank, upgrading nginx solved the problem. Weird...