sakaki-/raspbian-nspawn-64

Failed to install docker

Alessandro65 opened this issue · 8 comments

I followed your Wiki instructions to install Docker Inside the Container on a Raspi4B, but i got the following error:

Job for docker.service failed because the control process exited with error code. See "systemctl status docker.service" and "journalctl -xe" for details. invoke-rc.d: initscript docker, action "start" failed. ? docker.service - Docker Application Container Engine Loaded: loaded (/lib/systemd/system/docker.service; enabled; vendor preset: enabled) Active: activating (auto-restart) (Result: exit-code) since Sun 2020-04-05 17:35:26 CEST; 14ms ago Docs: https://docs.docker.com Process: 3130 ExecStart=/usr/bin/dockerd -H fd:// --containerd=/run/containerd/containerd.sock (code=exited, status=1/FAILURE) Main PID: 3130 (code=exited, status=1/FAILURE) dpkg: error processing package docker-ce (--configure): installed docker-ce package post-installation script subprocess returned error exit status 1

I attached the complete log.

Docker install failed log.txt

Any hint?

Please post output (run from a 32-bit shell) of:

  • sudo cat /etc/systemd/nspawn/debian-buster-64.nspawn
  • sudo systemctl cat systemd-nspawn@debian-buster-64
  • lsmod
  • cat /proc/sys/net/ipv4/ip_forward

Thanks, sakaki

Here attached the results of requested commands executions:
Docker Test Commands Results.txt

Thanks, Alessandro

Thanks - all looks OK apart from lsmod - is the output from that really blank? There should be at least three modules loaded - and generally speaking, a whole lot more. Try sudo lsmod just to be sure; and please post contents of cat /etc/modules, uname -a and ls /lib/modules.

Here the infos requested:
Docker Test Commands Results 2.txt

Thanks, Alessandro

OK, so I can see what is causing your problem now (and it will affect more than Docker!). Something has gone wrong updating your (official Raspbian) kernel (during an apt-get update; apt-get -y upgrade or similar run in the 32-bit Raspbian userland).

To expand, from uname -a you can see your kernel is 4.19.93-v8+; however all the module sets available in /lib/modules are for 4.19.97... kernels:

pi@raspberrypi:~ $ uname -a
Linux raspberrypi 4.19.93-v8+ #1290 SMP PREEMPT Fri Jan 10 16:51:04 GMT 2020 aarch64 GNU/Linux
pi@raspberrypi:~ $ ls /lib/modules
4.19.97+  4.19.97-v7+  4.19.97-v7l+  4.19.97-v8+

So you have no modules at all loaded, due to this version mismatch (including the three that Docker needs to start up) — which is why lsmod throws a blank.

To fix, run (at the 32-bit console):

pi@raspberrypi:~ $ sudo apt-get install --reinstall raspberrypi-bootloader raspberrypi-kernel

When done, check with df -h /boot that you still have some free space on the bootfs, and then reboot.

Once your system comes back up, try the modules tests again. Any different now?

Thanks Sakaki,
now my lsmod returns a long list of modules:
Lsmod results.txt

and the output of uname -a and ls /lib/modules is coherent:

pi@raspberrypi:~ $ uname -a
Linux raspberrypi 4.19.97-v8+ #1294 SMP PREEMPT Thu Jan 30 13:27:08 GMT 2020 aarch64 GNU/Linux

pi@raspberrypi:~ $ ls /lib/modules
4.19.97+  4.19.97-v7+  4.19.97-v7l+  4.19.97-v8+

Should I now try to reinstall Docker in the debian-buster-64 userland?

Hi @Alessandro65,

OK that looks good now. Yes, please try installing Docker in the 64-bit container again, beginning from the:

pi@debian-buster-64:~ $ sudo apt-get -y remove docker docker-engine docker.io containerd runc

line in the wiki instructions (to make sure any half-installed instances get removed before you begin).

Hopefully it'll work now!

Best, sakaki

Many thanks Sakaki, this time it worked!

Alessandro