0

I started learning docker recently and I set up a virtual machine (VirtualBox) with Lubuntu image:

  • Linux verion: Linux 4.18.0-10-generic i686
  • Docker version: 18.06.1-ce, API-version: 1.38, Go version: go1.10.4, Git commit: e68fc7a

So unless I have started acquaintance with swarm everything was going smoothly. However after I executed docker swarm init daemon seemed going down and whatever command I'm now trying to execute, it responds with: Cannot connect to Docker daemon at..

When I'm trying to run sudo dockerd it shows the output where there're some warnings like failed to load plugin io.containerd.snapshotter.v1.btrfa and one error saying error creating cluster object... error="name conflicts with an existing object" module=node node.id=.... Eventually the output ends with floating point exception with some address in memory.

Restarting does not help. The only things that makes docker run is reverting to the snapshot that I luckily made before calling swarm init.

So I would appreciate your help or advice how I do fix everything out.

2

This response is for Kernel: Linux 4.4.132-1075-rockchip-ayufan-ga83beded8524 Architecture: aarch64 aarch64 aarch64 GNU/Linux

I had the same issue when issuing commands to a cluster in swarm mode.

Running docker info would result in Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?

Running sudo systemctl start docker would result in a failed service state and output reading

Job for docker.service failed because the control process exited with error code.
See "systemctl status docker.service" and "journalctl -xe" for details.

Running systemctl status docker.service would result in

docker.service - Docker Application Container Engine
   Loaded: loaded (/lib/systemd/system/docker.service; enabled; vendor preset: enabled)
   Active: failed (Result: exit-code) since Thu 2019-05-16 06:03:46 UTC; 1min 12s ago
     Docs: https://docs.docker.com
  Process: 3874 ExecStart=/usr/bin/dockerd -H fd:// --containerd=/run/containerd/containerd.sock (cod
 Main PID: 3874 (code=exited, status=2)

Running journalctl -xe wouldn't result in any information related to docker

Running sudo dockerd -D would result in lots of output with a certain line reading error="name conflicts with an existing object" module=node node.id=105rworelt1fvw9ttjhnf61aw

Looking in /var/lib/docker there is a folder called swarm and doing a grep on all files and folders in the swarm directory for the string 105rworelt1fvw9ttjhnf61aw came up with two files with the string 105rworelt1fvw9ttjhnf61aw in them. sudo grep -r "105rworelt1fvw9ttjhnf61aw" /var/lib/docker/swarm/

Those two files were /var/lib/docker/swarm/.tmp-state.json504201306 and /var/lib/docker/swarm/state.json

At this point I wasn't feeling very surgical so I removed all files and folders under the /var/lib/docker/swarm and then tried sudo systemctl start docker again

A bit surgical: sudo rm -ri /var/lib/docker/swarm/

Note: Don't delete the swarm directory. If you do just create it again.

After this a docker info would work and I was able to docker swarm init again and deploy a stack without issues

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.