← Back to team overview

yahoo-eng-team team mailing list archive

[Bug 1475836] [NEW] OpenStack nova-docker driver throws "No command specified" when using a docker image having no CMD directive used in its dockerfile

 

Public bug reported:

1. We are running:
- RHEL 7.1
- OpenStack Kilo 2015-1 based on the Red Hat community edition RDO
- OpenStack nova-docker driver (git tag: origin/stable/kilo)
- Docker 1.6.1 (API version 1.18)

3. Reproduction is done when:
Do follow this HowTO (http://bderzhavets.blogspot.de/2015/05/running-nova-docker-on-openstack-rdo.html) with a little deviation regarding the docker image selection: do take "docker.io/fedora:latest"!

IMPORTANT: This docker image is built using a dockerfile not containing
any "CMD" directive!

Download the image from the docker hub:
docker pull "docker.io/fedora:latest"

Upload it to glance using:
docker save "docker.io/fedora:latest" | glance image-create --name "docker.io/fedora:latest" --is-public true --container-format docker --disk-format raw

Launch this docker image via the OpenStack Horizon dashboard. Please do
not specify any commands in the post creation tab!

Expected result:
Docker image should start although the image misses a CMD directive using an alternative CMD like "bin/bash" or the nova-docker driver should detect this missing directive and prevent its startup. Alternatively, a more speaking error message should occur within the OpenStack "nova-compute.log".

Actual result:
The launch of the image aborts based on the docker API reply saying: "APIError: 500 Server Error: Internal Server Error ("No command specified")"

4. Reproducing shell script / test:
Failing with OpenStack nova-docker driver generated params (missing "Cmd" directive):
Request: curl -X POST -H "Content-Type: application/json" http://localhost:5555/containers/create -d '{"Tty":false,"AttachStderr":true,"NetworkDisabled":true,"Image":"docker.io/fedora:latest","Hostname":"instance-00000036",...}'
Reply: No command specified

Working (with included "Cmd" directive, see end of the test command): 
Request: curl -X POST -H "Content-Type: application/json" http://localhost:5555/containers/create -d '{"Tty":false,"AttachStderr":true,"NetworkDisabled":true,"Image":"docker.io/fedora:latest","Hostname":"instance-00000036",..."Cmd":"/bin/bash"}'
Reply: {"Id":"<docker_generated_container_id>","Warnings":null}

** Affects: nova-docker
     Importance: Undecided
         Status: New


** Tags: docker nova-docker

** Attachment added: "nova-compute.log containg the "No command specified" error"
   https://bugs.launchpad.net/bugs/1475836/+attachment/4430778/+files/nova-compute.log

-- 
You received this bug notification because you are a member of Yahoo!
Engineering Team, which is subscribed to OpenStack Compute (nova).
https://bugs.launchpad.net/bugs/1475836

Title:
  OpenStack nova-docker driver throws "No command specified" when using
  a docker image having no CMD directive used in its dockerfile

Status in nova-docker:
  New

Bug description:
  1. We are running:
  - RHEL 7.1
  - OpenStack Kilo 2015-1 based on the Red Hat community edition RDO
  - OpenStack nova-docker driver (git tag: origin/stable/kilo)
  - Docker 1.6.1 (API version 1.18)

  3. Reproduction is done when:
  Do follow this HowTO (http://bderzhavets.blogspot.de/2015/05/running-nova-docker-on-openstack-rdo.html) with a little deviation regarding the docker image selection: do take "docker.io/fedora:latest"!

  IMPORTANT: This docker image is built using a dockerfile not
  containing any "CMD" directive!

  Download the image from the docker hub:
  docker pull "docker.io/fedora:latest"

  Upload it to glance using:
  docker save "docker.io/fedora:latest" | glance image-create --name "docker.io/fedora:latest" --is-public true --container-format docker --disk-format raw

  Launch this docker image via the OpenStack Horizon dashboard. Please
  do not specify any commands in the post creation tab!

  Expected result:
  Docker image should start although the image misses a CMD directive using an alternative CMD like "bin/bash" or the nova-docker driver should detect this missing directive and prevent its startup. Alternatively, a more speaking error message should occur within the OpenStack "nova-compute.log".

  Actual result:
  The launch of the image aborts based on the docker API reply saying: "APIError: 500 Server Error: Internal Server Error ("No command specified")"

  4. Reproducing shell script / test:
  Failing with OpenStack nova-docker driver generated params (missing "Cmd" directive):
  Request: curl -X POST -H "Content-Type: application/json" http://localhost:5555/containers/create -d '{"Tty":false,"AttachStderr":true,"NetworkDisabled":true,"Image":"docker.io/fedora:latest","Hostname":"instance-00000036",...}'
  Reply: No command specified

  Working (with included "Cmd" directive, see end of the test command): 
  Request: curl -X POST -H "Content-Type: application/json" http://localhost:5555/containers/create -d '{"Tty":false,"AttachStderr":true,"NetworkDisabled":true,"Image":"docker.io/fedora:latest","Hostname":"instance-00000036",..."Cmd":"/bin/bash"}'
  Reply: {"Id":"<docker_generated_container_id>","Warnings":null}

To manage notifications about this bug go to:
https://bugs.launchpad.net/nova-docker/+bug/1475836/+subscriptions


Follow ups