Cannot connect to the Docker daemon after failed pull - docker

When I try to pull a certain docker image, my pull fails, and then prevents me from connecting to the docker deamon again until I reboot my laptop. The Image in question is an official Jupyter images which works fine on my other machine. Restarting the Deamon does not help, but rebooting my laptop does.
I tried to docker system prune -a already, that's why there are no images on my laptop anymore. Does somebody have an idea how to fix this problem?
I think the problem might be connected to one of the images not finishing it's extraction.
EDIT
I have the same problem with a alpine image. see below
me#mylaptop $ docker images
REPOSITORY TAG IMAGE ID CREATED SIZE
me#mylaptop $ docker pull jupyter/datascience-notebook
Using default tag: latest
latest: Pulling from jupyter/datascience-notebook
e6ca3592b144: Extracting [==================================================>] 28.56MB/28.56MB
534a5505201d: Download complete
990916bd23bb: Download complete
979cd14ae800: Download complete
5e8b9f8fa9e0: Download complete
6f224ed88dc4: Download complete
6ee9ec4a62a8: Download complete
7a1ae22ba760: Download complete
a1602338a8d7: Download complete
fce5135a7ea1: Download complete
e62a1c9017ef: Download complete
a5049ad1c512: Download complete
ec06c1612b0a: Download complete
acceda87b341: Download complete
939052532b6f: Download complete
d2dee4cc07fe: Download complete
4fe5e9dd4fad: Download complete
8fd08517e0c6: Download complete
7105a3ca8c38: Download complete
66c0798f609e: Download complete
94f3fc35ed38: Download complete
aa68263474a3: Download complete
6e7d1433394b: Download complete
f5902e69d9b7: Download complete
490bb991b4de: Download complete
fab6e92b04fa: Download complete
failed to register layer: Error processing tar file(exit status 1): Error cleaning up after pivot: remove /.pivot_root297865553: device or resource busy
me#mylaptop $ docker images
Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?
me#mylaptop $ sudo systemctl start docker
me#mylaptop $ systemctl status docker
● docker.service - Docker Application Container Engine
Loaded: loaded (/usr/lib/systemd/system/docker.service; enabled; vendor preset: disabled)
Active: active (running) since Wed 2020-09-30 08:11:12 CEST; 15min ago
TriggeredBy: ● docker.socket
Docs: https://docs.docker.com
Main PID: 908 (dockerd)
Tasks: 10
Memory: 140.8M
CGroup: /system.slice/docker.service
└─908 /usr/bin/dockerd -H fd:// --containerd=/run/containerd/containerd.sock
sep 30 08:11:11 mylaptop dockerd[908]: time="2020-09-30T08:11:11.992016198+02:00" level=warning msg="Your kernel does not support cgroup rt runtime"
sep 30 08:11:11 mylaptop dockerd[908]: time="2020-09-30T08:11:11.992433459+02:00" level=info msg="Loading containers: start."
sep 30 08:11:12 mylaptop dockerd[908]: time="2020-09-30T08:11:12.227615723+02:00" level=info msg="Default bridge (docker0) is assigned with an IP address 172.17.0.0/16. Daemon option --bip can b>
sep 30 08:11:12 mylaptop dockerd[908]: time="2020-09-30T08:11:12.296603004+02:00" level=info msg="Loading containers: done."
sep 30 08:11:12 mylaptop dockerd[908]: time="2020-09-30T08:11:12.486944893+02:00" level=warning msg="Not using native diff for overlay2, this may cause degraded performance for building images: >
sep 30 08:11:12 mylaptop dockerd[908]: time="2020-09-30T08:11:12.487273874+02:00" level=info msg="Docker daemon" commit=48a66213fe graphdriver(s)=overlay2 version=19.03.12-ce
sep 30 08:11:12 mylaptop dockerd[908]: time="2020-09-30T08:11:12.491959213+02:00" level=info msg="Daemon has completed initialization"
sep 30 08:11:12 mylaptop dockerd[908]: time="2020-09-30T08:11:12.530816090+02:00" level=info msg="API listen on /run/docker.sock"
sep 30 08:11:12 mylaptop systemd[1]: Started Docker Application Container Engine.
sep 30 08:23:36 mylaptop dockerd[908]: time="2020-09-30T08:23:36.941202710+02:00" level=info msg="Attempting next endpoint for pull after error: failed to register layer: Error processing tar fi>
me#mylaptop $ docker images
Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?
me#mylaptop $ docker pull alpine:3.12.0
3.12.0: Pulling from library/alpine
df20fa9351a1: Extracting [==================================================>] 2.798MB/2.798MB
failed to register layer: Error processing tar file(exit status 1): Error cleaning up after pivot: remove /.pivot_root517304538: device or resource busy

Solved it. The problem is that my kernel was/became to old.
The warning below by systemctl brought made me find this post on forums.docker.com
me#mylaptop $ systemctl status docker
...
sep 30 08:11:11 mylaptop dockerd[908]: time="2020-09-30T08:11:11.992016198+02:00" level=warning msg="Your kernel does not support cgroup rt runtime"
...
I'm running Manjaro so I upgrade my kernel with this command:
sudo mhwd-kernel -i linux54
After which docker worked again.

Related

Run Docker on Raspberry Pi4 with overlay fs

I prefer to create a situation where on a Raspberry Pi4 Docker is running while the SD-card is read only. This with overlay fs.
In the dockercontainer a database is running, the data of the database is written to an USB-stick (volume mapping).
When overlayfs is activated (after reboot, enabled via “sudo raspi-config”), docker will not start-up any more.
The steps on https://docs.docker.com/storage/storagedriver/overlayfs-driver/
System information:
Linux raspberrypi 5.10.63-v8+ #1488 SMP PREEMPT Thu Nov 18 16:16:16 GMT 2021 aarch64 GNU/Linux
Docker information:
pi#raspberrypi:~ $ docker info
Client:
Context: default
Debug Mode: false
Plugins:
app: Docker App (Docker Inc., v0.9.1-beta3)
buildx: Build with BuildKit (Docker Inc., v0.6.3-docker)
Server:
Containers: 1
Running: 1
Paused: 0
Stopped: 0
Images: 1
Server Version: 20.10.11
Storage Driver: overlay2
Backing Filesystem: extfs
Supports d_type: true
Native Overlay Diff: true
userxattr: false
………
Status docker after restart:
pi#raspberrypi:~ $ sudo systemctl status docker.*
Warning: The unit file, source configuration file or drop-ins of docker.service changed on disk. Run 'systemctl daemon-reload' to reload units.
● docker.socket - Docker Socket for the API
Loaded: loaded (/lib/systemd/system/docker.socket; enabled; vendor preset: enabled)
Active: failed (Result: service-start-limit-hit) since Thu 2021-12-09 14:30:43 GMT; 1h 13min ago
Triggers: ● docker.service
Listen: /run/docker.sock (Stream)
CPU: 2ms
Dec 09 14:30:36 raspberrypi systemd[1]: Starting Docker Socket for the API.
Dec 09 14:30:36 raspberrypi systemd[1]: Listening on Docker Socket for the API.
Dec 09 14:30:43 raspberrypi systemd[1]: docker.socket: Failed with result 'service-start-limit-hit'
● docker.service - Docker Application Container Engine
Loaded: loaded (/lib/systemd/system/docker.service; enabled; vendor preset: enabled)
Active: failed (Result: exit-code) since Thu 2021-12-09 14:30:43 GMT; 1h 13min ago
TriggeredBy: ● docker.socket
Docs: https://docs.docker.com
Main PID: 992 (code=exited, status=1/FAILURE)
CPU: 162ms
Dec 09 14:30:43 raspberrypi systemd[1]: docker.service: Scheduled restart job, restart counter is at 3.
Dec 09 14:30:43 raspberrypi systemd[1]: Stopped Docker Application Container Engine.
Dec 09 14:30:43 raspberrypi systemd[1]: docker.service: Start request repeated too quickly.
Dec 09 14:30:43 raspberrypi systemd[1]: docker.service: Failed with result 'exit-code'.
Dec 09 14:30:43 raspberrypi systemd[1]: Failed to start Docker Application Container Engine.
Running the command given in docker.service with additional overlay flag
pi#raspberrypi:~ $ sudo /usr/bin/dockerd --storage-driver=overlay -H fd:// --containerd=/run/containerd/containerd.sock
unable to configure the Docker daemon with file /etc/docker/daemon.json: the following directives are specified both as a flag and in the configuration file: storage-driver: (from flag: overlay, from file: overlay2)
pi#raspberrypi:~ $ sudo /usr/bin/dockerd -H fd:// --containerd=/run/containerd/containerd.sock
INFO[2021-12-09T14:34:31.667296985Z] Starting up
failed to load listeners: no sockets found via socket activation: make sure the service was started by systemd
Which steps am I missing to be able to run Docker with overlay fs, such that the SD-card in the Raspberry is read only?
Without the overlay fs active it all works as expected.
I ran into this issue as well and found a way around it. In summary, you can't run the default Docker FS driver (overlay2) on overlayfs. Fortunately, Docker supports other storage drivers, including fuse-overlayfs. Switching to this driver resolves the issue but there's one final catch. When Docker starts, it attempts to rename /var/lib/docker/runtimes and since overlayfs doesn't support renames of directories already in lower layers, it fails. If you simply rm -rf this directory while Docker is stopped and before you enable RPi's overlayfs, everything should work.

Docker is Running But Pycharm Cannot Connect to Docker Daemon

I am new to docker and haven't found a question here to answer the problem I'm experiencing.
I am tryin to use Pycharm to run a dockerfile, in order to debug certain program inside the docker.
I opened the dockerfile in pycharm, and I created a configuration for running the dockerfile.
Running the program results in an error message under the 'services' tab:
Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?
After I Googled the problem, I found this thread: Cannot connect to the Docker daemon at unix:/var/run/docker.sock. Is the docker daemon running?
Which said I should be running sudo dockerd. After some bugs I uninstalled docker completely, and installed it again.
After installation I ran:
systemctl status docker
And the output is:
● docker.service - Docker Application Container Engine
Loaded: loaded (/lib/systemd/system/docker.service; enabled; vendor preset: enabled)
Active: active (running) since Sat 2020-09-26 15:06:22 IDT; 59s ago
Docs: https://docs.docker.com
Main PID: 24888 (dockerd)
Tasks: 21
CGroup: /system.slice/docker.service
└─24888 /usr/bin/dockerd -H fd:// --containerd=/run/containerd/containerd.sock
So I stopped it using sudo service docker stop
I ran systemctl status docker again and it was indeed stopped:
● docker.service - Docker Application Container Engine
Loaded: loaded (/lib/systemd/system/docker.service; enabled; vendor preset: enabled)
Active: inactive (dead) since Sat 2020-09-26 15:09:29 IDT; 16s ago
Docs: https://docs.docker.com
Process: 24888 ExecStart=/usr/bin/dockerd -H fd:// --containerd=/run/containerd/containerd.sock (code=exited, status=0/SUCCES
Main PID: 24888 (code=exited, status=0/SUCCESS)
Sep 26 15:06:21 DL-2 dockerd[24888]: time="2020-09-26T15:06:21.919021419+03:00" level=info msg="Loading containers: done."
Sep 26 15:06:22 DL-2 dockerd[24888]: time="2020-09-26T15:06:22.265996712+03:00" level=info msg="Docker daemon" commit=4484c46d9
Sep 26 15:06:22 DL-2 dockerd[24888]: time="2020-09-26T15:06:22.266253446+03:00" level=info msg="Daemon has completed initializa
Sep 26 15:06:22 DL-2 dockerd[24888]: time="2020-09-26T15:06:22.642407513+03:00" level=info msg="API listen on /var/run/docker.s
Sep 26 15:06:22 DL-2 systemd[1]: Started Docker Application Container Engine.
Sep 26 15:09:29 DL-2 systemd[1]: Stopping Docker Application Container Engine...
Sep 26 15:09:29 DL-2 dockerd[24888]: time="2020-09-26T15:09:29.427473508+03:00" level=info msg="Processing signal 'terminated'"
Sep 26 15:09:29 DL-2 dockerd[24888]: time="2020-09-26T15:09:29.428067483+03:00" level=info msg="stopping event stream following
Sep 26 15:09:29 DL-2 dockerd[24888]: time="2020-09-26T15:09:29.428325869+03:00" level=info msg="Daemon shutdown complete"
Sep 26 15:09:29 DL-2 systemd[1]: Stopped Docker Application Container Engine.
So I ran sudo dockerd and it seemed to run fine:
INFO[2020-09-26T15:11:03.918879915+03:00] Starting up
INFO[2020-09-26T15:11:03.919388821+03:00] detected 127.0.0.53 nameserver, assuming systemd-resolved, so using resolv.conf: /run/systemd/resolve/resolv.conf
INFO[2020-09-26T15:11:03.919768789+03:00] parsed scheme: "unix" module=grpc
INFO[2020-09-26T15:11:03.919779317+03:00] scheme "unix" not registered, fallback to default scheme module=grpc
INFO[2020-09-26T15:11:03.919792653+03:00] ccResolverWrapper: sending update to cc: {[{unix:///run/containerd/containerd.sock 0 <nil>}] <nil>} module=grpc
INFO[2020-09-26T15:11:03.919798154+03:00] ClientConn switching balancer to "pick_first" module=grpc
INFO[2020-09-26T15:11:03.920399082+03:00] parsed scheme: "unix" module=grpc
INFO[2020-09-26T15:11:03.920409757+03:00] scheme "unix" not registered, fallback to default scheme module=grpc
INFO[2020-09-26T15:11:03.920418642+03:00] ccResolverWrapper: sending update to cc: {[{unix:///run/containerd/containerd.sock 0 <nil>}] <nil>} module=grpc
INFO[2020-09-26T15:11:03.920423441+03:00] ClientConn switching balancer to "pick_first" module=grpc
INFO[2020-09-26T15:11:04.050458554+03:00] [graphdriver] using prior storage driver: overlay2
WARN[2020-09-26T15:11:04.212728085+03:00] Your kernel does not support swap memory limit
WARN[2020-09-26T15:11:04.212780116+03:00] Your kernel does not support cgroup rt period
WARN[2020-09-26T15:11:04.212798165+03:00] Your kernel does not support cgroup rt runtime
WARN[2020-09-26T15:11:04.212812782+03:00] Your kernel does not support cgroup blkio weight
WARN[2020-09-26T15:11:04.212830211+03:00] Your kernel does not support cgroup blkio weight_device
INFO[2020-09-26T15:11:04.213206856+03:00] Loading containers: start.
INFO[2020-09-26T15:11:04.547434099+03:00] 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[2020-09-26T15:11:04.985878757+03:00] Loading containers: done.
INFO[2020-09-26T15:11:05.259805773+03:00] Docker daemon commit=4484c46d9d graphdriver(s)=overlay2 version=19.03.13
INFO[2020-09-26T15:11:05.259975115+03:00] Daemon has completed initialization
INFO[2020-09-26T15:11:05.418371093+03:00] API listen on /var/run/docker.sock
But running the dockerfile again resulted in the same error. Im quite at a loss as to why this happens, so I would appreciate any feedback.
Should more information be needed, let me know and I'll be happy to provide.
Thanks in advance :)
Can you run docker command such as docker images without sudo? If not, you should run sudo usermod -aG docker $USER and then you can use docker command as non-root user (https://docs.docker.com/engine/install/linux-postinstall/). I'm not sure if it will solve your problem.
For Pop!_OS users:
If you installed PyCharm / PhpStorm / IntelliJ via PoP!_Shop as flatpack image:
flatpak override --user --filesystem=/run/docker.sock com.jetbrains.PyCharm-Community
Change the trailing jetbrains product name (here:PyCharm-Community) according to the used version / flavour.
Just restart the computer/laptop if other suggestions did not help. It helped me :)

CentOS 7 - Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?

I tried to install the docker in CentOS 7 and got daemon error. I tried all the methods available on the internet for installation and for debugging but none really worked! I even tried to install older versions of docker that didn't work either.
SELinux is Disabled.
Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?
docker version
Client:
Version: 1.13.1
API version: 1.26
Package version:
Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?
systemctl status docker.service -l
Redirecting to /bin/systemctl status -l docker.service
● docker.service - Docker Application Container Engine
Loaded: loaded (/usr/lib/systemd/system/docker.service; disabled; vendor preset: disabled)
Active: failed (Result: exit-code) since Fri 2020-04-10 18:00:02 CEST; 49min ago
Docs: http://docs.docker.com
Process: 4510 ExecStart=/usr/bin/dockerd-current --add-runtime docker-runc=/usr/libexec/docker/docker-runc-current --default-runtime=docker-runc --exec-opt native.cgroupdriver=systemd --userland-proxy-path=/usr/libexec/docker/docker-proxy-current --init-path=/usr/libexec/docker/docker-init-current --seccomp-profile=/etc/docker/seccomp.json $OPTIONS $DOCKER_STORAGE_OPTIONS $DOCKER_NETWORK_OPTIONS $ADD_REGISTRY $BLOCK_REGISTRY $INSECURE_REGISTRY $REGISTRIES (code=exited, status=1/FAILURE)
Main PID: 4510 (code=exited, status=1/FAILURE)
Apr 10 18:00:01 ns3138286 systemd[1]: Starting Docker Application Container Engine...
Apr 10 18:00:01 ns3138286 dockerd-current[4510]: time="2020-04-10T18:00:01.506877169+02:00" level=info msg="libcontainerd: new containerd process, pid: 4522"
Apr 10 18:00:02 ns3138286 dockerd-current[4510]: time="2020-04-10T18:00:02.514107274+02:00" level=error msg="'overlay' not found as a supported filesystem on this host. Please ensure kernel is new enough and has overlay support loaded."
Apr 10 18:00:02 ns3138286 dockerd-current[4510]: Error starting daemon: error initializing graphdriver: driver not supported
Apr 10 18:00:02 ns3138286 systemd[1]: docker.service: main process exited, code=exited, status=1/FAILURE
Apr 10 18:00:02 ns3138286 systemd[1]: Failed to start Docker Application Container Engine.
Apr 10 18:00:02 ns3138286 systemd[1]: Unit docker.service entered failed state.
Apr 10 18:00:02 ns3138286 systemd[1]: docker.service failed.
Difficult to provide an exact solution to this question without more details, however, the error message is clear:
'overlay' not found as a supported filesystem on this host
Please note:
To configure Docker to use the overlay storage driver your Docker host must be running version 3.18 of the Linux kernel (preferably
newer) with the overlay kernel module loaded.
Check the kernel version with uname -r
If you have installed a new kernel since installing docker, try rebooting your machine.
If you do not explicitly need overlay, you can also specify storage drivers in the /etc/docker/daemon.json file - 'devicemapper' was the preferred storage driver for kernels that do not support overlay.

Unable to run docker-compose

Following this article on Jhipster, I build the project. I, however, can't run docker-compose. So, I try to figure out the problem. I walk step by step with this Docker-Compose article without luck.
$ sudo service docker status
docker.service - Docker Application Container Engine
Loaded: loaded (/lib/systemd/system/docker.service; enabled; vendor preset: enabled)
Active: active (running) since Thu 2018-12-27 15:40:22 PST; 2 days ago
Docs: https://docs.docker.com
Main PID: 1960 (dockerd)
Tasks: 20 (limit: 4440)
Memory: 68.2M
CGroup: /system.slice/docker.service
├─1960 /usr/bin/dockerd -H fd://
└─2093 docker-containerd -l unix:///var/run/docker/libcontainerd/docker-containerd.sock --metrics-interval=0 --start-timeout 2m --s
Dec 27 15:40:10 tk-PC dockerd[1960]: time="2018-12-27T15:40:10.493340278-08:00" level=warning msg="Your kernel does not support swap memory li
Dec 27 15:40:10 tk-PC dockerd[1960]: time="2018-12-27T15:40:10.493612101-08:00" level=warning msg="Your kernel does not support cgroup rt peri
Dec 27 15:40:10 tk-PC dockerd[1960]: time="2018-12-27T15:40:10.493681034-08:00" level=warning msg="Your kernel does not support cgroup rt runt
Dec 27 15:40:10 tk-PC dockerd[1960]: time="2018-12-27T15:40:10.496381656-08:00" level=info msg="Loading containers: start."
Dec 27 15:40:17 tk-PC dockerd[1960]: time="2018-12-27T15:40:17.498415923-08:00" level=info msg="Default bridge (docker0) is assigned with an I
Dec 27 15:40:19 tk-PC dockerd[1960]: time="2018-12-27T15:40:19.646853084-08:00" level=info msg="Loading containers: done."
Dec 27 15:40:22 tk-PC dockerd[1960]: time="2018-12-27T15:40:22.512083092-08:00" level=info msg="Daemon has completed initialization"
Dec 27 15:40:22 tk-PC dockerd[1960]: time="2018-12-27T15:40:22.512266914-08:00" level=info msg="Docker daemon" commit=89658be graphdriver=aufs
Dec 27 15:40:22 tk-PC dockerd[1960]: time="2018-12-27T15:40:22.553322342-08:00" level=info msg="API listen on /var/run/docker.sock"
Dec 27 15:40:22 tk-PC systemd[1]: Started Docker Application Container Engine.
$ sudo ls -la /var/run/docker.sock
srw-rw---- 1 root docker 0 Dec 27 15:39 /var/run/docker.sock
$ sudo usermod -aG docker ${USER}
$ docker-compose -f docker-compose.yml build --build-arg UID=$(id -u)
ERROR: Couldn't connect to Docker daemon at http+docker://localhost - is it running?
If it's at a non-standard location, specify the URL with the DOCKER_HOST environment variable.
The result of the last step is the same as "docker-compose up -d". According to the article, it would be a permission problem if the problem still exists at this point. How can I find what permission issue?
There are multiple ways you can solve this problem. Firstly try to export environment variable of docker host with command:
export DOCKER_HOST=/var/run/docker.sock
If it works you can add the same line to your bashrc config to save this export permanently.
If it doesn't work you can try to modify docker daemon config. It located in
/etc/docker/daemon.json
You'll need to append the localhost to your hosts like that:
"hosts": ["old_hosts_not_modified_only_append_new_one", "tcp://localhost:2376"],
and restart docker daemon using command:
service docker restart
Hope it gonna help ya

Failed to start Docker Application Container Engine

I am new to Docker, so don't have much idea about it.
I tried restarting Docker service using command
service docker restart
As the command was taking too much of time I did a CTL+C
Now I am not able to start docker deamon
Any docker command gives following op
Cannot connect to the Docker daemon. Is the docker daemon running on this host?
I tried starting Docker deamon using
systemctl start docker
But it outputs:
Job for docker.service failed because the control process exited with error code. See "systemctl status docker.service" and "journalctl -xe" for details.
Output of command
**systemctl status docker.service**
`● docker.service - Docker Application Container Engine
Loaded: loaded (/usr/lib/systemd/system/docker.service; enabled; vendor preset: disabled)
Drop-In: /etc/systemd/system/docker.service.d
└─docker.conf, http-proxy.conf, https-proxy.conf
Active: failed (Result: exit-code) since Mon 2018-03-05 17:17:54 IST; 2min 23s ago
Docs: https://docs.docker.com
Process: 11331 ExecStart=/usr/bin/dockerd --graph=/app/dockerRT (code=exited, status=1/FAILURE)
Main PID: 11331 (code=exited, status=1/FAILURE)
Memory: 76.9M
CGroup: /system.slice/docker.service
└─4593 docker-containerd-shim 3bda33eac892d14adda9f3b1fc8dc52173e26ce60ca949075227d903399c7517 /var/run/docker/libcontainerd/3bda33eac892d14adda9f3b1fc8dc52173e26c...
Mar 05 17:17:05 hj-fsbfsd9761.persistent.co.in systemd[1]: Starting Docker Application Container Engine...
Mar 05 17:17:05 hj-fsbfsd9761.persistent.co.in dockerd[11331]: time="2018-03-05T17:17:05.126009059+05:30" level=info msg="libcontainerd: new containerd process, pid: 11337"
Mar 05 17:17:06 hj-fsbfsd9761.persistent.co.in dockerd[11331]: time="2018-03-05T17:17:06.346599571+05:30" level=warning msg="devmapper: Usage of loopback devices is ...section."
Mar 05 17:17:10 hj-fsbfsd9761.persistent.co.in dockerd[11331]: time="2018-03-05T17:17:10.889378989+05:30" level=warning msg="devmapper: Base device already exists an...ignored."
Mar 05 17:17:10 hj-fsbfsd9761.persistent.co.in dockerd[11331]: time="2018-03-05T17:17:10.976695025+05:30" level=info msg="[graphdriver] using prior storage driver \"...mapper\""
Mar 05 17:17:54 hj-fsbfsd9761.persistent.co.in dockerd[11331]: time="2018-03-05T17:17:54.312812069+05:30" level=fatal msg="Error starting daemon: timeout"
Mar 05 17:17:54 hj-fsbfsd9761.persistent.co.in systemd[1]: docker.service: main process exited, code=exited, status=1/FAILURE
Mar 05 17:17:54 hj-fsbfsd9761.persistent.co.in systemd[1]: **Failed to start Docker Application Container Engine.**
Mar 05 17:17:54 hj-fsbfsd9761.persistent.co.in systemd[1]: Unit docker.service entered failed state.
Mar 05 17:17:54 hj-fsbfsd9761.persistent.co.in systemd[1]: docker.service failed.
Hint: Some lines were ellipsized, use -l to show in full.
journalctl -xe
loop: Write error at byte offset 63585648640, length 4096.
How would I be able to start Docker without losing any containers and using previous configurations?
I had the same issue (Fedora 30 x86_64, kernel 5.2.9) and it turned out that being connected to a VPN was the problem. Apparently having a changed gateway address causes an "Error initializing network controller" error which I was able to see when I tried starting docker via sudo dockerd instead of sudo systemctl start docker.
I found the note here about the VPN being a possible problem, disconnecting immediately allowed me to start docker with systemctl start docker.
"Failed to start Docker Application Container Engine" is a general error message.
You should inspect journal for more details:
journalctl -eu docker
In my case it was: "error initializing graphdriver: /var/lib/docker contains several valid graphdrivers: devicemapper, overlay2"
Changing graphdriver to overlay2, fixed it:
$ sudo systemctl stop docker
$ vi /etc/docker/daemon.json # Create the file if it does not exist, and add:
{
"storage-driver": "overlay2"
}
$ sudo systemctl start docker
$ systemctl status docker.service # Hopefully it's running now
I removed the file /etc/docker/daemon.json and started it with sudo systemctl start docker and it worked!!
For the googlers:
For me what worked was doing a killall dockerd and a sudo rm /var/run/docker.pid
I got the error message that recommended that from running dockerd
I ran into this too but all I did after receiving the error was sudo systemctl start docker and then ran sudo systemctl status docker again and that took care of it while on a vpn.
You may have the issue with the current docker installation.
If you don't have much done already you may want to try to reinstall using the install script provided by Docker: https://docs.docker.com/install/linux/docker-ce/ubuntu/#install-using-the-convenience-script this will help you to investigate the errors.
I faced the same problem, in my case the disk was full. I removed docker volumes from /var/lib/docker/volumes/ and started docker with sudo systemctl start docker.

Resources