moby: [graphdriver] prior storage driver "aufs" failed: invalid argument
When trying docker 1.7 (from the docker maintained repo) package on Ubuntu 14.04, I now get the following error on boot:
INFO[0000] Listening for HTTP on unix (/var/run/docker.sock)
ERRO[0000] [graphdriver] prior storage driver "aufs" failed: invalid argument
FATA[0000] Error starting daemon: error initializing graphdriver: invalid argument
/var/run/docker.sock is up
This led me to this bug #7321, because we use btrfs for /var/lib/docker. I’ve since changed it to ext4, but I’m still getting the errors above.
root@ip-10-128-16-91:/etc/init# uname -a
Linux ip-10-128-16-91 3.13.0-55-generic #92-Ubuntu SMP Sun Jun 14 18:32:20 UTC 2015 x86_64 x86_64 x86_64 GNU/Linux
root@ip-10-128-16-91:/etc/init# mount | grep docker
/dev/xvdh on /var/lib/docker type ext4 (rw)
root@ip-10-128-16-91:/etc/init# docker --version
Docker version 1.7.0, build 0baf609
About this issue
- Original URL
- State: closed
- Created 9 years ago
- Reactions: 1
- Comments: 67 (18 by maintainers)
Had the same issue when upgrading to kernel 4.0.x on Ubuntu, where
aufs
is no longer supported andrm -rf /var/lib/docker/aufs
did the trick.CAUTION!
rm -rf /var/lib/docker/aufs
also deletes all docker containers…@zave the “fix” mentioned is basically to get rid of an actual error; the fact that you previously ran docker with the aufs driver, but the driver doesn’t work. Removing the aufs directory just nukes your containers and images, so that docker picks the next available driver (which may be
vfs
in a worst case scenario).The Linux-image-extra package is tied to your kernel version, so has to be reinstalled after upgrading the kernel; check https://docs.docker.com/engine/installation/linux/ubuntulinux/#prerequisites-by-ubuntu-version on how to install it
@PhE you have a completely different error message and as such a different issue. Most likely you upgraded your kernel and did not install that kernels
extras
package, which includes the aufs kernel mods.This happens to me all the time. It seems like it happens after running dist-upgrades in Ubuntu, and I always have to go in and run this:
My issue came from a kernel upgrade. I was running
So i think the uname -r was using the current kernel and not the new kernel that the dist-upgrade. So aufs wasn’t working properly.
Had the same issue. Was resolved after:
Solution found there: http://log.rowanto.com/broken-docker-in-debian-jessie/
I’m running Linux Mint 18 and I’ve updated from kernel 4.4.0 to 4.8.11. (29.11.2016).
This helps me out.
@jocull correct; if a dist-upgrade upgrades the kernel, chances are you need to install the correct version of the linux-image-extra package for the updated kernel. I think that installing the
linux-image-extra-virtual
package would help in that situation (and was recently added to the docs, to match what the install script installs; https://github.com/docker/docker/pull/25614)My experience show docker doesn’t like to run under a root directory, meaning
/var/lib/docker
or what is specified by-g
cannot be a root directory of an EBS volume or a LVM of EBS volume. Giving docker one more level of directory in the same volume through-g
solved the problem.I have
Docker version 1.10.2, build c3959b1
andubuntu 14.04, Linux 3.13.0-79
DOCKER_OPTS="-g /data/docker/docker"
works butDOCKER_OPTS="-g /data/docker"
doesn’t.Be aware that
sudo rm -rf /var/lib/docker/aufs
removes all existing images and containers. Basically it’s a “factory reset”So, I had this bite me again today. I was able to dig in some more. Here’s some background for what happens on my servers:
/var/lib/docker
. I then:/var/lib/docker
The issue seems to be that sometimes, when stopping docker, it does not umount not only
/var/lib/docker/aufs
, but a subdirectory (in this last case:/var/lib/docker/aufs/mnt/ebe69f270843f32a24b4c16343f8c312897d38128bd36df8b25cfe4442a1de3e
).Since I’ve mounted over
/var/lib/docker
already with the new device, it doesn’t give me the ability to unmount leftover volumes. I was able to manually fix it by doing the following:umount /var/lib/docker
umount /var/lib/docker/aufs/mnt/ebe69f270843f32a24b4c16343f8c312897d38128bd36df8b25cfe4442a1de3e
umount /var/lib/docker/aufs
mount /var/lib/docker
At this point I’m not sure how I can deal with this in a safe way without having to get manually involved, or writing a script to handle it. My current workflow, in ansible, goes like this:
The change being that now I call out to the
umount
command directly and try to force the host to unmount every aufs mount it has. I’m not sure that this will actually work, but I thought I’d at least give an update as to where I am today just in case this bites anyone else, and in case this gives @cpuguy83 any other info that might help.see https://gist.github.com/parente/025dcb2b9400a12d1a9f
This is another example of Docker having major showstopping issues with one of the most widely-used distros (see #3182 )
@cpuguy83
Docker starts correctly and works if I umount
/var/lib/docker
. We use it with an external EBS volume.@Kelindar , thanks, I gave you a thumbs up and down because I think moving is better than deleting.
Yes, if they upgraded the kernel and did not install the required kernel modules after that, then aufs would no longer start. Docker does not automatically pick the next available driver in that situation, because then you won’t see your existing images and containers, so it deliberately fails to start to give you an option to resolve the situation.
aufs
is not supported by latest kernels, so you should use overlayfs instead. I just edit the/etc/systemd/system/docker.service.d/docker.conf
this way:Then do:
I had the same problem, after updating to 1.12.1 and rebooting. I solved it by removing /var/lib/docker/overlay (or just renaming it smth else, just in case, you know) and restarting docker. I have no idea why it worked, but glad it did.
can also confirm @Kelindar solution worked for me. Debian stretch.
+1 to @Kelindar. I also had the same problem after upgrading 4.0. But now all my containers are gone 😦
I don’t think there is any way to get those back ?
Thanks @Kelindar! I also updated the linux kernel on Ubuntu and removing aufs saved me. 😃
In the end it looks like we had to manually remove
/var/lib/docker/aufs
after mounting the newly formatted external volume and starting docker1.7. I’m not sure why it would be getting created in the first place, and I’m not entirely sure what is creating it.We also made sure to unmount /var/lib/docker/aufs before we mounted the new volume. I’m not entirely sure which of our steps finally fixed it for us, but I hope to have some time to narrow it down.