Bug #9752
closed
When creating a container, errors from docker are not properly reported to the user
Added by David Davis almost 10 years ago.
Updated over 6 years ago.
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.
When I tried this today, I got back
Could not create the container:
Name has already been taken
is this issue still valid?
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.
- 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
- Bugzilla link set to 1243140
- 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
- Status changed from Ready For Testing to Closed
- % Done changed from 0 to 100
- Pull request https://github.com/theforeman/foreman-docker/pull/168 added
- Target version set to 1.5.2
Also available in: Atom
PDF