Skip to content

Docker start <container_name> returns "id already in use" #38346

@doron-cohen

Description

@doron-cohen

Description
docker start redis-server fails on this error message:

Error response from daemon: id already in use
Error: failed to start containers: redis-server

Notice I dont get "HASH is already in use" like in #36145. also the docker version here is 18.06
That container is stopped and not running. We run this command via SSH on an AWS instance which is stopped and started by demand.

Steps to reproduce the issue:
This bug happens occasionally so I didn't succeed reproducing it but the original flow was:

  1. docker run -d -v /redis/redis.conf:/usr/local/etc/redis/redis.conf --restart on-failure:3 --name redis-server --publish 6379:6379 redis:3.0 redis-server /usr/local/etc/redis/redis.conf
  2. stop redis container
  3. stop AWS instance
  4. start AWS instance
  5. docker start redis-server

Describe the results you received:

Error response from daemon: id already in use
Error: failed to start containers: redis-server

Describe the results you expected:
running redis container

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

Output of docker version:

Client:
 Version:           18.06.1-ce
 API version:       1.38
 Go version:        go1.10.3
 Git commit:        e68fc7a
 Built:             Tue Aug 21 17:24:58 2018
 OS/Arch:           linux/amd64
 Experimental:      false

Server:
 Engine:
  Version:          18.06.1-ce
  API version:      1.38 (minimum version 1.12)
  Go version:       go1.10.3
  Git commit:       e68fc7a
  Built:            Tue Aug 21 17:23:24 2018
  OS/Arch:          linux/amd64
  Experimental:     false

Output of docker info:

Containers: 2
 Running: 2
 Paused: 0
 Stopped: 0
Images: 3
Server Version: 18.06.1-ce
Storage Driver: aufs
 Root Dir: /var/lib/docker/aufs
 Backing Filesystem: extfs
 Dirs: 23
 Dirperm1 Supported: false
Logging Driver: json-file
Cgroup Driver: cgroupfs
Plugins:
 Volume: local
 Network: bridge host macvlan null overlay
 Log: awslogs fluentd gcplogs gelf journald json-file logentries splunk syslog
Swarm: inactive
Runtimes: runc
Default Runtime: runc
Init Binary: docker-init
containerd version: 468a545b9edcd5932818eb9de8e72413e616e86e
runc version: 69663f0bd4b60df09991c08812a60108003fa340
init version: fec3683
Security Options:
 apparmor
Kernel Version: 3.13.0-161-generic
Operating System: Ubuntu 14.04.5 LTS
OSType: linux
Architecture: x86_64
CPUs: 1
Total Memory: 992.3MiB
Name: ip-172-31-11-76
ID: DG3V:VWIJ:KQ4X:W7X5:E5WR:RM6A:SQUE:EMG5:TT3K:MCHT:6SRX:PJXF
Docker Root Dir: /var/lib/docker
Debug Mode (client): false
Debug Mode (server): false
Registry: https://index.docker.io/v1/
Labels:
Experimental: false
Insecure Registries:
 127.0.0.0/8
Live Restore Enabled: false

WARNING: No swap limit support

Additional environment details (AWS, VirtualBox, physical, etc.):
Running on a t2.micro instance in AWS

Metadata

Metadata

Assignees

No one assigned

    Labels

    area/daemonCore Enginearea/runtimeRuntimekind/bugBugs are bugs. The cause may or may not be known at triage time so debugging may be needed.version/18.06

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions