Jump to content

Strange File Deletion Permission Problem With Movies In Own Folders


einniv

Recommended Posts

I'm not sure if this is an Emby error or something else but thought I'd get some feedback because it is very weird. 

 

I can't get Emby Metadata Manager to delete certain movies (and only those, as described below), giving the error "There was an error deleting the item from Emby Server. Please check that Emby Server has write access to the media folder and try again."

 

OS: Windows 2008 R2 64-bit

Emby Server: 3.2.70.0

Run Method: All of them (run at user log in, manually run "as administrator", and as a service (both local system and specific user) ). From any user interface I have (web page accessed via lan or server, Kodi Emby Plugin Menu)

Emby Delete Permission: Set on for all libraries

Library: All on locally connected or internal drives

File Permissions: All permission settings are identical on files and folders that work and those that don't. I've checked every level of the file tree. 

File Attributes: Seems to be related to files marked read only, but only some of them! I'll describe below.

Directory Structure: Only seems to happen on movies in their own folder.

 

Behavior and other software: 

My server runs Emby, Sonarr for TV shows, and Radarr for movies. I used to run Couch Potato but don't any more.

 

With Sonarr TV shows go in their own directory and then, generally, in a season folder. (e.g. z:\Video\Tv\Pawn Stars\Season 2017\Pawn Stars.s2017e05.Seven Barreled Pawn.mkv) I can delete episodes just fine and it doesn't matter if the video file is marked read only or not. There are some that are read only and others that aren't and I've even manually set that flag for testing this issue and it makes no difference.

 

With Couch Potato I had movies saving directly to a Movies folder. I also had movies in there from before I used any automated downloader. (e.g. z:\Video\Movies\Alien Covenant (2017).mkv)I can delete movies just fine and it doesn't matter if the video file is marked read only or not. I tested changing the flag on these as well and it makes no difference.

 

Radarr insists on using per movie folders and I just use the same movie folder I already had as the parent folder. In other words it has movies that are both in the main directory and some in their own. (e.g. Z:\Video\Movies\Wonder Woman (2017)\Wonder Woman (2017).mkv). Emby handles that all fine except for this delete problem. Radarr sets the read only attribute on the movie files for some reason. These are the ones I get the error on. Emby deletes all the metadata files just fine but then chokes on the main movie file. If I uncheck the read only attribute then Emby can delete them just fine!

 

To test, I moved one of the movies that was just in the main folder into it's own sub-folder and then checked the read only attribute and the same error occurs.

 

Here's a segment of the log file though it isn't particularly enlightening. It happens no matter what else is going on so I didn't provide the entire log. https://paste2.org/M4Vc5FJc

 
Link to comment
Share on other sites

I should add that TV Shows and Movies are in their own libraries like they are supposed to be. The original post might sound like I've got them all in the same one.

Link to comment
Share on other sites

Hi, we're calling a windows api function to delete a directory recursively and this is actually standard behavior to deny the deletion when files are marked as readonly. Can you configure the other app to not mark the files that way?

Link to comment
Share on other sites

Thanks! I can try to file a bug report with them. We'll see how it goes.

 

At least I know I'm not crazy or blind! I've had this issue for a while now but just recently noticed the read only flag was set. At first I thought that alone must be what it was but then I discovered some episodes that were read only too and that it was more complicated. 

 

Would the issue affect users of Emby that try to delete an entire season when some of the episodes are read only? Or, do you just delete each episode individually? I've never tried it.

 

Anyway, worst case I'll just write a batch file to do the dirty work or something but thanks for letting me know what the issue is!

Link to comment
Share on other sites

Yes it would affect them too. if you delete a single file we go and check the attributes and change the file attributes. But we don't do that recursively when deleting a folder.

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