Unable to delete file on Plex server from Web interface

Server Version#: 1.22.0.4163-d8c4875dd
Player Version#: 4.51.3

My Plex server is running on a Synology NAS. Sometimes I find duplicate files and I attempt to delete them in the Plex Web interface. It fails to do so issuing the totally unhelpful message:

Delete

Is it really too much to ask the programmer to issue a better error message than this? Specifically, DESCRIBE what the problem was when attempting to delete the file?!? Permission denied? File not found? What was the damn problem? I’ve often heard of so called lazy programmers but this is really ridiculous!

You made sure that the “allow media deletion” is checked in Server settings / Library?

That sounds like what happens when Plex is indexing an item when another scan is initiated… or something like that.

Plex Dance those ‘Dual’ items (there’s probably only one physical version) and see if that fixes them:

ALL Steps
IN ORDER
or it simply won’t work.

While I agree the message could be more granular as to the cause of the failure the very first thing I would check would be to ensure the plex user has delete access to your files on your NAS. In my experience 95% of the times folks have errors like this its due to access problems on the files.

Also, take a quick look in the console logs when you try and delete and it will likely give you more information on the cause.

Allow media deletion is on.

1 Like

The Plex user is me. I can delete the file. (actually I just moved the file away, put it back and Plex then figured it out).

The thing is there are times I can delete an item and there are other times where I can’t (yet all files are owned by me).

So, performed the following test. Copied that episode file adding on a “2” just before .mkv. Both files are owned by me with 644 permissions. Back to the web interface and attempt a delete. There was a problem deleting this item. Had a tail -f running on Plex Media Server.log - no message emitted.

chmod 777 on the files. Attempted delete again while monitoring the log file. Same error, file not deleted.

Even tried to change the owner to plex but that didn’t change anything.

The directory and mount points could be a factor here also, not just the single file. I’d recommend running something like the following on your root mount point for your NAS with your media content, just replace /data with your own directory.

find /data -type d -exec chmod 755 {} ;
find /data -type f -exec chmod 644 {} ;

If I may augment?

Set permissions to allow deletion prior to mounting as well as after.

Given the usual desire is for you to retain ownership but allow PMS to read/write/delete ( as defined in Settings - Library )

Directory inheritance (setgid) is usually the tool of choice on Linux.

By adding user plex to your username group, it will have the permissions you assign to the “group” field. If you want delete of files then 664 is appropriate. If want diretories, 775 is appropriate.

Here is a How-To to implement setuid and setgid to automate the addition of media and having it comply with permissions.

Interesting indeed!

So If I understand you properly I should be able to (assume root):

$ cd /volume1
$ chmod g+s Media                         # Setgid on Media directory
$ find Media -type d -exec chmod g+s {} + # Propogate setgid on directories
$ usermod -aG defaria plex                # Add the plex user to the defaria group (welcome to the family!)

And restart the Plex Server? Note, all files and directories under Media are already in the group defaria. The Plex Media Server currently is run by the plex user who is currently only in the users group.

I’m sorry, Is this for Synology (the reference to /volume1 is indicative of Synology)?

If so, you need to do this differently.

Please tell me

  1. UID & GID of your container user
  2. Which UID & GID owns the media on the host
  3. If you are using a Synology as the backing store for the media
  4. How you’re moving media to the storage (Synology)

I ask this because usually the best method is to make a NAS the extension of the Linux host it’s used by (primarily).

Also, on Synology, every Synology-created user account is in group “users” (UID 100).

This is extremely beneficial if you’re trying to grant additional privileges to other hosts & containers – like delete media.

Synology does not like being ‘handled’ at the Linux level. It maintains a permissions database and is ACL driven.

Setting hard UID / GID / perms will break all that and make a mess when trying to access through the native tools on a Synology.

Yes, I have a Synology NAS. The UID & GID of the Plex server processes is plex (1027) and users (100). Note I don’t run Plex in a container. At the time I set up the Plex Server I saw it natively available and said “Cool, I’ll just run that”. Later I got into Docker containers so all of the other things I run are in Docker containers. I thought about switching Plex over to using a Docker container but I have not done that yet. So while Plex is running regular Linux processes as 1027:100, it writes no media files (it does write its database files and other metadata I guess).

All media files are owned by 1000:1000 (where UID 1000 = the user andrew and GID 1000 = the group defaria). I often access the Synology file system (under /volume1) using NFS on my Linux systems. The UID/GID on those systems is likewise 1000 and 1000. So, for example, /volume1/Media/[Videos|Music|Pictures] is mounted to say my desktop as /[Videos|Music|Pictures] via NFS.

Though I have moved things to the Synology by copying them from Linux systems over NFS, primarily the Synology gets its own stuff directly from the net.

Note I do not believe that my user account on the Synology was created using Synology tools. I think I did it the old-fashioned way of creating the account by hand in /etc/passwd, /etc/group, etc. I did this so that my regular Linux user (andrew) would be able to seamlessly access, write, delete files via NFS on the Synology. And I have configured my other containers (though I’m not currently running the Plex server as a Docker container, I do have other Docker containers running) to use UID/GID 1000:1000.

You say that a hand-created account will “make a mess when trying to access to access through the native tools on a Synology”. In general, I tend to say away from “the native tools on a Synology”.

Thanks for your assistance.

If you stay away from the Synology tools (Control Panel: Users, Groups, and Shared Folders) then I wish you the best of luck.

The more I write the packages for , and support Synology, the more quirky I realize they are. They have their view of how their systems should be used and they don’t care about anyone or anything else.

If you do things the Synology way, it will work.
If you buck the system, all bets are off.

The compromise position here is to:

1 Create a group on Synology (Control Panel - Groups )
2. After creating but before using EDIT it to be the GID you need.
3. Back in the Control Panel app, add Plex to that Group.
4. You should now be able to delete

Understood. However, I really do see very little need to use Synology tools. Aside from my one user, I have no need to create Users or Groups or use their Shared Folders app. Similarly for things like their web server and other things. By and large, Plex serves media to people and I access stuff with NFS. If I want to share folders I’ll use NextCloud. Note, I have, however, used their DDNS and Reverse Proxy stuff.

I did the following, which seems to work:

$ sed -i '/^defaria/s/$/plex/' /etc/group
$ find /volume1/Media/{Music,Pictures,Videos} -type d -exec chmod 775 {} +
$ find /volume1/Media/{Music,Pictures,Videos} -type f -exec chmod 664 {} +
$ # Restart Plex server

Restarting the Plex Server was necessary as the processes would not pick up the group change until restarted.

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