Jump to content

Unable to add UNC media paths


ptr727

Recommended Posts

Hi, new user, I installed Emby on W2K12R2.

I am unable to add media paths.

 

I add media type TV or Movies, and when I paste the full UNC path to where the media is located, the UI deletes my text in the current path field, and a tooltip reports please fill out this text.

Btw, I use the same paths for XBMC and for Plex, I'm a long time OpenELEC / MySQL user, looking for something simpler, trying out Plex and Emby.

 

The logs show what appears to be an authentication error:

2015-10-12 07:41:45.5175 Error - HttpServer: Error processing request for /Environment/DirectoryContents?includeDirectories=true&path=%5C%5CSTORAGE%5CMedia%5CMovies%5CMovies
	*** Error Report ***
	Version: 3.0.5724.6
	Command line: C:\Users\Administrator\AppData\Roaming\Emby-Server\system\MediaBrowser.ServerApplication.exe
	Operating system: Microsoft Windows NT 6.2.9200.0
	Processor count: 1
	64-Bit OS: True
	64-Bit Process: False
	Program data path: C:\Users\Administrator\AppData\Roaming\Emby-Server
	Application Path: C:\Users\Administrator\AppData\Roaming\Emby-Server\system\MediaBrowser.ServerApplication.exe
	The user name or password is incorrect.
	
	ServiceStack.HttpError
	No Stack Trace Available

Same happens when I use IP instead of named servers:

2015-10-12 07:54:46.1359 Error - DtoUtils: ServiceBase<TRequest>::Service Exception
	*** Error Report ***
	Version: 3.0.5724.6
	Command line: C:\Users\Administrator\AppData\Roaming\Emby-Server\system\MediaBrowser.ServerApplication.exe
	Operating system: Microsoft Windows NT 6.2.9200.0
	Processor count: 1
	64-Bit OS: True
	64-Bit Process: False
	Program data path: C:\Users\Administrator\AppData\Roaming\Emby-Server
	Application Path: C:\Users\Administrator\AppData\Roaming\Emby-Server\system\MediaBrowser.ServerApplication.exe
	The user name or password is incorrect.
	
	System.IO.IOException
	   at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
	   at System.IO.FileSystemEnumerableIterator`1.CommonInit()
	   at System.IO.FileSystemEnumerableIterator`1..ctor(String path, String originalUserPath, String searchPattern, SearchOption searchOption, SearchResultHandler`1 resultHandler, Boolean checkHost)
	   at System.IO.DirectoryInfo.EnumerateDirectories(String searchPattern, SearchOption searchOption)
	   at MediaBrowser.Api.EnvironmentService.GetFileSystemEntries(GetDirectoryContents request)
	   at MediaBrowser.Api.EnvironmentService.Get(GetDirectoryContents request)
	   at lambda_method(Closure , Object , Object )
	   at ServiceStack.Host.ServiceRunner`1.Execute(IRequest request, Object instance, TRequest requestDto)
	
2015-10-12 07:54:46.1359 Error - HttpServer: Error processing request for /Environment/DirectoryContents?includeDirectories=true&path=%5C%5C192.168.1.46%5CMedia%5CMovies%5CMovies
	*** Error Report ***
	Version: 3.0.5724.6
	Command line: C:\Users\Administrator\AppData\Roaming\Emby-Server\system\MediaBrowser.ServerApplication.exe
	Operating system: Microsoft Windows NT 6.2.9200.0
	Processor count: 1
	64-Bit OS: True
	64-Bit Process: False
	Program data path: C:\Users\Administrator\AppData\Roaming\Emby-Server
	Application Path: C:\Users\Administrator\AppData\Roaming\Emby-Server\system\MediaBrowser.ServerApplication.exe
	The user name or password is incorrect.
	
	ServiceStack.HttpError
	No Stack Trace Available

The account has read access to the media folders.

When I open the same media path in explorer, in the same user session, it opens and reads just fine.

 

Am I missing something?

How do I add UNC media paths?

Edited by ptr727
Link to comment
Share on other sites

Ok, the problem is as follows:

 

The installer asks for elevation, and thus installs in the context of an admin account.

It installs the binaries under the %appdata% folder of the account under which it was launched, i.e. the admin account.

Then launches the app under the same account as the installer account, thus the admin account.

But runs in the current user session.

 

This is not right.

If you are going to install in %appdata%, then do not require elevation.

If you are going to require elevation, then install in %programfiles%, or in %programdata%, do not install in the user specific folder of the admin account.

 

Thus although the app was running in the local user session, the process was spawned by the installer, and the installer was running in the context of an admin account.

This not only messed up the permissions, it also means it is impossible to re-launch the app after it is installed in a non-admin account.

 

Created issue: https://github.com/MediaBrowser/Emby/issues/1217

Edited by ptr727
Link to comment
Share on other sites

Our installer is not perfect, and you make valid points, but it works for the vast majority of users. It is unlikely we are going to change it at this point just on account of the amount of disruption it would cuase. So you'll have to decide whether you want to work around it or not. It is better for you to just search the forum because every couple of months someone raises these same concerns, so we've answered them already. The short of it is that our goal of automated updates narrows our choices in terms of where we can install.

 

As an aside, I have called upon community members to help create entirely new installation processes that wouldn't have to worry about disrupting existing users. So far nobody has come forward to help with it. But maybe at some point that will see the light of day. I would very much like to get us on chocolatey which would create another windows install option.

Link to comment
Share on other sites

That is unfortunate.

 

You require an admin account to install, and the way you install you require the same admin account to run.

You run, not just any app, but a web server, thus exposing the system, with admin privileges, to remote attack.

 

That is the most dangerous configuration possible, and flies in the face of every standard best practice when it comes to security, and windows application design and install guidelines.

 

I would seriously urge you to reconsider your position.

 

 

Given that you install in the local user folder, why do you require elevation?

If only to install the VC runtime, then spawn the VC runtime installer asking for elevation only for the installer, and drop back to local user for the rest of the install.

Link to comment
Share on other sites

the server does not need elevation to run. I think you are saying that on account of your file access problems, but once you complete the install process, you do not need to run the server with elevated permissions.

 

as far as this 

If only to install the VC runtime, then spawn the VC runtime installer asking for elevation only for the installer, and drop back to local user for the rest of the install.

yes that is a good suggestion and something that can be looked into.

Link to comment
Share on other sites

the server does not need elevation to run. I think you are saying that on account of your file access problems, but once you complete the install process, you do not need to run the server with elevated permissions.

 

as far as this 

If only to install the VC runtime, then spawn the VC runtime installer asking for elevation only for the installer, and drop back to local user for the rest of the install.

yes that is a good suggestion and something that can be looked into.

 

Primary problem is the installer is elevated, and ends up running in the admin account, and installs only in the admin account profile, thus it is impossible to run it from a different profile.

I.e. when installed from the "Media_Player" user session, it is actually installed in the "Administrator" account folders, and not available to any user other than "Administrator".

 

I can manually move the files and the shortcuts to the user %appdata% folder, or to a shared %programdata% folder, and the run it.

 

I am all for least privilege installs and runtimes (if local user access only is desirable), and it is much easier to self-update if elevation is not required, but it needs to work.

Link to comment
Share on other sites

we can remove elevation from the installer and just elevate on demand, so that would solve that. in the meantime it sounds like you've figured out a portable install.

  • Like 1
Link to comment
Share on other sites

we can remove elevation from the installer and just elevate on demand, so that would solve that. in the meantime it sounds like you've figured out a portable install.

 

We can't elevate on demand in the auto update routine as it is unattended.

Link to comment
Share on other sites

We can't elevate on demand in the auto update routine as it is unattended.

 

If you avoid system level changes, then elevation is never required.

E.g. do not use the VC redist installer, copy the runtime side-by-side in your own directory (following the rules of the VC redist agreement, some files may not be distributed in this way), or link statically.

Link to comment
Share on other sites

We can't elevate on demand in the auto update routine as it is unattended.

 

no but i think the installer can 

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...