Delete media fail: SHFileOperationW returned 0x20 - Falling back to deleting file

Server Version#: 1.14.1.5488 - Windows 10 Pro
Player Version#: 7.9.0.8439 - Android Mobile (Galaxy S9+) and Android TV (Shield TV)
Logs: https://www.dropbox.com/sh/svghuvioykz7uyc/AABxJo4Hp_lU3llaAVE3lj0wa?dl=0
Video demonstrating client problem: https://youtu.be/5DXcRBKCsKw

Short explanation: When I try to delete media, after watching it, I click delete and nothing happens.

  • Permissions are set correctly on PMS.
  • Files and folders have “everyone” full control on NTFS drives.
  • It does NOT happen using the Plex Web Client. I CAN delete files without a problem using the web Plex Client.
  • I’m running PMS as a service using PMS Service 1.1.7.0 (https://github.com/cjmurph/PmsService).
  • The problem occurs exactly the same even if I run Plex directly (instead of as a service), as a normal user.

Other considerantios are:

  • I CAN reproduce this anytime I want. It’s not a ramdom or intermitent problem.
  • It happens with any video file type or container (MKV, MP4, etc.)
  • It happens with media with or without subtitles.
  • If any 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.

To workaround the problem I do the following (This only works on Plex TV - Shield TV. It does not work on Android Mobile Client):

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

I made a video showing what happens and how the workaround actually works: https://youtu.be/5DXcRBKCsKw

Best regards,

Dart

Really?? I’m the only one having this issue?

Funny I had to search to find this. What I see is you can’t delete the file until you play something else. The reason you are able to in your video is you crashed the player. Very annoying behavior for sure. You know it is going to happen when you see the “Talking to server” message pop-up. Pretty sure this was present maybe a year ago, then went away, not it’s back.

My Server is always up to date! So are my client apps (mostly on Android).

And the problem continues.

I urge somenone at Plex to take a look at this, please!

Plex, any acknowledgement of this issue? This is getting old dealing with this bug.

I formated my pc and reinstalled plex from backup.

My problem is gone now.

Pretty sure it will come back. How do you store your video? Mine are on a two disk raid 1 array. If I copy the data off, format, then copy data back the problem goes away for awhile.

Most of my media sits on regular HD’s, no array or anything. Single partition in the drives. No matter witch drive, the problem happened.

I have tried to reproduce it on Windows 10 and Server 2016, with Plex media stored on a single partition, RAIDed partition, Windows storage, as well as SAS storage array. I am unable to reproduce the issue under any scenario. Media deletion works just fine.

I assume you have verified hard drive for errors?

Sure. No bad blocks or anything. After reinstall of Win10 and Plex, all is normal. The media never moved from the drives they were in the first place.

Sorry i have only just got to your problem which i had in my list for this post bookmarked on this post Unable to delete File - Please check your permissions

I will respond with details here as you have been updating this thread more recently

@DartVeiga what i found so far is that the Plex for Android app has Direct Play download request connections in progress when you were attempting the deletes.

Only when the following happens and the requests are closed would the delete succeed

Example

Dec 26, 2018 23:28:15.397 [19784] DEBUG - Failed to stream media, client probably disconnected after 90554368 bytes: 10054 - An existing connection was forcibly closed by the remote host

Dec 26, 2018 23:28:15.397 [19784] DEBUG - Completed: [192.168.1.30:41944] 200 GET /library/parts/54455/1544638339/file.mkv?autoAdjustQuality=0&hasMDE=1&location=lan&mediaBufferSize=74944 (26 live) TLS 29169ms 90554368 bytes (range: bytes=5573-)

So probably will need to get plex app logs to go with your excellent diagnostics and the steps that are resulting for the playback Direct Play requests not to terminate tidily by the mobile app before you are attempting the delete the movie

This actually relates to the specific delete that you got the extra diagnostics for (the evidence i looked at is the one on the post i linked earlier)

Dec 26, 2018 22:57:02.597 [19960] DEBUG - Request: [192.168.1.130:44612 (Allowed Network)] DELETE /library/metadata/52849 (23 live) TLS GZIP Signed-in Token (DartVeiga)
Dec 26, 2018 22:57:03.614 [19960] ERROR - SHFileOperationW returned 0x20 for FO_DELETE on '"P:\UFC\Shane.Burgos x Kurt.Holobaugh.720p.WEB-DL.x264-3N10.mkv"'. Falling back to deleting file.
Dec 26, 2018 22:57:03.615 [15824] DEBUG - Completed: [192.168.1.130:44612] 400 DELETE /library/metadata/52849 (23 live) TLS GZIP 1018ms 384 bytes (pipelined: 9)

Dec 26, 2018 23:02:28.387 [15824] DEBUG - Failed to stream media, client probably disconnected after 868352 bytes: 10054 - An existing connection was forcibly closed by the remote host
Dec 26, 2018 23:02:28.387 [15824] DEBUG - Completed: [192.168.1.130:44608] 200 GET /library/parts/54454/indexes/sd/94680 (14 live) TLS GZIP 381713ms 868352 bytes (pipelined: 1)

Dec 26, 2018 23:02:28.387 [19784] DEBUG - Failed to stream media, client probably disconnected after 868352 bytes: 10054 - An existing connection was forcibly closed by the remote host
Dec 26, 2018 23:02:28.387 [19784] DEBUG - Completed: [192.168.1.130:44610] 200 GET /library/parts/54454/indexes/sd/94991 (13 live) TLS GZIP 382185ms 868352 bytes (pipelined: 1)

Dec 26, 2018 23:07:34.781 [1768] DEBUG - Request: [127.0.0.1:56689 (Loopback)] DELETE /library/metadata/52849 (30 live) GZIP Signed-in Token (DartVeiga)

Dec 26, 2018 23:07:34.835 [1768] DEBUG - Deleting media item 53820.
Dec 26, 2018 23:07:34.835 [1768] DEBUG - Was connected to metadata item 52849, count is now 0.
Dec 26, 2018 23:07:34.836 [1768] DEBUG - Destroying metadata item 52849 (Shane Burgos X Kurt Holobaugh Web Dl)
Dec 26, 2018 23:07:34.837 [1768] VERBOSE - BPQ: onLibrarySectionChanged for library section 14: ItemsDeleted
Dec 26, 2018 23:07:34.837 [1768] VERBOSE - BPQ: onLibraryChanged callback already scheduled at 2018-12-26 23:07:16
Dec 26, 2018 23:07:34.860 [15824] DEBUG - Completed: [127.0.0.1:56689] 200 DELETE /library/metadata/52849 (30 live) GZIP 78ms 268 bytes (pipelined: 4)

So this was on Galaxy S9+
The delete only succeeded once the DP request connection was aborted and the download stream closed down

You see, I had to reinstall my server for other reasons, and then I reinstalled my Plex Server.

After that, the problem stoped, even though I did NOT make any changes in my client apps. I’m still using my Galaxy S9+ and my NVidia Shields. In booth of them I can now delete media files without a problem.

If the bug returns and I can reproduce it, I’ll come back to this.

Thank you for your support and hope we can help others with this.

Thank you for the feedback - maybe the server behaviour changed and it now closes the stream on getting the stopped state rather than wait for the client app

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.