Jump to content

NFS support for new "shared network folder" setup


EdoFede

Recommended Posts

Hi all :-)
 
I'm a new user, trying to setup my Emby + Kodi environment.
 
I've issues in library setup, during the "path substitution" phase, now integrated with library folders.
 
The issue is that Emby "shared network folder" field seems to accept only UNC paths (\\server\share...), so any linux client tries to access the share via Samba instead of using NFS.
 
My NAS exports shares both via SMB and NFS, but since I'm using some RaspberryPi as Kodi front-ends (OSMC distribution), I want to avoid using Samba, since it has an overhead on CPU.
 
The only way I've find to end the library setup is by using UNC paths, but of course all clients try to access the share via Samba.
Example, from kodi log:
Kodi can't locate file: smb://nas.local/volume1/share....

 

 

 
I've already tried to search for a solution on wiki and forum, but I've seen only threads (eg. https://emby.media/community/index.php?/forum/116-linux/)without solutions to get NFS works with Emby.
 
It seems that it was supported without problem in the previous "path substitution" way:
 
Is there any solution or workaround (even by edit manually some config file...) to pass to clients an NFS path instead of UNC, with the new library setup procedure?
 
Thank you in advance.
 
Bye,

 

Edoardo
Link to post
Share on other sites
After many attempts, I arrived at a workaround.
 
I've found the xml file in which network path is saved:
/var/lib/emby-server/root/default/<Library name>/options.xml
 
Example:
root@emby:/var/lib/emby-server/root/default/Concerts# cat options.xml
<?xml version="1.0"?>
<LibraryOptions xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
  <EnableArchiveMediaFiles>false</EnableArchiveMediaFiles>
  <EnablePhotos>true</EnablePhotos>
  <EnableRealtimeMonitor>false</EnableRealtimeMonitor>
  <SchemaVersion>3</SchemaVersion>
  <EnableChapterImageExtraction>false</EnableChapterImageExtraction>
  <ExtractChapterImagesDuringLibraryScan>false</ExtractChapterImagesDuringLibraryScan>
  <DownloadImagesInAdvance>true</DownloadImagesInAdvance>
  <PathInfos>
    <MediaPathInfo>
      <Path>/volume1/video_musicali</Path>
      <NetworkPath>\\nas.local\volume1\video_musicali</NetworkPath>
    </MediaPathInfo>
  </PathInfos>
  <SaveLocalMetadata>false</SaveLocalMetadata>
  <EnableInternetProviders>true</EnableInternetProviders>
</LibraryOptions>
 
This file seems to be modified only during creation or edit of a library element (not during rename).
 
So, I've tried to change the NetworkPath, pointing to the NFS share.
 
From
<NetworkPath>\\nas.local\volume1\video_musicali</NetworkPath>
 
To
<NetworkPath>nfs://nas.local/volume1/video_musicali</NetworkPath>
 
Then I've renamed the library (seems the only way to empty and re-scan from scratch). After library scan, all network paths use NFS path.
 
Example from Metadata manager:
post-162052-0-40511900-1476655250_thumb.png
 
After rebuilt the library on Kodi, everything works fine with NFS shares:
post-162052-0-04670400-1476655277_thumb.png
 
After that it's important to NOT modify library path setting, otherwise your manual setting will be rewrited.
No problem, instead, if you want to change library options and manager library images.
 
Hope this workaround helps, looking forward for an official solution.
 
Bye,

 

Edoardo
Link to post
Share on other sites

Nope  :(

 
If I try, I receive this error:
"There was an error adding the media path. Please ensure the path is valid and the Emby Server process has access to that location."
and can't go over.
 
Bye,
Edoardo
Link to post
Share on other sites
Update:
it seems that my workaround doesn't works in some particular cases... for example, when removing and recreate again a library, files keep old "network pointer".
I've seen that the library.db does not shrink after a library deletion and clean database run, so probably something (including network path) remains here or in another repositories.
 

 

Link to post
Share on other sites

The error message will be removed in the next release. It is normal for the .db files to not shrink. They will never shrink unless the sqlite vacuum command is used.

Link to post
Share on other sites

I have the same problem when trying to add shared network folders via nfs.

I also just upgraded to 3.0.8200.0

 

My path substitution is configured like this

 

SpfirkU.png

 

If I understand correctly it should look like this

 

keIkavK.png

 

But I get the same error described in the posts above.

 

"There was an error adding the media path. Please ensure the path is valid and the Emby Server process has access to that location."

Edited by Marv
  • Like 1
Link to post
Share on other sites
UrsusDominatus

Here is temporary semi-valid fix for this issue.

Extract project sources ("make extract" for example in FreeBSD port directory), locate and open the file "MediaBrowser.Server.Implementations\Library\LibraryManager.cs" in text editor. Find ValidateNetworkPath function (line 2839, for version 3.0.8200). Remove single "if" block from it, but leave "return true;" last statement. I.e. from:

private bool ValidateNetworkPath(string path)
{
    if (Environment.OSVersion.Platform == PlatformID.Win32NT || !path.StartsWith("\\\\", StringComparison.OrdinalIgnoreCase))
    {
        return Directory.Exists(path);
    }
    // Without native support for unc, we cannot validate this when running under mono
    return true;
}

you should get:

 

private bool ValidateNetworkPath(string path)
{
    return true;
}

Rebuild emby-server. (Sorry i'm novice linux user, in FreeBSD you should simply do "make install". Don't forget to uninstall existing emby first :)).

From now on you have network path validation disabled, and any paths will be accepted by server. Type "nfs://localserver/path/to/media" like paths and everything will works fine.

 

P.S. This is temporary solution while waiting for official fix.

Edited by UrsusDominatus
  • Like 1
Link to post
Share on other sites
OpenSourceUser

I'm also on 3.0.8200 and I want to use "emby for kodi" with direct file access. Have been using NFS ever since I first started playing around with kodi and now I'm stuck. Hoping for a fix in the next update.

Link to post
Share on other sites
  • 1 month later...

Hum. It seems that i have to choose "Network" on the folder part and then in optional the nfs path.

When i enter a nfs path in folder, it fails

 

ps: when you click "-" to remove a path, it accepts the creation of the library instead of removing it

Link to post
Share on other sites
  • 3 months later...

Got the same problem here I think, so I will post in this thread.

 

My setup:

Synology NAS hosting files (NFS)

Raspberry Pi 2

LibreELEC 8.0

Emby Server Version 3.2.5.0

 

I have a Synology NAS and shared my video folder using this Kodi Wiki: http://kodi.wiki/view/NFS#NFS_sharing_from_commercial_NAS_systems_such_as_Synology_or_QNAP

In Kodi I can access this NFS-share, but I want to use Emby Server for file management.

If I want to add my videos using the library I cannot access my NFS-share. If I use "Network" there are no shared paths visible.

If I enter the path to my NFS-share in directory like this "nfs://192.168.178.100:/volume1/Video/Filme", I get this error: "There was an error adding the media path. Please ensure the path is valid and the Emby Server process has access to that location." Like Marv's errorhttps://emby.media/community/index.php?/topic/40338-nfs-support-for-new-shared-network-folder-setup/&do=findComment&comment=377511

 

58b7ff768e2e6_error1.png

 

 

Do I have to use systemd to mount my NFS-share from my Synology NAS to my Raspberry Pi and then enter these mount-points in Emby-Server and use path substitutions?

Link to post
Share on other sites
mastrmind11

Got the same problem here I think, so I will post in this thread.

 

My setup:

Synology NAS hosting files (NFS)

Raspberry Pi 2

LibreELEC 8.0

Emby Server Version 3.2.5.0

 

I have a Synology NAS and shared my video folder using this Kodi Wiki: http://kodi.wiki/view/NFS#NFS_sharing_from_commercial_NAS_systems_such_as_Synology_or_QNAP

In Kodi I can access this NFS-share, but I want to use Emby Server for file management.

If I want to add my videos using the library I cannot access my NFS-share. If I use "Network" there are no shared paths visible.

If I enter the path to my NFS-share in directory like this "nfs://192.168.178.100:/volume1/Video/Filme", I get this error: "There was an error adding the media path. Please ensure the path is valid and the Emby Server process has access to that location." Like Marv's errorhttps://emby.media/community/index.php?/topic/40338-nfs-support-for-new-shared-network-folder-setup/&do=findComment&comment=377511

 

 

Do I have to use systemd to mount my NFS-share from my Synology NAS to my Raspberry Pi and then enter these mount-points in Emby-Server and use path substitutions?

Does Emby have access rights to your shares?  

Link to post
Share on other sites

Does Emby have access rights to your shares?  

 

 

I added permissions to my shared folders following this link: http://kodi.wiki/view/NFS#NFS_sharing_from_commercial_NAS_systems_such_as_Synology_or_QNAP

 

 

 

 As per example allow all IPs (or the desired IP for your HTPC) with read/write permissions, Squash Map all users to admin, Security sys, and enable asynchronous. The option allow connections from non-priviledged ports selected. Allow users to access mounted subfolders also selected.

 

 

I added a new user "emby" and gave "emby" read/write (Lesen/Schreiben) permissions (Berechtigungen) on the specific folder.

 

58b81967cfcf4_synologypermissions.png

 

 

*/ EDIT */

 

I added another user "kodi" with read/write permissions to that folder.

Here is a list of my users on the Raspberry Pi:

Kodi:~ # cat /etc/passwd
systemd-network:x:193:193:systemd-network:/:/bin/sh
root:x:0:0:Root User:/storage:/bin/sh
nobody:x:65534:65534:Nobody:/:/bin/sh
dbus:x:81:81:System message bus:/:/bin/sh
system:x:430:430:service:/var/run/connman:/bin/sh
avahi:x:495:495:avahi-daemon:/var/run/avahi-daemon:/bin/sh

And here the export list from my NAS (192.168.178.102 is the Raspberry Pi):

Exports list on 192.168.178.100:
/volume1/Video 192.168.178.99/24 192.168.178.102/24 192.168.178.101/24
Edited by zeug
Link to post
Share on other sites
mastrmind11

Not sure then.  I'm not familiar w/ Synology so our resident Synology guys take it from here.

Link to post
Share on other sites

I'm not sure the mono runtime supports nfs, so what you should do is mount it as a local folder in the OS, and then add that local folder to Emby.

  • Like 1
Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...