Unable to delete File - Please check your permissions

I have sent a pre-beta build to 3 of you here via PM - would love to get feedback before this gets released

@sa2000 said:
I have sent a pre-beta build to 3 of you here via PM - would love to get feedback before this gets released

I watched and successfully deleted 12 episodes last night after installing the pre-beta build. So far it looks like the fix is working. I’d like to give it a couple more days to make sure, but I am optimistic. One issue that I did notice was that I am now seeing the ā€œon deckā€ section even though I have had it disabled.

@changelin said:

@sa2000 said:
I have sent a pre-beta build to 3 of you here via PM - would love to get feedback before this gets released

I watched and successfully deleted 12 episodes last night after installing the pre-beta build. So far it looks like the fix is working. I’d like to give it a couple more day to make sure, but I am optimistic. One issue that I did notice was that I am now seeing the ā€œon deckā€ section even though I have had it disabled.

Good news

with the on deck - did you have number of weeks set to zero before ?

if you do have that, the problem is understood and being looked into

@sa2000 said:

Good news

with the on deck - did you have number of weeks set to zero before ?

if you do have that, the problem is understood and being looked into

Yes. I have had it set to zero for years. I’m glad to hear that is being worked on as well. And thank you for not having me send logs for that too. :smiley: :smiley:

@changelin said:

@sa2000 said:

Good news

with the on deck - did you have number of weeks set to zero before ?

if you do have that, the problem is understood and being looked into

Yes. I have had it set to zero for years. I’m glad to hear that is being worked on as well. And thank you for not having me send logs for that too. :smiley: :smiley:

it was an undocumented feature that inadvertently got zapped when a change was made to make sure we do not break if a ridiculous high value entered

Just to follow up. I have had zero deletion issues since I installed the pre-beta.

I watched a bunch of shows and should have encountered a problem deleting a show by now. No problems were encountered so I would recommend moving this change into beta.

The fix for this has now been released to the beta Plex Pass channel

Release 1.12.1.4871-6daee94e2

See Release Notice https://forums.plex.tv/discussion/comment/1633996/#Comment_1633996

  • (Windows) Files could fail to be deleted due to child processes inheriting duplicate handles (#7830)

And thanks for everyone who helped in tracking this bug and also testing the pre-release build

Great news. Many thanks @sa2000 et al B)

Wonderful news indeed.
/farnsworthgoodneweveryone.gif

Great job, sa2000 !

Thanks sa2000 and everyone for working on this. How long does it usually take for the beta to be rolled into an official release?

My server is on the beta channel and running 1.12.1.4871. Unfortunately I still have issues deleting files from within Plex :frowning:

Just checked logs and still seeing ā€œSHFileOperationW returned 0x20 for FO_DELETEā€. I’ve also tried deleting the file manually on the machine itself and it says cannot delete because ā€œthe file is open in Plex Media Serverā€.

@Craig73 said:
Just checked logs and still seeing ā€œSHFileOperationW returned 0x20 for FO_DELETEā€. I’ve also tried deleting the file manually on the machine itself and it says cannot delete because ā€œthe file is open in Plex Media Serverā€.

@Craig73 said:
My server is on the beta channel and running 1.12.1.4871. Unfortunately I still have issues deleting files from within Plex :frowning:

well you know what needs to be done to investigate
May be it is Microsoft Search Indexer, Malwarebytes, on-the-fly-backup-software, …, dropbox syncing

Thanks @sa2000 but actually have no idea :). I presume you need me to pass some logs over. If you could point me in the right direction of what is needed and where to send it I will gladly help. Thanks.

Re your suggestions as to other processes locking the file, I’m puzzled as to why Windows (when I try to delete the file in Explorer) would state that ā€œPlex Media Serverā€ is locking the file if it was a different process? Also, restarting Plex appears to relinquish the lock so again this points strongly to Plex I’d have thought?

Anyone else still having the problem incidentally?

@Craig73 said:
Thanks @sa2000 but actually have no idea :). I presume you need me to pass some logs over. If you could point me in the right direction of what is needed and where to send it I will gladly help. Thanks.

Re your suggestions as to other processes locking the file, I’m puzzled as to why Windows (when I try to delete the file in Explorer) would state that ā€œPlex Media Serverā€ is locking the file if it was a different process? Also, restarting Plex appears to relinquish the lock so again this points strongly to Plex I’d have thought?

Anyone else still having the problem incidentally?

if the file is still being streamed or there is a session in progress then there would be a lock and any process can lock a file and stop other processes deleting it or overwriting it

In case there is a corrupt install, download a fresh copy of Plex Media Server 1.12.1.4871
Shut down Plex Media Server (exit in system tray)
check task manager for any plex processes remaining - should only be one left (the plex update service process)
Run the installer to repair the installation
Launch Plex Media Server

Download this tool OpenedFilesView - View opened/locked files in your system (sharing violation issues) and install / unzip this tool
Run it to familialize yourself with it and selecting all displayed output and exporting to excel

Then with debug logging enabled on the server - see https://support.plex.tv/articles/201643703-reporting-issues-with-plex-media-server/
Restart the server to get fresh logs
Reproduce the problem
Run the OpenedFilesView.exe tool
select all displayed lines (Control and a) and then File / Save All Items and selecting Save as type of Tab delimited text file (*.txt) - give it a filename to save to and zip it

Attach the logs zip and the openedfilesview saved data zip and indication as to when the error arose and what it was

What has happened to this issue? I haven’t encountered it for a while now so I guess it is already fixed?

Hi everyone. Sorry to revive this topic, but I’m having this problem.

I read all the conversation from start to finish.

My considerantios are:

  • I CAN reproduce this anytime I want.

  • If @sa2000 or any other Plex Team Mermber wants I can provide supervised access to my server using TeamViewer to demonstrate the problem.

  • I can do any other test you want me to. I’m a Systems Engineer and I can do advanced investigations or research.

  • It happens to me on Movies type libraries.

  • My Plex logs and Open Files View info can be found here: https://www.dropbox.com/sh/svghuvioykz7uyc/AABxJo4Hp_lU3llaAVE3lj0wa?dl=0

  • It happens to me using Android TV (Shield TV 2017) and Android SmartPhone (Galaxy S9+).

  • It does NOT happen using the Plex Web Client. I CAN delete files without a problem using the web Plex Client. Logs provided for both cases.

  • My PMS Version is Version 1.14.1.5488 as of Nov 26, 2018.

  • I’m running Windows 10 Pro with all updates applied.

  • My client apps are all up to date. If necessary I can provide version numbers.

This now is important as I didn’t see anybody talking about it. To workaround the problem I do the following (This only works on Plex TV - Shield TV):

  • Stop playing the file.
  • Go up 2 levels in client navigation. (So, from Movie Title, I go up to All Movies in my Selected Library, then I go up to Home Screen.
  • Then I navigate back to the Movies Library, and then to the Movie itself.
  • Now I click delete. The file isn’t deleted yet.
  • I click mark as Played/Unplayed.
  • Now it sesms that the app crashes because it is like the App is loading itself again.
  • If I go to the movie and try to delete, now it deletes fine and I’m moved from the Movie screen to the Movies Library listing.

I provided log to this procedure too.

[EDIT}
I made a video showing how the workaround actually works: https://youtu.be/5DXcRBKCsKw

Hope I hear of you soon.

Best regards,

Dart

Sorry I have just got to your post in my backlog. I will respond to your other topic as you have updated it more recently

(So far it looks like it is the Plex for Android app that is not releasing the stream) . I will respond here Delete media fail: SHFileOperationW returned 0x20 - Falling back to deleting file