systemctl start docker Job for docker.service failed because the control process exited with error

1. Docker failed to start after installation

[[email protected] ~]# systemctl start docker
Job for docker.service failed because the control process exited with error code. See "systemctl status docker.service" and "journalctl -xe" for details.
[[email protected] ~]# 
[[email protected] ~]# journalctl -xe
Oct 22 11:10:36 tbase1 systemd[1]: Unit docker.service entered failed state.
Oct 22 11:10:36 tbase1 systemd[1]: docker.service failed.
Oct 22 11:10:38 tbase1 systemd[1]: docker.service holdoff time over, scheduling restart.
Oct 22 11:10:38 tbase1 systemd[1]: Stopping Docker Socket for the API.
-- Subject: Unit docker.socket has begun shutting down
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
-- 
-- Unit docker.socket has begun shutting down.
Oct 22 11:10:38 tbase1 systemd[1]: Starting Docker Socket for the API.
-- Subject: Unit docker.socket has begun start-up
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
-- 
-- Unit docker.socket has begun starting up.
Oct 22 11:10:38 tbase1 systemd[1]: Listening on Docker Socket for the API.
-- Subject: Unit docker.socket has finished start-up
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
-- 
-- Unit docker.socket has finished starting up.
-- 
-- The start-up result is done.
Oct 22 11:10:38 tbase1 systemd[1]: start request repeated too quickly for docker.service
Oct 22 11:10:38 tbase1 systemd[1]: Failed to start Docker Application Container Engine.
-- Subject: Unit docker.service has failed
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
-- 
-- Unit docker.service has failed.
-- 
-- The result is failed.
Oct 22 11:10:38 tbase1 systemd[1]: Unit docker.service entered failed state.
Oct 22 11:10:38 tbase1 systemd[1]: docker.service failed.

[[email protected] ~]# systemctl stop docker
[[email protected] ~]# 
[[email protected] ~]# 
[[email protected] ~]# systemctl start docker
Job for docker.service failed because start of the service was attempted too often. See "systemctl status docker.service" and "journalctl -xe" for details.
To force a start use "systemctl reset-failed docker.service" followed by "systemctl start docker.service" again.
[[email protected] ~]# 
[[email protected] ~]# 

Json to /etc/docker/ daemone.conf, but not daemone.json. But mine is the newly installed Docker, /etc/docker has no such file under it.

[[email protected] docker]# cd /etc/docker/
[[email protected] docker]# ls
key.json
[[email protected] docker]# 

3. Start dockerd directly and check the log

[[email protected] docker]# dockerd
INFO[2020-10-22T11:17:08.729949738+08:00] Starting up                                  
INFO[2020-10-22T11:17:08.732247548+08:00] parsed scheme: "unix"                         module=grpc
INFO[2020-10-22T11:17:08.732274835+08:00] scheme "unix" not registered, fallback to default scheme  module=grpc
INFO[2020-10-22T11:17:08.732298172+08:00] ccResolverWrapper: sending update to cc: {[{unix:///run/containerd/containerd.sock 0  <nil>}] <nil>}  module=grpc
INFO[2020-10-22T11:17:08.732306615+08:00] ClientConn switching balancer to "pick_first"  module=grpc
INFO[2020-10-22T11:17:08.733766403+08:00] parsed scheme: "unix"                         module=grpc
INFO[2020-10-22T11:17:08.733793158+08:00] scheme "unix" not registered, fallback to default scheme  module=grpc
INFO[2020-10-22T11:17:08.733807436+08:00] ccResolverWrapper: sending update to cc: {[{unix:///run/containerd/containerd.sock 0  <nil>}] <nil>}  module=grpc
INFO[2020-10-22T11:17:08.733813642+08:00] ClientConn switching balancer to "pick_first"  module=grpc
failed to start daemon: error initializing graphdriver: /var/lib/docker contains several valid graphdrivers: overlay2, devicemapper; Please cleanup or explicitly choose storage driver (-s <DRIVER>)
[[email protected] docker]# 

error mainly due to failed to start daemon: error initializing graphdriver: /var/lib/docker contains several valid graphdrivers: overlay2, devicemapper; Please cleanup or explicitly choose storage driver (-s < DRIVER>) .

4, according to the above error, first put /var/lib/docker under overlay2,devicemapper mv drop

[[email protected] docker]# cd /var/lib/
[[email protected] lib]# ls
AccountsService  color       dnsmasq  geoclue    misc                  pacemaker   pulse      spamassassin  upower
alsa             colord      docker   gssproxy   mlocate               PackageKit  rasdaemon  stateless     virtuoso
alternatives     containerd  dovecot  hyperv     net-snmp              pcp         rhsm       stolon        vmware
amanda           containers  etcd     initramfs  NetworkManager        pcsd        rpcbind    systemd       xkb
authconfig       corosync    flatpak  iscsi      nfs                   Pegasus     rpm        tpm           yum
bluetooth        cs          fprint   libvirt    openlmi-registration  plymouth    rpm-state  tuned
chrony           dbus        games    logrotate  openlmi-storage       polkit-1    rsyslog    udisks2
cockpit          dhclient    gdm      machines   os-prober             postfix     samba      unbound
[[email protected] lib]# cd docker/
[[email protected] docker]# ls
containers  devicemapper  image  network  overlay2  plugins  runtimes  swarm  tmp  trust  volumes
[[email protected] docker]# 
[[email protected] docker]# 
[[email protected] docker]# mv overlay2 overlay2_back
[[email protected] docker]# mv devicemapper/ devicemapper_bak
[[email protected] docker]# ls -ltr
total 0
drwx------ 4 root root 32 Aug 23 20:02 plugins
drwx------ 2 root root  6 Aug 23 20:02 trust
drwxr-x--- 3 root root 19 Aug 23 20:02 network
drwx------ 2 root root  6 Aug 23 20:02 swarm
drwx------ 4 root root 42 Aug 23 20:09 image
drwx------ 5 root root 53 Aug 23 20:10 devicemapper_bak
drwx------ 3 root root 78 Aug 23 20:10 containers
drwx------ 3 root root 97 Aug 23 20:10 volumes
drwx------ 2 root root  6 Oct 22 11:17 tmp
drwx------ 2 root root  6 Oct 22 11:17 runtimes
drwx------ 3 root root 40 Oct 22 11:17 overlay2_back

5. Start docker

again

[[email protected] docker]# systemctl start docker
[[email protected] docker]# systemctl status docker
● docker.service - Docker Application Container Engine
   Loaded: loaded (/usr/lib/systemd/system/docker.service; disabled; vendor preset: disabled)
   Active: active (running) since Thu 2020-10-22 11:19:37 CST; 27s ago
     Docs: https://docs.docker.com
 Main PID: 1926 (dockerd)
   Memory: 56.0M
   CGroup: /system.slice/docker.service
           └─1926 /usr/bin/dockerd -H fd:// --containerd=/run/containerd/containerd.sock

Oct 22 11:19:36 tbase1 dockerd[1926]: time="2020-10-22T11:19:36.905481889+08:00" level=info msg="scheme \"unix\" no...e=grpc
Oct 22 11:19:36 tbase1 dockerd[1926]: time="2020-10-22T11:19:36.905497425+08:00" level=info msg="ccResolverWrapper:...e=grpc
Oct 22 11:19:36 tbase1 dockerd[1926]: time="2020-10-22T11:19:36.905504796+08:00" level=info msg="ClientConn switchi...e=grpc
Oct 22 11:19:36 tbase1 dockerd[1926]: time="2020-10-22T11:19:36.917251460+08:00" level=info msg="Loading containers: start."
Oct 22 11:19:37 tbase1 dockerd[1926]: time="2020-10-22T11:19:37.071539867+08:00" level=info msg="Default bridge (do...dress"
Oct 22 11:19:37 tbase1 dockerd[1926]: time="2020-10-22T11:19:37.099207556+08:00" level=info msg="Loading containers: done."
Oct 22 11:19:37 tbase1 dockerd[1926]: time="2020-10-22T11:19:37.147549150+08:00" level=info msg="Docker daemon" com....03.13
Oct 22 11:19:37 tbase1 dockerd[1926]: time="2020-10-22T11:19:37.147636946+08:00" level=info msg="Daemon has complet...ation"
Oct 22 11:19:37 tbase1 dockerd[1926]: time="2020-10-22T11:19:37.164192481+08:00" level=info msg="API listen on /var....sock"
Oct 22 11:19:37 tbase1 systemd[1]: Started Docker Application Container Engine.
Hint: Some lines were ellipsized, use -l to show in full.


Read More: