docker - Error response from daemon: rpc error: code = 2 desc = name conflicts with an existing object
Asked Answered
R

1

6

While creating docker service, i'm facing following error.. Error response from daemon: rpc error: code = 2 desc = name conflicts with an existing object

Steps

docker-machine create --driver virtualbox swarm-1
docker-machine create --driver virtualbox swarm-2
docker-machine create --driver virtualbox swarm-3

eval $(docker-machine env swarm-1)
docker swarm init --advertise-addr $(docker-machine ip swarm-1)

docker-machine ssh swarm-2
docker swarm join <token> and IP

docker-machine ssh swarm-3
docker swarm join <token> and IP

docker node ls
ID                           HOSTNAME  STATUS  AVAILABILITY  MANAGER STATUS
hdip26vwi9xvr131u1rr7yeia    swarm-3   Ready   Active        
v7e56wf0j7fhkarnqsp5c32qo    swarm-2   Ready   Active        
yjv3r4r4ls4qx47jnm0yov06u *  swarm-1   Ready   Active        Leader

docker network create --driver overlay webnet

docker service create --name redisdb --network webnet --replicas 1 redis

Error response from daemon: rpc error: code = 2 desc = name conflicts with an existing object

I tried

docker service create --name redisdb --network webnet --replicas 1 redis:alpine

docker service create --name redisdb --network webnet --replicas 1 redis:alpine

docker service create --name redisdb --network webnet --replicas 1 
rlesouef/alpine-redis

didn't work.. Any suggestion?

adding additional information

docker info
Containers: 0
 Running: 0
 Paused: 0
 Stopped: 0
Images: 0
Server Version: 1.13.1
Storage Driver: aufs
 Root Dir: /mnt/sda1/var/lib/docker/aufs
 Backing Filesystem: extfs
 Dirs: 0
 Dirperm1 Supported: true
Logging Driver: json-file
Cgroup Driver: cgroupfs
Plugins: 
 Volume: local
 Network: bridge host macvlan null overlay
Swarm: active
 NodeID: p5bao7gz89hghllnykw8phaek
 Is Manager: true
 ClusterID: rn5xgfioygwp1b91gfm5znd7v
 Managers: 1
 Nodes: 3
 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
 Node Address: 192.168.99.100
 Manager Addresses:
  192.168.99.100:2377
Runtimes: runc
Default Runtime: runc
Init Binary: docker-init
containerd version: aa8187dbd3b7ad67d8e5e3a15115d3eef43a7ed1
runc version: 9df8b306d01f59d3a8029be411de015b7304dd8f
init version: 949e6fa
Security Options:
 seccomp
  Profile: default
Kernel Version: 4.4.47-boot2docker
Operating System: Boot2Docker 1.13.1 (TCL 7.2); HEAD : b7f6033 - Wed Feb  8 20:31:48 UTC 2017
OSType: linux
Architecture: x86_64
CPUs: 1
Total Memory: 995.8 MiB
Name: swarm-1
ID: JGLZ:XY2M:TTZX:DIT7:QCMX:DCNO:6BR4:IJVM:HOQ7:N3Y6:YGNG:LBD4
Docker Root Dir: /mnt/sda1/var/lib/docker
Debug Mode (client): false
Debug Mode (server): true
 File Descriptors: 41
 Goroutines: 191
 System Time: 2017-02-13T18:28:57.184074564Z
 EventsListeners: 0
Username: pranaysankpal
Registry: https://index.docker.io/v1/
Labels:
 provider=virtualbox
Experimental: false
Insecure Registries:
 127.0.0.0/8
Live Restore Enabled: false

Please suggest.

Ruphina answered 12/2, 2017 at 18:56 Comment(3)
What's the output of docker service ls ?Snooty
hi @johnharris85, output of docker service ls is empty docker service ls ID NAME MODE REPLICAS IMAGERuphina
docker network ls ?Snooty
S
2

I encountered the same issue. Solved it by the following:

1) fetching the list of services by running: sudo docker service ls. you suppose to see the service you're trying to create (redisdb)

2) take the ID shown next to the redisdb service in the list

3) run: sudo docker service rm ID

4) now try to run the create command once again

Hope that helps

Smedley answered 2/6, 2019 at 15:24 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.