Ask Your Question
1

Docker push error "HTTP code 500 while uploading metadata"

asked 2013-12-09 01:53:58 -0500

Nuriel gravatar image

updated 2014-03-07 14:45:56 -0500

smaffulli gravatar image

Hi,

Having problems pushing image to docker registery/glance.

I've installed Openstack via packstack (RDO) and then installed docker-io using yum. (Centos x86_64 6.4) Configured nova.conf as follows:

docker_registry_default_port=5042
compute_driver = docker.DockerDriver

In glance.conf:

container_formats=ami,ari,aki,bare,ovf,docker

I've setup a docker registry container:

# docker ps -a
CONTAINER ID      IMAGE             COMMAND              CREATED           STATUS            PORTS                  NAMES
c5e5aadc6906      98ae78210e1d      ./docker-registry/ru   43 hours ago        Up 39 minutes       0.0.0.0:5042->5000/tcp   goofy_archimede

# lsof -Pni:5042
COMMAND  PID USER   FD   TYPE DEVICE SIZE/OFF NODE NAME
docker  2917 root    7u  IPv6  17622      0t0  TCP *:5042 (LISTEN)

Then I ran:

# docker pull centos
# docker tag centos localhost:5042/centos
# docker push localhost:5042/centos

This results in:

The push refers to a repository [localhost:5042/centos] (len: 1)
Sending image list
Pushing repository localhost:5042/centos (1 tags)
Pushing 539c0211cd76cdeaedbecf9f023ef774612e331137ce7ebe4ae1b61088e7edbe
2013/12/09 08:40:40 HTTP code 500 while uploading metadata: invalid character '<' looking for beginning of value

Any help is appreciated!

edit retag flag offensive close merge delete

Comments

Can you add some more details on how you're pulling and starting the registry container? That HTTP 500 error is coming back from the registry, so we need to figure out how to get at the registry log file.

jeckersb gravatar imagejeckersb ( 2013-12-10 10:23:37 -0500 )edit

Hi, I've upgraded centos 6.4 to 6.5. To get the registry container I've followed this link, and executed the bash script provided: [http://www.sebastien-han.fr/blog/2013/10/31/build-a-paas-zone-within-your-openstack-cloud/](http://www.sebastien-han.fr/blog/2013/10/31/build-a-paas-zone-within-your-openstack-cloud/) It seems to work okay until reaching the docker push $DOCKER_REPOSITORY_NAME, this produces the error I've mentioned HTTP code 500 while uploading metadata: invalid character '<' looking for beginning of value. Would be helpful could someone share details on how to get docker + openstack working (and not via the devstack method). Thanks in advance,

Nuriel gravatar imageNuriel ( 2013-12-12 08:04:37 -0500 )edit

Thanks for the update. I will try to reproduce the error using the registry container you've posted. I've successfully gotten Docker to work on RDO, and I'm in the process of doing a writeup explaining in detail how to do it. Once I finish I'll supply it here as an answer.

jeckersb gravatar imagejeckersb ( 2013-12-12 09:08:06 -0500 )edit

1 answer

Sort by ยป oldest newest most voted
1

answered 2013-12-12 16:02:15 -0500

jeckersb gravatar image

I was able to reproduce this error by setting up the docker registry inside of a container as you described. The docker registry is returning a 500 error on push because it cannot reach the keystone and glance service due to the firewall on the host.

To correct this, I did the following:

  1. Figure out what IP address the openstack firewall rules are using. This should match the IP address you provided in the docker script for the variables OS_AUTH_URL and GLANCE_HOSTPORT. In my simple single-host setup it's just the IP address of eth0, but double check with iptables -n -L nova-api-INPUT and note the destination field.
  2. Append rules to the nova-api-INPUT[1] chain to permit keystone and glance traffic. This will let the docker container use these services: iptables -A nova-api-INPUT -p tcp --dst [your-ip-here] --dport 35357 -j ACCEPT; iptables -A nova-api-INPUT -p tcp --dst [your-ip-here] --dport 9292 -j ACCEPT

After that I was able to successfully run the script and it successfully pushed the image into docker and glance.

[1] There's probably a more appropriate place to stick these, but since I don't intimately understand the openstack networking bits this was the easiest place I saw

edit flag offensive delete link more

Comments

Hi! Thank you for the reply and solution. I didn't expect this because I initially noticed the rules: 0 0 ACCEPT tcp -- * * 172.16.172.1 0.0.0.0/0 multiport dports 9292 /* 001 glance incoming 172.16.172.1 */ and: 0 0 ACCEPT tcp -- * * 172.16.172.1 0.0.0.0/0 multiport dports 5000,35357 /* 001 keystone incoming 172.16.172.1 */ And I am only working on the host 172.16.172.1 using its IP. Anyway, I am glad images can now be imported. And I hit the next error(s): Stderr: "can't add pvnetl45448 to bridge br-int: Operation not supported\n" and when nova (or me) try to delete the instance: TypeError: destroy() got an unexpected keyword argument 'context'., but I guess I should probably open a new question/issue about this. Thanks again,

Nuriel gravatar imageNuriel ( 2013-12-13 03:24:28 -0500 )edit

Hi, I discovered another possible error when trying to push images - if the container needs to resolve an address to an ip and cannot reach the DNS service it will also fail with the 500 error.

Nuriel gravatar imageNuriel ( 2013-12-23 02:14:45 -0500 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Get to know Ask OpenStack

Resources for moderators

Question Tools

3 followers

Stats

Asked: 2013-12-09 01:53:58 -0500

Seen: 2,630 times

Last updated: Mar 07 '14