Container permissions issue after host reboot

Docker 18.09.9 on Ubuntu 20.04 LTS

Set up a Docker environment (using snapd) in a fresh Ubuntu VM, everything working as expected. Reboot the host due to maintenance and none of the containers will boot any more.

The exact error varies depending on the container but typically

/bin/sh: can’t open ‘/entrypoint.sh’: Permission denied
or
execlineb: fatal: unable to open /init for reading: Permission denied

Happens with containers using volumes, those using host mapped folders and those that are entirely standalone.

I’ve rebuilt this box twice now and the same thing keeps happening - everything works fine until a host reboot and then none of the containers will restart.

I’ve been tearing my hair out trying to find the cause and I don’t really want to rebuild again because there’s no reason to suspect it won’t just happen again.

Help.

Edit: It looks like it might be this issue: https://forum.snapcraft.io/t/docker-fails-with-permission-denied-inside-containers/17602/20, I’m going to try rolling back to an older kernel and see if it resolves the problem.

Yes, so it looks like this is a problem with the Docker snap package on Ubuntu running kernel 5.4.0-31 - rolling back to 5.4.0-29 has fixed it for me, just in case anyone else encounters the same issue.

This was a kernel regression and has been fixed now in kernel 5.4.0-33 so you can “apt update” and you should be good to go.

https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1879690