Jump to content

Setting up a new server


Jey2024

Recommended Posts

Jey2024
Posted (edited)

Hi 

I'm setting up a brand new dedicated server.   The main server account is root. I have installed sabnzb and the downloads are saving to /root/Downloads/complete - the default setting of sab. Now the files are downloading to this location but I couldn't see this directory path when setting up Emby library.

I'm sure this is a permission related issue but I'm not sure how to fix. So I changed the download folder to /var/ - which was detected by Emby but it's not reading the files inside. The log says - 

 

	 ---> System.IO.IOException: Permission denied
	   --- End of inner exception stack trace ---
	   at System.IO.Enumeration.FileSystemEnumerator`1.CreateDirectoryHandle(String path, Boolean ignoreNotFound)
	   at System.IO.Enumeration.FileSystemEnumerator`1.Init()
	   at System.IO.Enumeration.FileSystemEnumerator`1..ctor(String directory, Boolean isNormalized, EnumerationOptions options)
	   at System.IO.Enumeration.FileSystemEnumerable`1..ctor(String directory, FindTransform transform, EnumerationOptions options, Boolean isNormalized)
	   at System.IO.Enumeration.FileSystemEnumerableFactory.FileSystemInfos(String directory, String expression, EnumerationOptions options, Boolean isNormalized)
	   at System.IO.DirectoryInfo.InternalEnumerateInfos(String path, String searchPattern, SearchTarget searchTarget, EnumerationOptions options)
	   at System.IO.DirectoryInfo.EnumerateFileSystemInfos()
	   at Emby.Server.Implementations.IO.ManagedFileSystem.EnumerateFileSystemInfos(DirectoryInfo dir, Boolean recursive)
	   at Emby.Server.Implementations.IO.ManagedFileSystem.GetFileSystemEntries(String path, Boolean recursive, FileSystemCredentials credentials)
	   at MediaBrowser.Controller.Providers.DirectoryService.GetFileSystemEntriesInternal(String path)
	   at System.Collections.Concurrent.ConcurrentDictionary`2.GetOrAdd(TKey key, Func`2 valueFactory)
	   at MediaBrowser.Controller.Providers.DirectoryService.GetFileSystemEntries(String path, Boolean clearCache)
	   at MediaBrowser.Controller.Providers.DirectoryService.GetFileSystemEntries(String path)
	   at MediaBrowser.Controller.Library.ItemResolveArgs.GetFileSystemChildren()
	   at MediaBrowser.Controller.Library.ItemResolveArgs.ContainsFileSystemEntryByName(String name, Boolean caseSensitive)
	   at Emby.Server.Implementations.Library.LibraryManager.ShouldResolvePathContents(ItemResolveArgs args)
	   at Emby.Server.Implementations.Library.LibraryManager.ResolvePath(FileSystemMetadata fileInfo, IDirectoryService directoryService, Folder parent, LibraryOptions libraryOptions)
	   at Emby.Server.Implementations.Library.LibraryManager.ResolveFileList(List`1 fileList, IDirectoryService directoryService, Folder parent, LibraryOptions libraryOptions)
	Source: System.Private.CoreLib
	TargetSite: IntPtr CreateDirectoryHandle(System.String, Boolean)
	InnerException: System.IO.IOException: Permission denied
	Source: 
	TargetSite: 
	
2024-05-01 08:51:02.775 Info LibraryMonitor: downloads (/var/lib/emby/downloads) will be refreshed.

 

root@server / # groups emby

emby : emby video render 

This is the user and  the group I guess. Can someone guide me on which commands I need to run so that I can scan this library? I'm new to linux so please bear with me. 

Edited by Jey2024
Link to comment
Share on other sites

Q-Droid

It's not so much about which commands to run as it is about setting things up to work better. The main one is you shouldn't be running sabnzbd as root for many reasons. Root can do anything on your server with anything it downloads. The other thing you might want to do is pick a path for the downloads that is not in a user home or software config directory.

If you're new to linux then spend some time learning about users (UIDs), groups (GIDs), file and directory ownership and permissions. Skipping this leads to problems down the road.

From the sab site: https://sabnzbd.org/wiki/advanced/directory-setup and https://sabnzbd.org/wiki/advanced/unix-permissions

You can find good setup guidance for sabnzbd and other things you might be missing here: https://trash-guides.info/Downloaders/SABnzbd/Basic-Setup/

 

  • Agree 1
Link to comment
Share on other sites

Jey2024
54 minutes ago, Q-Droid said:

It's not so much about which commands to run as it is about setting things up to work better. The main one is you shouldn't be running sabnzbd as root for many reasons. Root can do anything on your server with anything it downloads. The other thing you might want to do is pick a path for the downloads that is not in a user home or software config directory.

If you're new to linux then spend some time learning about users (UIDs), groups (GIDs), file and directory ownership and permissions. Skipping this leads to problems down the road.

From the sab site: https://sabnzbd.org/wiki/advanced/directory-setup and https://sabnzbd.org/wiki/advanced/unix-permissions

You can find good setup guidance for sabnzbd and other things you might be missing here: https://trash-guides.info/Downloaders/SABnzbd/Basic-Setup/

 

Thanks for the reply. I completely agree with you. But this is just a test install to check transcoding and streaming speed. therefore I’m not worried about the security at the moment. 
 

Just wanted to know why some directories are not visible under library folder setup but some are visible. The thing is all those directories are owner by root. 
 

If I create a directory n the root . Set the permission as user:group recursively, it should be picked up by emby right?

 

Link to comment
Share on other sites

Q-Droid

Ownership and permissions matter. It Emby owns the full path recursively then it will be able to access. If it only owns some sub-directories it will still need permissions on the full path to get there. 

  • Thanks 1
Link to comment
Share on other sites

Jey2024
5 hours ago, Q-Droid said:

Ownership and permissions matter. It Emby owns the full path recursively then it will be able to access. If it only owns some sub-directories it will still need permissions on the full path to get there. 

I was desperate to fix this asap so asked chatgpt lol and this is what I got - 

mkdir -p /mydownloads/completed
chown -R emby:emby /mydownloads/completed

running those commands and then selecting /mydownloads/completed as my library path has resolved my issue. 

But thanks for the insight. I will read up those articles and learn more about permissions and ownershipts.

  • Thanks 1
Link to comment
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...