Docker CE only running in a new terminal when dockerd is running in another

Issue type:

Docker CE can not be connected to docker daemon

OS Version/build

On Linode cloud(through ssh)

Ubuntu 16.04 LTS

App version

Docker version 18.09.0, build 4d60db4(Docker CE)

Steps to reproduce

a)Followed the steps on this link: Get Docker | Docker Docs

b)Tested docker by running sudo docker run hello-world

Hi Champs,

I am new to the docker and I tried to install docker ce through the link Get Docker | Docker Docs
It got it installed but when I tried to test the docker by running the hello-world command as mentioned,it gives me the following error:

docker: Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?.
See ‘docker run --help’.

However,when I open another terminal and run dockerd command manually and try from yet another terminal,it works(until I have the other terminal in which I run the dockerd command is open.

The output of dockerd command shows the following output and precisely some errors:

root@cklt:~# dockerd
INFO[2018-11-16T08:32:14.243539419+05:30] libcontainerd: started new containerd process pid=12392
INFO[2018-11-16T08:32:14.244118475+05:30] parsed scheme: “unix” module=grpc
INFO[2018-11-16T08:32:14.244213803+05:30] scheme “unix” not registered, fallback to default scheme module=grpc
INFO[2018-11-16T08:32:14.244353633+05:30] ccResolverWrapper: sending new addresses to cc: [{unix:///var/run/docker/containerd/containerd.sock 0 }] module=grpc
INFO[2018-11-16T08:32:14.244503273+05:30] ClientConn switching balancer to “pick_first” module=grpc
INFO[2018-11-16T08:32:14.244714881+05:30] pickfirstBalancer: HandleSubConnStateChange: 0xc42063e6f0, CONNECTING module=grpc
INFO[2018-11-16T08:32:14.754522217+05:30] starting containerd revision=c4446665cb9c30056f4998ed953e6d4ff22c7c39 version=1.2.0
INFO[2018-11-16T08:32:14.755898043+05:30] loading plugin “io.containerd.content.v1.content”… type=io.containerd.content.v1
INFO[2018-11-16T08:32:14.756744541+05:30] loading plugin “io.containerd.snapshotter.v1.btrfs”… type=io.containerd.snapshotter.v1
WARN[2018-11-16T08:32:14.757453881+05:30] failed to load plugin io.containerd.snapshotter.v1.btrfs error=“path /var/lib/docker/containerd/daemon/io.containerd.snapshotter.v1.btrfs must be a btrfs filesystem to be used with the btrfs snapshotter”
INFO[2018-11-16T08:32:14.757669508+05:30] loading plugin “io.containerd.snapshotter.v1.aufs”… type=io.containerd.snapshotter.v1
WARN[2018-11-16T08:32:14.800418691+05:30] failed to load plugin io.containerd.snapshotter.v1.aufs error=“modprobe aufs failed: “modprobe: ERROR: …/libkmod/libkmod.c:586 kmod_search_moddep() could not open moddep file ‘/lib/modules/4.18.16-x86_64-linode118/modules.dep.bin’\nmodprobe: FATAL: Module aufs not found in directory /lib/modules/4.18.16-x86_64-linode118\n”: exit status 1”
INFO[2018-11-16T08:32:14.800744767+05:30] loading plugin “io.containerd.snapshotter.v1.native”… type=io.containerd.snapshotter.v1
INFO[2018-11-16T08:32:14.800919276+05:30] loading plugin “io.containerd.snapshotter.v1.overlayfs”… type=io.containerd.snapshotter.v1
INFO[2018-11-16T08:32:14.801200928+05:30] loading plugin “io.containerd.snapshotter.v1.zfs”… type=io.containerd.snapshotter.v1
WARN[2018-11-16T08:32:14.801755213+05:30] failed to load plugin io.containerd.snapshotter.v1.zfs error=“path /var/lib/docker/containerd/daemon/io.containerd.snapshotter.v1.zfs must be a zfs filesystem to be used with the zfs snapshotter”
INFO[2018-11-16T08:32:14.801922602+05:30] loading plugin “io.containerd.metadata.v1.bolt”… type=io.containerd.metadata.v1
WARN[2018-11-16T08:32:14.802050401+05:30] could not use snapshotter btrfs in metadata plugin error=“path /var/lib/docker/containerd/daemon/io.containerd.snapshotter.v1.btrfs must be a btrfs filesystem to be used with the btrfs snapshotter”
WARN[2018-11-16T08:32:14.802136619+05:30] could not use snapshotter aufs in metadata plugin error=“modprobe aufs failed: “modprobe: ERROR: …/libkmod/libkmod.c:586 kmod_search_moddep() could not open moddep file ‘/lib/modules/4.18.16-x86_64-linode118/modules.dep.bin’\nmodprobe: FATAL: Module aufs not found in directory /lib/modules/4.18.16-x86_64-linode118\n”: exit status 1”
WARN[2018-11-16T08:32:14.802281210+05:30] could not use snapshotter zfs in metadata plugin error=“path /var/lib/docker/containerd/daemon/io.containerd.snapshotter.v1.zfs must be a zfs filesystem to be used with the zfs snapshotter”
INFO[2018-11-16T08:32:14.802813450+05:30] loading plugin “io.containerd.differ.v1.walking”… type=io.containerd.differ.v1
INFO[2018-11-16T08:32:14.802999457+05:30] loading plugin “io.containerd.gc.v1.scheduler”… type=io.containerd.gc.v1
INFO[2018-11-16T08:32:14.803199103+05:30] loading plugin “io.containerd.service.v1.containers-service”… type=io.containerd.service.v1
INFO[2018-11-16T08:32:14.803346011+05:30] loading plugin “io.containerd.service.v1.content-service”… type=io.containerd.service.v1
INFO[2018-11-16T08:32:14.803504374+05:30] loading plugin “io.containerd.service.v1.diff-service”… type=io.containerd.service.v1
INFO[2018-11-16T08:32:14.803701771+05:30] loading plugin “io.containerd.service.v1.images-service”… type=io.containerd.service.v1
INFO[2018-11-16T08:32:14.804070226+05:30] loading plugin “io.containerd.service.v1.leases-service”… type=io.containerd.service.v1
INFO[2018-11-16T08:32:14.804263629+05:30] loading plugin “io.containerd.service.v1.namespaces-service”… type=io.containerd.service.v1
INFO[2018-11-16T08:32:14.804471762+05:30] loading plugin “io.containerd.service.v1.snapshots-service”… type=io.containerd.service.v1
INFO[2018-11-16T08:32:14.804669381+05:30] loading plugin “io.containerd.runtime.v1.linux”… type=io.containerd.runtime.v1
INFO[2018-11-16T08:32:14.805185812+05:30] loading plugin “io.containerd.runtime.v2.task”… type=io.containerd.runtime.v2
INFO[2018-11-16T08:32:14.805506119+05:30] loading plugin “io.containerd.monitor.v1.cgroups”… type=io.containerd.monitor.v1
INFO[2018-11-16T08:32:14.810071762+05:30] loading plugin “io.containerd.service.v1.tasks-service”… type=io.containerd.service.v1
INFO[2018-11-16T08:32:14.810311594+05:30] loading plugin “io.containerd.internal.v1.restart”… type=io.containerd.internal.v1
INFO[2018-11-16T08:32:14.810912859+05:30] loading plugin “io.containerd.grpc.v1.containers”… type=io.containerd.grpc.v1
INFO[2018-11-16T08:32:14.811062604+05:30] loading plugin “io.containerd.grpc.v1.content”… type=io.containerd.grpc.v1
INFO[2018-11-16T08:32:14.811215618+05:30] loading plugin “io.containerd.grpc.v1.diff”… type=io.containerd.grpc.v1
INFO[2018-11-16T08:32:14.811346043+05:30] loading plugin “io.containerd.grpc.v1.events”… type=io.containerd.grpc.v1
INFO[2018-11-16T08:32:14.811471416+05:30] loading plugin “io.containerd.grpc.v1.healthcheck”… type=io.containerd.grpc.v1
INFO[2018-11-16T08:32:14.811602295+05:30] loading plugin “io.containerd.grpc.v1.images”… type=io.containerd.grpc.v1
INFO[2018-11-16T08:32:14.812006494+05:30] loading plugin “io.containerd.grpc.v1.leases”… type=io.containerd.grpc.v1
INFO[2018-11-16T08:32:14.812135306+05:30] loading plugin “io.containerd.grpc.v1.namespaces”… type=io.containerd.grpc.v1
INFO[2018-11-16T08:32:14.812447730+05:30] loading plugin “io.containerd.internal.v1.opt”… type=io.containerd.internal.v1
INFO[2018-11-16T08:32:14.812877095+05:30] loading plugin “io.containerd.grpc.v1.snapshots”… type=io.containerd.grpc.v1
INFO[2018-11-16T08:32:14.813057984+05:30] loading plugin “io.containerd.grpc.v1.tasks”… type=io.containerd.grpc.v1
INFO[2018-11-16T08:32:14.813210261+05:30] loading plugin “io.containerd.grpc.v1.version”… type=io.containerd.grpc.v1
INFO[2018-11-16T08:32:14.813351075+05:30] loading plugin “io.containerd.grpc.v1.introspection”… type=io.containerd.grpc.v1
INFO[2018-11-16T08:32:14.817104801+05:30] serving… address=“/var/run/docker/containerd/containerd-debug.sock”
INFO[2018-11-16T08:32:14.817449866+05:30] serving… address=“/var/run/docker/containerd/containerd.sock”
INFO[2018-11-16T08:32:14.817613914+05:30] containerd successfully booted in 0.065072s
INFO[2018-11-16T08:32:14.819615556+05:30] pickfirstBalancer: HandleSubConnStateChange: 0xc42063e6f0, READY module=grpc
INFO[2018-11-16T08:32:14.856503972+05:30] parsed scheme: “unix” module=grpc
INFO[2018-11-16T08:32:14.856952741+05:30] scheme “unix” not registered, fallback to default scheme module=grpc
INFO[2018-11-16T08:32:14.857273638+05:30] parsed scheme: “unix” module=grpc
INFO[2018-11-16T08:32:14.857419070+05:30] scheme “unix” not registered, fallback to default scheme module=grpc
INFO[2018-11-16T08:32:14.859129551+05:30] ccResolverWrapper: sending new addresses to cc: [{unix:///var/run/docker/containerd/containerd.sock 0 }] module=grpc
INFO[2018-11-16T08:32:14.859301650+05:30] ClientConn switching balancer to “pick_first” module=grpc
INFO[2018-11-16T08:32:14.859455293+05:30] pickfirstBalancer: HandleSubConnStateChange: 0xc42063fd60, CONNECTING module=grpc
INFO[2018-11-16T08:32:14.859998787+05:30] pickfirstBalancer: HandleSubConnStateChange: 0xc42063fd60, READY module=grpc
INFO[2018-11-16T08:32:14.860184597+05:30] ccResolverWrapper: sending new addresses to cc: [{unix:///var/run/docker/containerd/containerd.sock 0 }] module=grpc
INFO[2018-11-16T08:32:14.860512604+05:30] ClientConn switching balancer to “pick_first” module=grpc
INFO[2018-11-16T08:32:14.860758695+05:30] pickfirstBalancer: HandleSubConnStateChange: 0xc42061c000, CONNECTING module=grpc
INFO[2018-11-16T08:32:14.861616366+05:30] pickfirstBalancer: HandleSubConnStateChange: 0xc42061c000, READY module=grpc
INFO[2018-11-16T08:32:14.864675412+05:30] [graphdriver] using prior storage driver: overlay2
INFO[2018-11-16T08:32:14.886668061+05:30] Graph migration to content-addressability took 0.00 seconds
WARN[2018-11-16T08:32:14.887654837+05:30] Your kernel does not support cgroup rt period
WARN[2018-11-16T08:32:14.887807072+05:30] Your kernel does not support cgroup rt runtime
INFO[2018-11-16T08:32:14.889228988+05:30] Loading containers: start.
WARN[2018-11-16T08:32:14.936605793+05:30] Running modprobe nf_nat failed with message: modprobe: ERROR: ../libkmod/libkmod.c:586 kmod_search_moddep() could not open moddep file '/lib/modules/4.18.16-x86_64-linode118/modules.dep.bin' modprobe: WARNING: Module nf_nat not found in directory /lib/modules/4.18.16-x86_64-linode118, error: exit status 1
WARN[2018-11-16T08:32:14.938965555+05:30] Running modprobe xt_conntrack failed with message: modprobe: ERROR: ../libkmod/libkmod.c:586 kmod_search_moddep() could not open moddep file '/lib/modules/4.18.16-x86_64-linode118/modules.dep.bin' modprobe: WARNING: Module xt_conntrack not found in directory /lib/modules/4.18.16-x86_64-linode118, error: exit status 1
INFO[2018-11-16T08:32:15.090310293+05:30] Default bridge (docker0) is assigned with an IP address 172.17.0.0/16. Daemon option --bip can be used to set a preferred IP address
INFO[2018-11-16T08:32:15.154051055+05:30] Loading containers: done.
WARN[2018-11-16T08:32:15.222393127+05:30] Not using native diff for overlay2, this may cause degraded performance for building images: kernel has CONFIG_OVERLAY_FS_REDIRECT_DIR enabled storage-driver=overlay2
INFO[2018-11-16T08:32:15.223439430+05:30] Docker daemon commit=4d60db4 graphdriver(s)=overlay2 version=18.09.0
INFO[2018-11-16T08:32:15.224343414+05:30] Daemon has completed initialization
INFO[2018-11-16T08:32:15.263447817+05:30] API listen on /var/run/docker.sock
INFO[2018-11-16T08:33:16.449439365+05:30] shim containerd-shim started address=“/containerd-shim/moby/9ce2b7a0cdd931ec1804997257b931e15700eccbc581a488522e2a7efcc1230e/shim.sock” debug=false pid=12603
INFO[2018-11-16T08:33:17.188271792+05:30] shim reaped id=9ce2b7a0cdd931ec1804997257b931e15700eccbc581a488522e2a7efcc1230e
INFO[2018-11-16T08:33:17.199870371+05:30] ignoring event module=libcontainerd namespace=moby topic=/tasks/delete type=“*events.TaskDelete”

How can I fix the issue,what am I missing because of which the docker is not running by default.

Thankyou,
Vivek

PS:The same steps followed on my local machine Ubuntu 16.04 lts runs succesfully.

Hi Guys,

Any insight?If I have posted it in a wrong category,kindly help me.

Thankyou :slight_smile: