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

Error - 405, while pushing the docker images to glance. #468

Open x1b2j opened 10 years ago

x1b2j commented 10 years ago

. I am following the instructions : https://wiki.openstack.org/wiki/Docker .

. When I try to run the command "docker push ip_address:5042/centos", the output is :

The push refers to a repository [ip_address:5042/centos6](len: 1) Sending image list 2014/06/10 15:58:17

. The logs in "/var/log/docker" :

2014/06/10 16:06:57 POST /images/ip_address:5042/centos6/push?tag= [cbd86585] +job push(ip_address:5042/centos6) Error: Status 405 trying to push repository centos6: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">

405 Method Not Allowed

<h 1>Method Not Allowed</h 1>

The method is not allowed for the requested URL.

[cbd86585] -job push(ip_address:5042/centos6) = ERR (1)

. I couldn't find any solution, Please help.

dmp42 commented 10 years ago

Hi there

Can you provide:

Thanks.

x1b2j commented 10 years ago

Hi, Thanks, for your response. Here is the info.

. Version : 0.7.1 (using "yum info", but different in daemon debug logs).

Release : 2.el6

. I am using docker with openstack, here is my (with 3 changes) "/etc/docker-registry.yml" :

  1. standalone: _env:STANDALONE:true
  2. disable_token_auth: _env:DISABLE_TOKEN_AUTH:true
  3. glance: &glance storage: glance

    storage_alternate: _env:GLANCE_STORAGE_ALTERNATE:local

      storage_path: /var/lib/docker-registry

    openstack: <<: *glance

. I am using the standard "service" command to start "docker-registry".

. My docker client version is "Docker version 1.0.0, build 63fe64c/1.0.0".

. you can check the debug mode logs :

https://gist.github.com/x1b2j/ea4f318f436450294230

Thanks.

jwerak commented 10 years ago

Hi, I have similar issue.

I am running latest version of registry using following command:

/usr/bin/docker run --rm --name docker-registry -v /home/core/docker-registry:/registry-conf -v /registry:/registry -e DOCKER_REGISTRY_CONFIG="/registry-conf/config.yml" -e STANDALONE=true -e STORAGE_PATH=/registry -e SETTINGS_FLAVOR=local -e LOGLEVEL=debug -e SEARCH_BACKEND=sqlalchemy -p 5000:5000 registry:0.7.3

The registry is listening properly and answers for example on

http://172.17.8.101:5000/v1/search

Docker client version is 1.0.1 (running coreos beta) I didn't make any changes to config.yml, using local flavor

When I try to push image I get no error on client side

docker push 172.17.8.101:5000/mesos
The push refers to a repository [172.17.8.101:5000/mesos] (len: 1)
Sending image list
2014/07/31 14:48:53 

registry image gives me following error:

172.17.8.101 - - [31/Jul/2014:14:48:53] "GET /v1/_ping HTTP/1.1" 200 4 "-" "Go 1.1 package http"
2014-07-31 14:48:53,454 INFO: 172.17.8.101 - - [31/Jul/2014:14:48:53] "GET /v1/_ping HTTP/1.1" 200 4 "-" "Go 1.1 package http"
172.17.8.101 - - [31/Jul/2014:14:48:53] "PUT /v1/repositories/mesos/ HTTP/1.1" 405 178 "-" "docker/1.0.1 go/go1.2 git-commit/990021a kernel/3.15.2+ os/linux arch/amd64"
2014-07-31 14:48:53,461 INFO: 172.17.8.101 - - [31/Jul/2014:14:48:53] "PUT /v1/repositories/mesos/ HTTP/1.1" 405 178 "-" "docker/1.0.1 go/go1.2 git-commit/990021a kernel/3.15.2+ os/linux arch/amd64"

Docker log gives me:

journalctl -f _SYSTEMD_UNIT=docker.service
Jul 31 14:54:08 core-01 docker[4766]: 2014/07/31 14:54:08 POST /images/172.17.8.101:5000/mesos/push?tag=
Jul 31 14:54:08 core-01 docker[4766]: [180c68fe] +job push(172.17.8.101:5000/mesos)
Jul 31 14:54:10 core-01 docker[4766]: Error: Status 405 trying to push repository mesos: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
Jul 31 14:54:10 core-01 docker[4766]: <title>405 Method Not Allowed</title>
Jul 31 14:54:10 core-01 docker[4766]: <h1>Method Not Allowed</h1>
Jul 31 14:54:10 core-01 docker[4766]: <p>The method is not allowed for the requested URL.</p>
Jul 31 14:54:10 core-01 docker[4766]: [180c68fe] -job push(172.17.8.101:5000/mesos) = ERR (1)

I hope I just have some misconfiguration issue...

Edit

I think this is related/replica of this issue https://github.com/docker/docker-registry/issues/432 Issue is resolved but some claims issue is still there and setting STANDALONE=true won't solve it.

jwerak commented 10 years ago

I've tried to clone latest version from git and build image. This solved my problem.

dmp42 commented 10 years ago

On 0.7.3, the last official release:

Master is fixed, and work as expected as far as STANDALONE is concerned.

So, remove any standalone true statement in your launch command - if you have a custom config file, specify standalone=true in it (like the default configuration does).

Sorry for the inconvenience about this.

dmp42 commented 10 years ago

@veverjak can you detail what you do to run the glance driver using a built registry from git? Thanks.

jwerak commented 10 years ago

No problem @dmp42 I've kept STANDALONE=true just because I was testing behavior with older versions.

This led me to successful push/pull to private registry:

git clone https://github.com/docker/docker-registry.git
cp config/config_sample.yml config.yml 
docker build -t jveverka/registry .
/usr/bin/docker run --rm --name docker-registry -v /home/core/docker-registry:/registry-conf -v /registry:/registry -e DOCKER_REGISTRY_CONFIG="/registry-conf/config.yml" -e STANDALONE=true -e STORAGE_PATH=/registry -e SETTINGS_FLAVOR=local -e LOGLEVEL=debug -e SEARCH_BACKEND=sqlalchemy -p 5000:5000 jveverka/registry

I am about to write systemd unit file for cores so I will attach it here once its tested.

dmp42 commented 10 years ago

@veverjak thanks a lot! so, you are not running the glance driver, are you?

jwerak commented 10 years ago

Nope, I am not. I am probably writing to wrong issue... @dmp42 Do you know how quickly are changes propagated to public docker registry from master?

dmp42 commented 10 years ago

@veverjak

You can also setup an automated build for yourself using the git master.