Jump to content

problem deleting files


adambot

Recommended Posts

adambot

Greetings,

 

I just installed emby-server on my headless archlinux server and enabled the ability to delete files, however, whenever i try to delete a file through the web interface i get bounced back to the login screen.

 

I only made 2 changes to the default setup. First was for the emby user so that it has permissions (restarting the daemon after i made the change):

uid=990(emby) gid=100(users) groups=100(users),1006(emby)

And i added the delete permission to the emby web user.

 

 

Here is the error i get:

2015-06-04 23:49:17.1779 Error - DtoUtils: ServiceBase<TRequest>::Service Exception
	*** Error Report ***
	Version: 3.0.5621.4
	Command line: /usr/lib/emby-server/MediaBrowser.Server.Mono.exe -programdata /var/lib/emby-server -ffmpeg /usr/bin/ffmpeg -ffprobe /usr/bin/ffprobe
	Operating system: Unix 4.0.4.2
	Processor count: 8
	64-Bit OS: True
	64-Bit Process: True
	Program data path: /var/lib/emby-server
	Mono: 4.0.1 (tarball Tue May 19 20:07:41 UTC 2015)
	Application Path: /usr/lib/emby-server/MediaBrowser.Server.Mono.exe
	Access to the path "/storage/media/Video/TV/Backlog/American Dad!/Season 12/American Dad! - S12E14 - American Fung - HDTV.mp4" is denied.
	System.UnauthorizedAccessException
	  at System.IO.File.Delete (System.String path) [0x00000] in <filename unknown>:0 
	  at MediaBrowser.Common.Implementations.IO.CommonFileSystem.DeleteFile (System.String path, Boolean sendToRecycleBin) [0x00000] in <filename unknown>:0 
	  at MediaBrowser.Common.Implementations.IO.CommonFileSystem.DeleteFile (System.String path) [0x00000] in <filename unknown>:0 
	  at MediaBrowser.Server.Implementations.Library.LibraryManager+<DeleteItem>c__async1.MoveNext () [0x00000] in <filename unknown>:0 
	
2015-06-04 23:49:17.1779 Error - HttpServer: Error processing request for /emby/Items/0489b9c8cdbcb8f61415f003f18771af
	*** Error Report ***
	Version: 3.0.5621.4
	Command line: /usr/lib/emby-server/MediaBrowser.Server.Mono.exe -programdata /var/lib/emby-server -ffmpeg /usr/bin/ffmpeg -ffprobe /usr/bin/ffprobe
	Operating system: Unix 4.0.4.2
	Processor count: 8
	64-Bit OS: True
	64-Bit Process: True
	Program data path: /var/lib/emby-server
	Mono: 4.0.1 (tarball Tue May 19 20:07:41 UTC 2015)
	Application Path: /usr/lib/emby-server/MediaBrowser.Server.Mono.exe
	Access to the path "/storage/media/Video/TV/Backlog/American Dad!/Season 12/American Dad! - S12E14 - American Fung - HDTV.mp4" is denied.
	ServiceStack.HttpError
	No Stack Trace Available
	

Here is the directory permissions (from root all the way to the file)

adam@turian ~ % ls -ld /storage
drwxrwsr-x+ 17 adam users 4.0K Jun  4 22:59 /storage
adam@turian ~ % ls -ld /storage/media 
drwxrwxr-x 8 adam users 95 Apr 28 17:43 /storage/media
adam@turian ~ % ls -ld /storage/media/Video 
drwxrwxr-x 6 adam users 91 Apr 28 17:43 /storage/media/Video
adam@turian ~ % ls -ld /storage/media/Video/TV 
drwxrwxr-x 8 adam users 119 Jun  1 20:58 /storage/media/Video/TV
adam@turian ~ % ls -ld /storage/media/Video/TV/Backlog 
drwxrwxr-x 42 adam users 4.0K May 18 18:16 /storage/media/Video/TV/Backlog
adam@turian ~ % ls -ld /storage/media/Video/TV/Backlog/American\ Dad\! 
drwxrwxr-x 6 adam users 110 Dec  1  2014 /storage/media/Video/TV/Backlog/American Dad!
adam@turian ~ % ls -ld /storage/media/Video/TV/Backlog/American\ Dad\!/Season\ 12 
drwxrwxr-x 2 adam users 137 Jun  2 19:01 /storage/media/Video/TV/Backlog/American Dad!/Season 12
adam@turian ~ % ls -ld /storage/media/Video/TV/Backlog/American\ Dad\!/Season\ 12/American\ Dad\!\ -\ S12E14\ -\ American\ Fung\ -\ HDTV.mp4
-rw-rw-r-- 1 adam users 88M May 25 21:10 /storage/media/Video/TV/Backlog/American Dad!/Season 12/American Dad! - S12E14 - American Fung - HDTV.mp4

As you can see, the users group has FULL access to the files so should be able to delete the file.  I even changed the shell, su'ed over to the emby user and was able to touch a file in that directory.  

 

I also tried changing the ownership of the file to Emby but that didn't work either.  Manual deletion from the command line as myself or as emby works without any issue.

Link to comment
Share on other sites

The system is incorrectly bouncing you to the login screen, and that we can fix, but we can't fix the underlying problem which is this. The server doesn't seem to be authorized to delete those files.

Access to the path "/storage/media/Video/TV/Backlog/American Dad!/Season 12/American Dad! - S12E14 - American Fung - HDTV.mp4" is denied.
    System.UnauthorizedAccessException
Link to comment
Share on other sites

adambot

 

The system is incorrectly bouncing you to the login screen, and that we can fix, but we can't fix the underlying problem which is this. The server doesn't seem to be authorized to delete those files.

Access to the path "/storage/media/Video/TV/Backlog/American Dad!/Season 12/American Dad! - S12E14 - American Fung - HDTV.mp4" is denied.
    System.UnauthorizedAccessException

 

Is there any way to further debug why the deletion is not allowed?

 

[update]

so it turns out that while emby doesn't need to "own" the file, it does need to "own" the directory that the file is in...  very strange...

Edited by adambot
Link to comment
Share on other sites

spootdev

 

The system is incorrectly bouncing you to the login screen, and that we can fix, but we can't fix the underlying problem which is this.

FYI,

 

If you're scanning media and it can't write the nfo/image/etc file to the media directory it will kick you to login screen too with no warning.

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