Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create container with duplicated name returns 400 instead of 409 #35021

Closed
cezarsa opened this issue Sep 28, 2017 · 2 comments · Fixed by #35022
Closed

Create container with duplicated name returns 400 instead of 409 #35021

cezarsa opened this issue Sep 28, 2017 · 2 comments · Fixed by #35022

Comments

@cezarsa
Copy link
Contributor

cezarsa commented Sep 28, 2017

Description
Creating containers with duplicated name used to return a 409 HTTP response, however, since 17.09 release it now returns a 400 response breaking compatibility for API users.

Steps to reproduce the issue:

  1. Create a container docker create --name c1 busybox
  2. Run curl -v -XPOST -H"Content-Type: application/json" -d'{"Image":"busybox"}' http://localhost:2375/containers/create?name=c1

Describe the results you received:

The HTTP response will be 400 Bad Request.

Describe the results you expected:

Prior to 17.09 the response would be 409 Conflict

Additional information you deem important (e.g. issue happens only occasionally):

Output of docker version:

Client:
 Version:      17.09.0-ce
 API version:  1.32
 Go version:   go1.8.3
 Git commit:   afdb6d4
 Built:        Tue Sep 26 22:42:18 2017
 OS/Arch:      linux/amd64

Server:
 Version:      17.09.0-ce
 API version:  1.32 (minimum version 1.12)
 Go version:   go1.8.3
 Git commit:   afdb6d4
 Built:        Tue Sep 26 22:40:56 2017
 OS/Arch:      linux/amd64
 Experimental: false

Output of docker info:

Containers: 7
 Running: 6
 Paused: 0
 Stopped: 1
Images: 18
Server Version: 17.09.0-ce
Storage Driver: aufs
 Root Dir: /var/lib/docker/aufs
 Backing Filesystem: extfs
 Dirs: 55
 Dirperm1 Supported: true
Logging Driver: syslog
Cgroup Driver: cgroupfs
Plugins:
 Volume: local
 Network: bridge host macvlan null overlay
 Log: awslogs fluentd gcplogs gelf journald json-file logentries splunk syslog
Swarm: active
 NodeID: ug3ojsrrreyxeq63nbwyikv3f
 Is Manager: true
 ClusterID: n2efj7ylwed1onrdxy0sp4dp1
 Managers: 1
 Nodes: 1
 Orchestration:
  Task History Retention Limit: 5
 Raft:
  Snapshot Interval: 10000
  Number of Old Snapshots to Retain: 0
  Heartbeat Tick: 1
  Election Tick: 3
 Dispatcher:
  Heartbeat Period: 5 seconds
 CA Configuration:
  Expiry Duration: 3 months
  Force Rotate: 0
 Autolock Managers: false
 Root Rotation In Progress: false
 Node Address: 192.168.50.4
 Manager Addresses:
  192.168.50.4:2377
Runtimes: runc
Default Runtime: runc
Init Binary: docker-init
containerd version: 06b9cb35161009dcb7123345749fef02f7cea8e0
runc version: 3f2f8b84a77f73d38244dd690525642a72156c64
init version: 949e6fa
Security Options:
 apparmor
 seccomp
  Profile: default
Kernel Version: 4.4.0-31-generic
Operating System: Ubuntu 16.04.2 LTS
OSType: linux
Architecture: x86_64
CPUs: 1
Total Memory: 2.915GiB
Name: vagrant
ID: QCSK:UDNT:AMC2:P6TV:M4LV:UZQE:7Z2W:TEHN:VJ75:YQTG:QIBD:TYJC
Docker Root Dir: /var/lib/docker
Debug Mode (client): false
Debug Mode (server): true
 File Descriptors: 85
 Goroutines: 180
 System Time: 2017-09-28T14:10:12.894604072Z
 EventsListeners: 1
Username: cezarsa
Registry: https://index.docker.io/v1/
Experimental: false
Insecure Registries:
 127.0.0.1:5000
Live Restore Enabled: false

Additional environment details (AWS, VirtualBox, physical, etc.):

Virtualbox

@thaJeztah
Copy link
Member

Looks to be introduced in docker-archive/docker-ce@30f1b65#diff-27c72b124060b3fc44b4c73d7023fca7R72 (#34188), not sure if this was a deliberate change; Let me open a PR for discussion

@thaJeztah
Copy link
Member

Opened #35022

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants