How to configure rancher nfs? having an error

what to put on the configuration options?

NFS server:
Mount directory:
Mount options:

my configuration

NFS server: "i have put my main host server ip"
Mount directory: "i only put forward slash for the directory /"
Mount options: “none”

i am having this error below:

(Expected state running but got error: Error response from daemon: create 357aeb11-2110-4658-a707-f4021d8cfef7: VolumeDriver.Create: Failed mount -o ,nfsvers=4 192.168.254.11:/nfsmount /tmp/eca4c: mount.nfs: access denied by server while mounting 192.168.254.11:/nfsmount)

and i have created a container with a network host, and created a volume and use rancher-nfs as the driver of the volume, when i launch the container, it is stuck on activating.

other recommendations?

thank you

i have tried everything but this error still persist, is there any proper documentation for nfs rancher? or a set of example… this is getting frustrating… please help… thanks

Can you manually mount the nfs dir from the host where you are seeing the error?

Meaning, does something like

mkdir /some/dir/you/create
mount -t nfs 192.168.254.11:/ /some/dir/you/create

work?

Also, you said you only put / in the mount directory field, but then the error has /nfsmount. If you just put in /, that’s what I would expect to see in the error. Do you have any idea why there is a discrepancy?

2 Likes

@cjellick the /nfsmount folder was just a test in the mount: section of the UI, to see if the error still persist. both / and /nfsmount error still persist.

yes i can create folder directory, into my host, but i havent tried manually, i will try your method.

the rancher-nfs stack is running, and driver storage is enabled. below input keys that i have use on launching rancher-nfs stack below environment section:

i dont know… i’ve tried multiple times in making volumes in the service volumes tab section.

i have been following the e.g. in the given input of the volume tab services without , see below image:

below you see i have input /webappsrc as path in the host and /webapp is the working directory added on the command tab, and added the driver rancher-fs as the driver which i have added a rancher-nfs stack to enable the storage

this error still persist everytime, and seeing failed to create on daemon and access denied on the server, below is the image:

and also this the view of the storage tab, when automatically creates a volume upon creating the services, see below:

1 Like

@08ski11s it looks like you did everything correctly. I’ll be interested to see the results of your attempt to do an nfs mount from the host.

Also, on your nfs-server, can you share the contents of /etc/exports file? The problem could be a configuration of your nfs server that rancher-nfs can’t handle.

2 Likes

@cjellick i know how it works, i just configure the /etc/exports/ and follow the instructions here https://help.ubuntu.com/community/SettingUpNFSHowTo and the container should have privileges, it should be enabled during creating a service container in the service security tab, nfs server will automatically detect and configure volume that you have created. i prefer the /etc/exports/ method than the mounting method. thanks :slight_smile:

HI @08ski11s,

Did you manage to find a solution for your issue.
I am also facing same issues and appreciate if you can share the solution.

I am seeing below log messages
Activating (Expected state running but got error: Error response from daemon: error while mounting volume '/var/lib/rancher/volumes/rancher-nfs/Jens_jenkinsdata_fb74a': VolumeDriver.Mount: Failed nsenter -t 48144 -n mount -o ,nfsvers=4 10.xx.xxx.xxx://Jens_jenkinsdata_fb74a /var/lib/rancher/volumes/rancher-nfs/Jens_jenkinsdata_fb74a)

Thanks,
Vishnu

If your docker host os is ubuntu (xenial), upgrade the rancher-nfs service and remove MOUNT_OPTS.