5

docker ps hangs forever was the first symptom so I purged docker and tried to reinstall ... the install never finishes

dpkg -l|grep docker
iF  docker-ce                                  5:19.03.8~3-0~ubuntu-bionic                amd64        Docker: the open-source application container engine
ii  docker-ce-cli                              5:19.03.8~3-0~ubuntu-bionic                amd64        Docker CLI: the open-source application container engine

notice in above the docker installed failed as per iF ... details see dpkg -l | head -3

on Ubuntu 20.04 docker fails to finish its install

sudo apt-get install docker-ce
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following additional packages will be installed:
  aufs-tools cgroupfs-mount containerd.io docker-ce-cli pigz
The following NEW packages will be installed:
  aufs-tools cgroupfs-mount containerd.io docker-ce docker-ce-cli pigz
0 upgraded, 6 newly installed, 0 to remove and 0 not upgraded.
Need to get 0 B/85.7 MB of archives.
After this operation, 385 MB of additional disk space will be used.
Do you want to continue? [Y/n] 
Selecting previously unselected package pigz.
(Reading database ... 272586 files and directories currently installed.)
Preparing to unpack .../0-pigz_2.4-1_amd64.deb ...
Unpacking pigz (2.4-1) ...
Selecting previously unselected package aufs-tools.
Preparing to unpack .../1-aufs-tools_1%3a4.14+20190211-1ubuntu1_amd64.deb ...
Unpacking aufs-tools (1:4.14+20190211-1ubuntu1) ...
Selecting previously unselected package cgroupfs-mount.
Preparing to unpack .../2-cgroupfs-mount_1.4_all.deb ...
Unpacking cgroupfs-mount (1.4) ...
Selecting previously unselected package containerd.io.
Preparing to unpack .../3-containerd.io_1.2.13-1_amd64.deb ...
Unpacking containerd.io (1.2.13-1) ...
Selecting previously unselected package docker-ce-cli.
Preparing to unpack .../4-docker-ce-cli_5%3a19.03.8~3-0~ubuntu-bionic_amd64.deb ...
Unpacking docker-ce-cli (5:19.03.8~3-0~ubuntu-bionic) ...
Selecting previously unselected package docker-ce.
Preparing to unpack .../5-docker-ce_5%3a19.03.8~3-0~ubuntu-bionic_amd64.deb ...
Unpacking docker-ce (5:19.03.8~3-0~ubuntu-bionic) ...
Setting up aufs-tools (1:4.14+20190211-1ubuntu1) ...
Setting up containerd.io (1.2.13-1) ...
Setting up docker-ce-cli (5:19.03.8~3-0~ubuntu-bionic) ...
Setting up pigz (2.4-1) ...
Setting up cgroupfs-mount (1.4) ...
Setting up docker-ce (5:19.03.8~3-0~ubuntu-bionic) ...
Created symlink /etc/systemd/system/multi-user.target.wants/docker.service → /lib/systemd/system/docker.service.
Created symlink /etc/systemd/system/sockets.target.wants/docker.socket → /lib/systemd/system/docker.socket.

previous install was OK until I noticed docker ps was hanging forever ... I purged docker including deleting all of

apt-get purge docker-*  -y
rm -rf /var/lib/docker
systemctl daemon-reload

here is my apt entry

cd  /etc/apt ; grep -r docker 

sources.list.d/docker.list:deb [arch=amd64] https://download.docker.com/linux/ubuntu bionic stable

then I ran above install which also just hung forever so in desperation I added below to list of delete cmds ... did not help

rm /var/run/docker.pid
rm -rf /lib/systemd/system/docker.service
rm -rf /etc/docker
rm -rf /run/docker.sock
rm -rf /etc/systemd/system/docker.service.d

docker version also just hangs even as root

uname -m && uname -r && cat /etc/*release
x86_64
5.4.0-30-generic
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=20.04
DISTRIB_CODENAME=focal
DISTRIB_DESCRIPTION="Ubuntu 20.04 LTS"
NAME="Ubuntu"
VERSION="20.04 LTS (Focal Fossa)"
ID=ubuntu
ID_LIKE=debian
PRETTY_NAME="Ubuntu 20.04 LTS"

I am about to reformat my laptop and reinstall Ubuntu 20.04 from scratch ... any advise ?

Evidently the docker-ce purge package logic leaves mysterious remnants of docker wafting about which prevents the subsequent docker install to work correctly

PS ... my remote VPS ubuntu 18.04 all run docker fine so dunno if this is Ubuntu 20.04 related although I have seen docker run OK on other 20.04 boxes

UPDATE

yes when I revert back to kernel 29 from 5.4.0-30-generic docker is working OK and when I go back to kernel 30 again its failing in same way ... here is on kernel 5.4.0-30-generic

sudo journalctl -u docker

May 06 15:42:10 kiev systemd[1]: Starting Docker Application Container Engine...
May 06 15:42:10 kiev dockerd[6798]: time="2020-05-06T15:42:10.613610505-04:00" level=info msg="Starting up"
May 06 15:42:10 kiev dockerd[6798]: time="2020-05-06T15:42:10.615578768-04:00" level=info msg="detected 127.0.0.53 nameserver, assuming systemd-resolved, so using resolv.conf: /run/systemd/resolve/resolv.>
May 06 15:42:10 kiev dockerd[6798]: time="2020-05-06T15:42:10.645651302-04:00" level=info msg="parsed scheme: \"unix\"" module=grpc
May 06 15:42:10 kiev dockerd[6798]: time="2020-05-06T15:42:10.645870506-04:00" level=info msg="scheme \"unix\" not registered, fallback to default scheme" module=grpc
May 06 15:42:10 kiev dockerd[6798]: time="2020-05-06T15:42:10.645925462-04:00" level=info msg="ccResolverWrapper: sending update to cc: {[{unix:///run/containerd/containerd.sock 0  <nil>}] <nil>}" module=>
May 06 15:42:10 kiev dockerd[6798]: time="2020-05-06T15:42:10.645942687-04:00" level=info msg="ClientConn switching balancer to \"pick_first\"" module=grpc
May 06 15:42:10 kiev dockerd[6798]: time="2020-05-06T15:42:10.648421919-04:00" level=info msg="parsed scheme: \"unix\"" module=grpc
May 06 15:42:10 kiev dockerd[6798]: time="2020-05-06T15:42:10.648915679-04:00" level=info msg="scheme \"unix\" not registered, fallback to default scheme" module=grpc
May 06 15:42:10 kiev dockerd[6798]: time="2020-05-06T15:42:10.649020592-04:00" level=info msg="ccResolverWrapper: sending update to cc: {[{unix:///run/containerd/containerd.sock 0  <nil>}] <nil>}" module=>
May 06 15:42:10 kiev dockerd[6798]: time="2020-05-06T15:42:10.649038754-04:00" level=info msg="ClientConn switching balancer to \"pick_first\"" module=grpc
May 06 15:42:10 kiev dockerd[6798]: time="2020-05-06T15:42:10.845831131-04:00" level=warning msg="Your kernel does not support swap memory limit"
May 06 15:42:10 kiev dockerd[6798]: time="2020-05-06T15:42:10.845857901-04:00" level=warning msg="Your kernel does not support cgroup blkio weight"
May 06 15:42:10 kiev dockerd[6798]: time="2020-05-06T15:42:10.845868145-04:00" level=warning msg="Your kernel does not support cgroup blkio weight_device"
May 06 15:42:10 kiev dockerd[6798]: time="2020-05-06T15:42:10.846071798-04:00" level=info msg="Loading containers: start."
May 06 15:42:10 kiev dockerd[6798]: time="2020-05-06T15:42:10.955282685-04:00" level=info msg="Default bridge (docker0) is assigned with an IP address 172.17.0.0/16. Daemon option --bip can be used to set>
May 06 15:42:11 kiev dockerd[6798]: time="2020-05-06T15:42:11.027647745-04:00" level=info msg="Loading containers: done."

So problem only happens using kernel 5.4.0-30-generic whereas 5.4.0-29-generic is OK

docker-ce    5:19.03.8~3-0~ubuntu-bionic      amd64  

UPDATE

docker is OK on Ubuntu 20.04 which currently has kernel 5.8.0-32-generic

1
  • Just started getting this issue on kernel 5.4.0-58. I've tried other kernels that were supposed to work like 5.4.0-29 and 5.6.7 but it's still happening for me. Any other suggestions?
    – Naty722
    Dec 17, 2020 at 22:32

5 Answers 5

2

same for me. The did something wrong in the newest kernel. Reverting back to 5.4.0.28 solves the issue

2

My workaround fix was a bit different, the solution that worked for me is that I enter the kernel in the recovery mode, and then I manage to fully uninstall the docker because the docker doesn't stuck there. i think from whatever kernel you have you can do the same thing but to be honest i downgrade to the 5.4.0-29 just like the above answer. Nevertheless, the problem with the previous answer was that when i try to boot the kernel 5.4.0-29 the containerd stuck at the boot time wherein other versions the stuck happened when you try to execute some docker commands, so let me explain more closely the steps that i made

You'll need to edit your sudo nano /etc/default/grub file remove the "#" symbol at the start of line for

  1. GRUB_TIMEOUT=20 to show the menu for 20 seconds
  2. GRUB_TIMEOUT_STYLE=menu to show the boot menu

then save the file and quit the editor. Next run:

sudo update-grub 
sudo reboot

[Enter the boot menu1

enter the recovery mode

pick the root terminal and press ok and the enter

After that you are able To completely uninstall Docker run:

sudo apt-get purge -y docker-engine docker docker.io docker-ce docker-ce-cli
sudo apt-get autoremove -y --purge docker-engine docker docker.io docker-ce 

The above commands will not remove images, containers, volumes, or user created configuration files on your host. If you wish to delete all images, containers, and volumes run the following commands:

sudo rm -rf /var/lib/docker /etc/docker
sudo rm /etc/apparmor.d/docker
sudo groupdel docker
sudo rm -rf /var/run/docker.sock

You have removed Docker from the system completely without any docker stuck.

2
  • 1
    It worked for me! Dec 17, 2020 at 21:44
  • In recovery mode and as a root, when executing the sudo apt-get commands, I got E: dpkg was interrupted, you must manually run 'sudo dpkg --configure -a' to correct the problem. And in contrast to the previous tries in a non-recovery mode, this time 'sudo dpkg --configure -a' worked. I have added this to dpkg: error: dpkg status database is locked by another process as well. Dec 29, 2020 at 15:11
1

Switching to 5.4.0-29 does the trick

sudo apt-get update
sudo apt-get -y install linux-image-extra-virtual

replace GRUB_DEFAULT=0 with GRUB_DEFAULT="$entry1>$entry2"

in

sudo nano /etc/default/grub

this is the result of the concatenation, with ">" in the middle, of the first submenu entry ($entry1), and the one with .29 kernel version (or any other preferred) (not the recovery one) ($entry2) given by running grep -A100 submenu /boot/grub/grub.cfg |grep menuentry

Then update grub and reboot

sudo update-grub
sudo reboot

Finally reinstall docker again. All should be good.

source: https://meetrix.io/blog/aws/changing-default-ubuntu-kernel.html

Update 20/5

Ubuntu released 5.4.0-31-generic in the proposed channel which works fine with docker. So whoever used this trick, can switch back to GRUB_DEFAULT=0 and it should be good to go again.

2
  • when possible try to make answers able to work independent of the specifics of the current version etc ... ideally try to find the command(s) to identify that UUID looking big string you mention so the steps will work 3 years from now not tied to the work at hand May 8, 2020 at 9:08
  • fair point, made it a bit more generic
    – dimisjim
    May 8, 2020 at 12:40
0

Same problem for me too. Reverting to kernel 5.4.0-29 everything works fine. Before switching back to the older kernel I did some tries starting docekrd from command line or with systemctl. From command line it seems to start but at the end of the process it hangs as waiting for something.

0

docker is OK on Ubuntu 20.04 with

uname -a
Linux milan 5.4.0-31-generic #35-Ubuntu SMP Thu May 7 20:20:34 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux


grep -r docker /etc/apt
# /etc/apt/sources.list.d/docker.list:# deb [arch=amd64] https://download.docker.com/linux/ubuntu bionic test
/etc/apt/sources.list.d/docker.list:deb [arch=amd64] https://download.docker.com/linux/ubuntu focal test




docker version
Client: Docker Engine - Community
 Version:           19.03.9
 API version:       1.40
 Go version:        go1.13.10
 Git commit:        9d988398e7
 Built:             Fri May 15 00:25:20 2020
 OS/Arch:           linux/amd64
 Experimental:      false

Server: Docker Engine - Community
 Engine:
  Version:          19.03.9
  API version:      1.40 (minimum version 1.12)
  Go version:       go1.13.10
  Git commit:       9d988398e7
  Built:            Fri May 15 00:23:53 2020
  OS/Arch:          linux/amd64
  Experimental:     false
 containerd:
  Version:          1.2.13
  GitCommit:        7ad184331fa3e55e52b890ea95e65ba581ae3429
 runc:
  Version:          1.0.0-rc10
  GitCommit:        dc9208a3303feef5b3839f4323d9beb36df0a9dd
 docker-init:
  Version:          0.18.0
  GitCommit:        fec3683

see https://github.com/docker/for-linux/issues/993

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .