Docker Community Forums

Share and learn in the Docker community.

Cannot start Dockerd anymore

Hi,
inspecting the journal messages, I’ve found the following:

dockerd[2131]: time="..." level=info msg="Starting up"
dockerd[2131]: time="..." level=info msg="detected 127.0.0.53 nameserver, assuming systemd-resolved, so using resolv.conf: /run/systemd/resolve/resolv.conf"
dockerd[2131]: time="..." level=info msg="parsed scheme: \"unix\"" module=grpc
dockerd[2131]: time="..." level=info msg="scheme \"unix\" not registered, fallback to default scheme" module=grpc
dockerd[2131]: time="..." level=info msg="ccResolverWrapper: sending update to cc: {[{unix:///run/containerd/containerd.sock  <nil> 0 <nil>}] <nil> <nil>}" module=grpc
dockerd[2131]: time="..." level=info msg="ClientConn switching balancer to \"pick_first\"" module=grpc
dockerd[2131]: time="..." level=info msg="parsed scheme: \"unix\"" module=grpc
mag 10 17:59:11 thecastles dockerd[2131]: time="2021-05-10T17:59:11.874250635+02:00" level=info msg="scheme \"unix\" not registered, fallback to default scheme" module=grpc
dockerd[2131]: time="..." level=info msg="ccResolverWrapper: sending update to cc: {[{unix:///run/containerd/containerd.sock  <nil> 0 <nil>}] <nil> <nil>}" module=grpc
dockerd[2131]: time="..." level=info msg="ClientConn switching balancer to \"pick_first\"" module=grpc
dockerd[2131]: time="..." level=info msg="[graphdriver] using prior storage driver: overlay2"
dockerd[2131]: time="..." level=warning msg="Your kernel does not support CPU realtime scheduler"
dockerd[2131]: time="..." level=warning msg="Your kernel does not support cgroup blkio weight"
dockerd[2131]: time="..." level=warning msg="Your kernel does not support cgroup blkio weight_device"
dockerd[2131]: time="..." level=info msg="Loading containers: start."
dockerd[2131]: time="..." level=warning msg="Running iptables --wait -t nat -L -n failed with message: `iptables v1.8.4 (legacy): can't initialize iptables table `nat': Device or resource busy\nPerhaps iptables or your kernel needs to be upgraded.`, error: exit status 3"
dockerd[2131]: time="..." level=info msg="stopping event stream following graceful shutdown" error="<nil>" module=libcontainerd namespace=moby
dockerd[2131]: failed to start daemon: Error initializing network controller: error obtaining controller instance: failed to create NAT chain DOCKER: iptables failed: iptables -t nat -N DOCKER: iptables v1.8.4 (legacy): can't initialize iptables table `nat': Device or resource busy
dockerd[2131]: Perhaps iptables or your kernel needs to be upgraded.
dockerd[2131]:  (exit status 3)

The core message seems to be Error initializing network controller: error obtaining controller instance: failed to create NAT chain DOCKER: iptables failed: iptables -t nat -N DOCKER: iptables v1.8.4 (legacy): can’t initialize iptables table `nat’: Device or resource busy but I haven’t found any solution so far.
Recently some update has broken Grub and I manage to have it back with a Boot repair from a Ubuntu live distro.
This is my system:

ccastelli@thecastles:~$ inxi -F
System:    Kernel: 5.8.0-48-generic x86_64 bits: 64 Desktop: KDE Plasma 5.18.5 
           Distro: Ubuntu 20.04.2 LTS (Focal Fossa) 
Machine:   Type: Desktop System: LENOVO v: ideacentre 510A-15ARR serial: <superuser/root required> 
           Mobo: LENOVO model: 36EE v: SDK0J40700 WIN 3258112639596 serial: <superuser/root required> UEFI: LENOVO v: O3TKT50A 
           date: 09/01/2020 
CPU:       Topology: Quad Core model: AMD Ryzen 5 2400G with Radeon Vega Graphics bits: 64 type: MT MCP L2 cache: 2048 KiB 
           Speed: 1513 MHz min/max: 1600/3600 MHz Core speeds (MHz): 1: 1503 2: 1583 3: 1457 4: 1414 5: 1685 6: 1434 7: 1471 
           8: 1571 
Graphics:  Device-1: AMD Lexa PRO [Radeon 540/540X/550/550X / RX 540X/550/550X] driver: amdgpu v: 5.9.10.20.50 
           Device-2: AMD Raven Ridge [Radeon Vega Series / Radeon Vega Mobile Series] driver: amdgpu v: 5.9.10.20.50 
           Display: x11 server: X.Org 1.20.9 driver: amdgpu FAILED: ati unloaded: fbdev,modesetting,vesa 
           resolution: 1920x1080~60Hz 
           OpenGL: renderer: Radeon RX550/550 Series v: 4.6.14756 Core Profile Context 20.50 
Audio:     Device-1: AMD Baffin HDMI/DP Audio [Radeon RX 550 640SP / RX 560/560X] driver: snd_hda_intel 
           Device-2: Advanced Micro Devices [AMD/ATI] Raven/Raven2/Fenghuang HDMI/DP Audio driver: snd_hda_intel 
           Device-3: Advanced Micro Devices [AMD] Raven/Raven2/FireFlight/Renoir Audio Processor driver: N/A 
           Device-4: Advanced Micro Devices [AMD] Family 17h HD Audio driver: snd_hda_intel 
           Device-5: USB2.0 Hub type: USB driver: snd-usb-audio,uvcvideo 
           Sound Server: ALSA v: k5.8.0-48-generic 
Network:   Device-1: Realtek RTL8111/8168/8411 PCI Express Gigabit Ethernet driver: r8169 
           IF: enp2s0 state: up speed: 100 Mbps duplex: full mac: 6c:4b:90:77:7e:56 
Drives:    Local Storage: total: 1.14 TiB used: 157.06 GiB (13.4%) 
           ID-1: /dev/nvme0n1 vendor: Samsung model: MZVLW256HEHP-000L7 size: 238.47 GiB 
           ID-2: /dev/sda vendor: Western Digital model: WD10EZEX-08WN4A0 size: 931.51 GiB 
Partition: ID-1: / size: 233.24 GiB used: 157.06 GiB (67.3%) fs: ext4 dev: /dev/nvme0n1p5 
Sensors:   System Temperatures: cpu: 49.4 C mobo: N/A gpu: amdgpu temp: 47 C 
           Fan Speeds (RPM): N/A gpu: amdgpu fan: 2358 
Info:      Processes: 316 Uptime: 1h 04m Memory: 6.79 GiB used: 3.30 GiB (48.6%) Shell: bash inxi: 3.0.38

Thanks for any advice.

It seems that after manually typing sudo modprobe iptable-nat e sudo modprobe iptable-filter, now the error is:

162893f5963f262d bridge name docker0 while booting up from persistent state: Failed to Setup IP tables: Unable to enable NAT rule:  (iptables failed: iptables --wait -t nat -I POSTROUTING -s 172.17.0.0/16 ! -o docker0 -j MASQUERADE: iptables v1.8.4 (legacy): Couldn't load target `MASQUERADE':No such file or directory\n\nTry `iptables -h' or 'iptables --help' for more information.\n (exit status 2))"
mag 10 19:24:21 thecastles dockerd[19621]: time="2021-05-10T19:24:21.498534861+02: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 a preferred IP address"
mag 10 19:24:21 thecastles dockerd[19621]: time="2021-05-10T19:24:21.501991436+02:00" level=info msg="stopping event stream following graceful shutdown" error="<nil>" module=libcontainerd namespace=moby
mag 10 19:24:21 thecastles dockerd[19621]: failed to start daemon: Error initializing network controller: Error creating default "bridge" network: Failed to Setup IP tables: Unable to enable NAT rule:  (iptables failed: iptables --wait -t nat -I POSTROUTING -s 172.17.0.0/16 ! -o docker0 -j MASQUERADE: iptables v1.8.4 (legacy): Couldn't load target `MASQUERADE':No such file or directory