Docker Community Forums

Share and learn in the Docker community.

Chown "invalid argument" for NFS volume on SLES-12

Hi,

I created an NFS volume and was able to successfully use it on Ubuntu 16.04. However when I move my image to SLES-12 and try to run it I get the error:

user@localhost:~> docker run -it -v nfs_test02:/mnt/nfs nfs_tests bash
docker: Error response from daemon: chown /var/lib/docker/volumes/nfs_test02/_data: invalid argument.

The Dockerfile for the nfs_tests container has the command:

USER nfs_testuser01

I create the nfs_testuser01 with specific UID/GID (both 1000).

If I run the container and create a volume from a local directory, e.g.:

user@localhost:~> docker run -it -v /var/tmp/test_dir:/test nfs_tests bash

It works fine. So there’s something about the NFS volume on SLES-12 that’s causing a problem. Has anyone else seen this?

Thanks,

Rob

I assume the named volume was created before. Please post the command you used to create it.

The node I’m running this on is running Docker version:

user@localhost:~> docker version

Client:
Version:      17.09.1-ce
API version:  1.32
Go version:   go1.8.7
Git commit:   f4ffd2511ce9
Built:        Mon Aug 20 15:49:50 2018
OS/Arch:      linux/amd64

Server:
Version:      17.09.1-ce
API version:  1.32 (minimum version 1.12)
Go version:   go1.8.7
Git commit:   f4ffd2511ce9
Built:        Sat Oct 21 17:27:07 2017
OS/Arch:      linux/amd64
Experimental: false

The command I used to create the NFS volume was:

docker volume create --driver local --opt type=nfs --opt o=addr=x.x.x.x,rw,nolock,vers=3 --opt device=:/nfsdir/nfs_test02 nfs_test02

If I mount the NFS export on a local directory and then specify the volume like a normal local directory for the run command, then I can access it just fine.

Thanks,

Rob

The syntax is correct. Usualy if a NFS mount can be mounted from the CLI, it should work as docker volume mount as well. The behavior is odd. Can you try nfsvers=3 instead of vers=3?

Also NFS version 4 or 4.1 is recommended over 3. Usualy version 3 tends to cause problems.

If this doesn’t help. Since Docker Inc does not provide Docker CE package for SLES, your installation must be an os vendors package (as in: likely customized, repackaged and redistributed by SUSE), as such I would suggest to raise an issue to the os vendor.

Hi,

I’m stuck with NFS v3 due to the server implementation. For now the work-around of mounting it locally seems to be fine. It’s not the best solution, but…

Thanks,

Rob

Hi,

I think I figured it out. Since I’m using a non-root user in the container I needed to chown the mount point for the NFS export so that it already belonged to the user. So I now do that in the Dockerfile and that seems to have fixed the problem.

Rob