Error: "error creating aufs mount to" when building dockerfile

I get this error when I try to build a docker file

 error creating aufs mount to /var/lib/docker/aufs/mnt   
 /6c1b42ce1a98b1c0f2d2a7f17c196221445f1054566065d4c607e4f1b99930eb-init:   
 invalid argument

What does it mean? How do I fix it?


I had some unresolved errors after removing /var/lib/docker/aufs, which a couple extra steps cleared up.

To add to @benwalther answer, since I lack the reputation to comment:

# Cleaning up through docker avoids these errors
#   ERROR: Service 'master' failed to build:
#     open /var/lib/docker/aufs/layers/<container_id>: no such file or directory
#   ERROR: Service 'master' failed to build: failed to register layer:
#     open /var/lib/docker/aufs/layers/<container_id>: no such file or directory
docker rm -f $(docker ps -a -q)
docker rmi -f $(docker images -a -q)

# As per @BenWalther's answer above
sudo service docker stop
sudo rm -rf /var/lib/docker/aufs

# Removing the linkgraph.db fixed this error:
#   Conflict. The name "/jenkins_data_1" is already in use by container <container_id>.
#   You have to remove (or rename) that container to be able to reuse that name.
sudo rm -f /var/lib/docker/linkgraph.db


sudo service docker start

I have removed /var/lib/docker/aufs/diff and got the same problem:

error creating aufs mount to /var/lib/docker/aufs/mnt/blah-blah-init: invalid argument

It solved by running the following commands:

docker stop $(docker ps -a -q);
docker rm $(docker ps -a -q);
docker rmi -f $(docker images -a -q)