Project

General

Profile

Actions

Bug #9752

closed

When creating a container, errors from docker are not properly reported to the user

Added by David Davis over 9 years ago. Updated about 6 years ago.

Status:
Closed
Priority:
Normal
Category:
CLI
Target version:
Fixed in Releases:
Found in Releases:

Description

When I create a container with a dupe name, Docker properly responds with a 409 to let me know that it conflicts with another container. However, we're only showing "500 server error".

❯     hammer -u admin -p changeme docker container create --name crafty_turing \
      --repository-name centos --tag latest --compute-resource DockerCP --command bash
Docker container created
❯     hammer -u admin -p changeme docker container create --name crafty_turing \
      --repository-name centos --tag latest --compute-resource DockerCP --command "ping google.com" 
Could not create the container:
  Error: 500 Internal Server Error

We need to show a user friendly error.

Actions #1

Updated by Adam Ruzicka about 9 years ago

When I tried this today, I got back

Could not create the container:
  Name has already been taken

is this issue still valid?

Actions #2

Updated by David Davis about 9 years ago

Adam, yea. I fixed the duplicate name issue by adding a check in the foreman code. You can probably get around this by manually creating the container from the docker CLI. Here are some other possibilities:

  • A container with name length greater than max?
  • A container with invalid options such as an invalid port?
  • Have not enough disk space

Basically the issue here is that Docker is returning an error and we're not logging it or displaying it to the user.

Actions #3

Updated by David Davis about 9 years ago

  • Subject changed from When creating a container from the CLI/API, errors from docker are not properly handled to When creating a container, errors from docker are not properly reported to the user
Actions #4

Updated by Partha Aji almost 9 years ago

  • Bugzilla link set to 1243140
Actions #5

Updated by The Foreman Bot about 8 years ago

  • Status changed from New to Ready For Testing
  • Assignee set to Daniel Lobato Garcia
  • Pull request https://github.com/theforeman/foreman-docker/pull/165 added
Actions #6

Updated by Daniel Lobato Garcia about 8 years ago

  • Status changed from Ready For Testing to Closed
  • % Done changed from 0 to 100
Actions #7

Updated by The Foreman Bot about 8 years ago

  • Pull request https://github.com/theforeman/foreman-docker/pull/168 added
Actions #8

Updated by Daniel Lobato Garcia almost 8 years ago

  • Target version set to 1.5.2
Actions

Also available in: Atom PDF