Kodi Community Forum
Linux NFS share not mounting properly - Printable Version

+- Kodi Community Forum (https://forum.kodi.tv)
+-- Forum: Support (https://forum.kodi.tv/forumdisplay.php?fid=33)
+--- Forum: General Support (https://forum.kodi.tv/forumdisplay.php?fid=111)
+---- Forum: Linux (https://forum.kodi.tv/forumdisplay.php?fid=52)
+---- Thread: Linux NFS share not mounting properly (/showthread.php?tid=351719)



NFS share not mounting properly - Phobios - 2020-02-14

I just installed Ubuntu 18.04 and installed kodi from the official ppa. I then copied the advancedsettings.xml and sources.xml to it from another machine where it works without issues. When I try to play a videofile I notice the following error messages in the log though:

Code:
2020-02-14 09:14:12.706 T:140534701607040  NOTICE: VideoPlayer::OpenFile: nfs://USERNAME@<ip-address>/library/Movies/video.mkv
2020-02-14 09:14:12.707 T:140533433579264  NOTICE: Creating InputStream
2020-02-14 09:14:12.933 T:140533433579264   ERROR: NFS: Failed to mount nfs share: /library/Movies (mount/mnt call failed with "RPC Packet not accepted by the server")
2020-02-14 09:14:12.933 T:140533433579264   ERROR: GetDirectory - Error getting nfs://USERNAME@<ip-address>/library/Movies/video.mkv
2020-02-14 09:14:13.173 T:140533433579264   ERROR: NFS: Failed to mount nfs share: /library/Movies (mount/mnt call failed with "RPC Packet not accepted by the server")
2020-02-14 09:14:13.173 T:140533433579264   ERROR: GetDirectory - Error getting nfs://[email protected]/library/Movies/movie.mkv
2020-02-14 09:14:13.413 T:140533433579264   ERROR: NFS: Failed to mount nfs share: /library/Movies (mount/mnt call failed with "RPC Packet not accepted by the server")
2020-02-14 09:14:13.413 T:140533433579264   ERROR: CVideoPlayer::OpenInputStream - error opening [nfs://[email protected]/library/Movies/movie.mkv]
2020-02-14 09:14:13.413 T:140533433579264  NOTICE: CVideoPlayer::OnExit()
2020-02-14 09:14:13.815 T:140534701607040  NOTICE: CVideoPlayer::CloseFile()

Anyone know what is wrong?


RE: NFS share not mounting properly - Klojum - 2020-02-14

(2020-02-14, 10:32)Phobios Wrote: Anyone know what is wrong?
Not without a crystal ball, no.

What hardware/OS are you using for a NFS server?


RE: NFS share not mounting properly - Phobios - 2020-02-14

I am running some server hardware (will need to check exactly what) for the NFS server with freebsd. I am connecting to it successfully from other instances of Kodi that I have throughout the house, so I thought the server was not the issue here.


RE: NFS share not mounting properly - Phobios - 2020-02-16

So the server is comprised of a supermicro A2SDi-8C-HLN4F motherboard with an integrated Intel Atom CPU and has 128GB och RAM.

I notice that I have the same issue when trying to play videofiles from Kodi on Android. Libeelec and OSMC works fine. It seems to have something to do with Ubuntu or the Linux kernel maybe? Should I try some other dist?


RE: NFS share not mounting properly - DaVu - 2020-02-16

The problem here is, that the issue might be on different sections

At a first glance, I would try to check if some firewall is running as a service on Ubuntu: systemctl | grep -i "firewall*" and if you get any results, then try to stop that service (probably something like: sudo systemctl stop firewalld.service ) and see if the issue is gone then. If the issue is gone, then we can do additional steps to allow specific ports/service on your Ubuntu machine by configuring the firewall. It might also be, that the firewall is called "ufw". So try to grep for that as well. 

The other problem might be on how you share your folders on the server side. Could we please see the /etc/exports file. 

It might also be worth trying to mount that share via the OS instead of let Kodi do it, to see if it mounts fine by the OS. Therefore:

- create a mountpoint (replace "<mountpoint>" with a folder name what you think might match best): sudo mkdir -p /media/<mountpoint>
- mount the share from the command line: sudo mount -t nfs <ip.from.server.here>:/path/to/share /media/<mountpoint>


RE: NFS share not mounting properly - Phobios - 2020-02-16

Thank you for your help DaVu.

There seems to be no firewall running on my system. 
I am sharing via zfs on freebsd, so my exports file is empty.
Mounting via the OS works just fine, so it seems like this issue is kodi-related. I remember seeing something about libnfs not being compiled into kodi when googling and seeing other users with the same issue. Maybe I should try to compile kodi myself? But it seems a little overkill. I will try to make it work this way, by mounting in the OS and creating entries in fstab for them. I just hope I can get it to be compatible with the mysql database I have. Or do you have any other suggestions?


RE: NFS share not mounting properly - DaVu - 2020-02-16

from your Ubuntu machine get me:

showmount -e <ip.from.nfs.server>

You might need to install nfs-common to be able to run that command
 
(2020-02-16, 12:28)Phobios Wrote: I am sharing via zfs on freebsd, so my exports file is empty.

This would be really strange, as

1. ZFS is a filesystem and has nothing to do with the network protocol in use. NFS is a network protocol and not a file system. Even if it's called "network file system" it's a protocol developed from Sun Microsystems.
2. FreeBSD is using the same file for defining the shares as every Linux system does:

german: https://www.freebsd.org/doc/de_DE.ISO8859-1/books/handbook/network-nfs.html
english: https://www.freebsd.org/doc/handbook/network-nfs.html

I use NFS only currently with all my Kodi clients on LibreELEC, Ubuntu and Fedora. I wasn't in need to compile something to be able to use NFS. Especially for Ubuntu, you are fine installing Kodi from the Kodi PPA to have everything working (did that for years with NFS). So I highly guess you don't need to compile anything.
 
(2020-02-16, 12:28)Phobios Wrote: But it seems a little overkill. I will try to make it work this way, by mounting in the OS and creating entries in fstab for them. I just hope I can get it to be compatible with the mysql database I have.
Mounting the shares via the OS is generally the best thing you can do. But you are correct. If you use a MySQL db already and all other Kodi clients are using that as well and on those you are able to add the NFS share, then (by using OS mounts) the paths to those files will look different and probably those files won't be available via the link the MySQL DB knows. So in that case, if you have multiple clients, I would really try to get NFS working from inside Kodi.


Could you also please get me the output of mount after you have mounted the shares via the mount-command mentioned above. I would be interested in the nfs version which gets mounted.

FYI: I will now switch OSs to Ubuntu on that laptop here, to see if I can get NFS mounts working inside Kodi from my UnRAID NAS. On Fedora it works fine.


RE: NFS share not mounting properly - DaVu - 2020-02-16

No problem for me on Ubuntu and using the NFS mount option inside Kodi installed from the Kodi ppa:
Code:
davu@davu-Laptop-E-series:~$ cat /etc/os-release
NAME="Ubuntu"
VERSION="18.04.3 LTS (Bionic Beaver)"
ID=ubuntu
ID_LIKE=debian
PRETTY_NAME="Ubuntu 18.04.3 LTS"
VERSION_ID="18.04"
HOME_URL="https://www.ubuntu.com/"
SUPPORT_URL="https://help.ubuntu.com/"
BUG_REPORT_URL="https://bugs.launchpad.net/ubuntu/"
PRIVACY_POLICY_URL="https://www.ubuntu.com/legal/terms-and-policies/privacy-policy"
VERSION_CODENAME=bionic
UBUNTU_CODENAME=bionic
davu@davu-Laptop-E-series:~$ apt-cache policy kodi
kodi:
  Installiert:           2:18.5+git20191117.0758-final-0bionic
  Installationskandidat: 2:18.5+git20191117.0758-final-0bionic
  Versionstabelle:
 *** 2:18.5+git20191117.0758-final-0bionic 500
        500 http://ppa.launchpad.net/team-xbmc/ppa/ubuntu bionic/main amd64 Packages
        500 http://ppa.launchpad.net/team-xbmc/ppa/ubuntu bionic/main i386 Packages
        100 /var/lib/dpkg/status
     2:17.6+git20180430.1623-final-0bionic 500
        500 http://ppa.launchpad.net/team-xbmc/ppa/ubuntu bionic/main amd64 Packages
        500 http://ppa.launchpad.net/team-xbmc/ppa/ubuntu bionic/main i386 Packages
     2:17.6+dfsg1-1ubuntu1 500
        500 http://de.archive.ubuntu.com/ubuntu bionic/universe amd64 Packages
davu@davu-Laptop-E-series:~$

So please, still, get me the following outputs:

mount after you mounted the shares manually via the mount command mentioned above
showmount -e <ip.from.server.here>
cat /etc/exports from your FreeBSD server
systemctl status ufw.service or as an alternative:
systemctl | nc termbin.com 9999 this will give you an URL back which you can post here


RE: NFS share not mounting properly - Phobios - 2020-02-17

Hi DaVu,
Yes, I am aware ZFS is a filesystem, but according to https://www.freebsd.org/doc/handbook/zfs-zfs.html I am supposed to share with the 'zfs set sharenfs...' command, which I did, hence my /etc/exports file is empty. 

Here is the output for showmount:
Quote: user@user:~$ showmount -e <ip-address>
Export list for <ipaddress>:
/library/Movies (everyone)
mount:
Quote: user@user:~$ mount
<ip-address>:/library/Movies on /home/user/Movies type nfs (rw,relatime,vers=3,rsize=131072,wsize=131072,namlen=255,hard,proto=tcp,timeo=600,retrans=2,sec=sys,mountaddr=<ip-address>,mountvers=3,mountport=728,mountproto=udp,local_lock=none,addr=<ip-address>)
systemctl status:
Quote:user@user:~$ systemctl status ufw.service
● ufw.service - Uncomplicated firewall
   Loaded: loaded (/lib/systemd/system/ufw.service; disabled; vendor preset: enabled)
   Active: inactive (dead)
     Docs: man:ufw(8)
I have also tried switching to using samba in kodi for my shares, and that works just fine. Also works on Android for me. For sharing samba I did not use 'zfs set sharesmb' command, but the regular way, so maybe I should try to share my NFS shares regularly as well? IIRC I tried to do it like that initially, but had some hiccups, read the freebsd doc on how to do it with zfs and never went back.


RE: NFS share not mounting properly - DaVu - 2020-02-17

ok, I don't know much about FreeBSD and sharenfs, but does the file /etc/zfs/exports contains something useful? Or is there any other config file in /etc which might help to see how this share is configured?

At least I see that your OS mounts the share by default as NFSv3, which is ok.

And I'm wondering a bit where the username@ip comes from which I see here:

NOTICE: VideoPlayer::OpenFile: nfs://USERNAME@<ip-address>/library/Movies/video.mkv

Normally I see things like:

NOTICE: VideoPlayer::OpenFile: nfs://<ip>/mnt/user/movieshd/INFERNO-BLURAY/Inferno_(2016)_t01.mkv

which is from my own machine. I never had to use a username for adding nfs-shares as a Kodi source.


RE: NFS share not mounting properly - Phobios - 2020-02-18

Yes, I see /etc/zfs/exports exists. Here are the contents of it
Quote:[user@Server ~]$ cat /etc/zfs/exports 
# !!! DO NOT EDIT THIS FILE MANUALLY !!!

/library/Movies -ro 
I have no idea where USERNAME comes from. Can't find any of it in any of the configuration files. I will investigate further. Could they be from the mysql database perhaps? The same is seen in the logs from my devices that work.


RE: NFS share not mounting properly - DaVu - 2020-02-18

ok, unfortunately you should not edit this file manually for whatever reasons. That's the point, where I personally will stop supporting it, as

- I don't know enough about FreeBSD and how sharenfs works at all
- I don't want to break your setup for your working machines because of the lack of knowledge

I could assist if you would use the general NFS-share-approach, where you are obviously a bit more flexible how to configure those shares. Maybe sharenfs also flexible but you probably have to use more arguments/parameters on that. What I can tell is, that this share config works fine on every device I'm using: 

"/mnt/user/tv" -async,no_subtree_check,fsid=104 *(sec=sys,rw,insecure,anongid=100,anonuid=99,all_squash)

anongid and anonuid will be different for your setup as that generally means a userID and a groupID where files are chowned to during copying something to that NAS


RE: NFS share not mounting properly - Phobios - 2020-02-19

Ok, I have switched to using the regular /etc/exports now, but I seem to be having difficulties adding more than a couple of options. So far all I can get working is the following line
/library/Movies -ro -network 192.168.0.0/16(sec=sys,insecure,anongid=1001,anonuid=1000,all_squash)

Trying to add the remaining options async and no_subtree_check results in the following error in /var/log/messages 
bad exports list line '/library/Movies -ro -async'

Seems like options for freebsd differs from Linux.

On the NFS server I also noted the following line in /var/log/messages
mountd[62391]: mount request from from unprivileged port

No error warning or anything like that so doesn't seem to be an issue. Also shouldn't be an issue with the insecure flag set, no?