Having issues with Empty Trash

I have installed Plex Media Server on Ubuntu 22.04 recently. It is working fine except for the “Empty Trash”. The movie won’t remove from the library after being deleted from the hard disk. It shows “Unavailable” instead of showing the “Garbage” icon. I’ve tried automatic and manual processes, but all in vain. I have reinstalled the server, but the issue still exists.

Here are the folder permissions -

ronnie@Skynet:/var/lib/plexmediaserver/Library/Application Support/Plex Media Server$ ls -l
total 48
drwxr-xr-x 6 plex plex 4096 Oct 24 11:07  Cache
drwxr-xr-x 3 plex plex 4096 Oct 24 10:17  Codecs
drwxr-xr-x 3 plex plex 4096 Oct 24 10:17 'Crash Reports'
drwxr-xr-x 2 plex plex 4096 Oct 24 10:17  Drivers
drwxr-xr-x 3 plex plex 4096 Oct 24 10:32  Logs
drwxr-xr-x 3 plex plex 4096 Oct 24 10:32  Media
drwxr-xr-x 3 plex plex 4096 Oct 24 10:32  Metadata
-rw-r--r-- 1 plex plex    3 Oct 24 10:24  plexmediaserver.pid
drwxr-xr-x 2 plex plex 4096 Oct 24 10:17  Plug-ins
drwxr-xr-x 7 plex plex 4096 Oct 24 10:17 'Plug-in Support'
-rw------- 1 plex plex  736 Oct 24 10:33  Preferences.xml
drwxr-xr-x 2 plex plex 4096 Oct 24 10:17  Updates

ronnie@Skynet:~$ ls -l /mnt/disk1/plexmedia/
total 4
drwxr-xr-x 2 ronnie ronnie 4096 Oct 24 10:33 movies

Here is the server log -
Plex Media Server.zip (38.3 KB)

I’m very much new to the Linux environment. I can’t figure out what went wrong. Any insight would be very much helpful.

Would it be possible for you to

  1. Try to access the file through plex so it shows up in the logs
  2. Include all the logs ? ( nothing showed up in the log file you provided )
    Settings - Server - Troubleshooting - Download Logs

Sure, here it is.
Plex Media Server Logs_2022-10-24_21-13-03.zip (247.2 KB)

You have very very little activity

Oct 24, 2022 10:33:36.547 [0x7fb051050b38] DEBUG - Library timeline cull complete with 8 items left.
Oct 24, 2022 10:33:36.547 [0x7fb051050b38] DEBUG - Scanning Movies using en-US(Plex Movie) with 1 current media items and 1 section locations in the database.
Oct 24, 2022 10:33:36.547 [0x7fb051050b38] DEBUG - Performing a scan with 'Plex Movie' (language: en-US virtual: 0).
Oct 24, 2022 10:33:36.547 [0x7fb051050b38] DEBUG -   * Scanning /mnt/disk1/plexmedia/movies
Oct 24, 2022 10:33:36.547 [0x7fb051050b38] DEBUG -   * Marking media not available in /mnt/disk1/plexmedia/movies
Oct 24, 2022 10:33:36.547 [0x7fb051050b38] DEBUG -   * Taking 1 items out of the map (which has 1 items) for being unavailable.
Oct 24, 2022 10:33:36.547 [0x7fb051050b38] DEBUG -   * Taking 1 directories out of the map (which has 2 dirs) for being unavailable.
Oct 24, 2022 10:33:36.547 [0x7fb051050b38] DEBUG -     * Taking directory 'Blitz.2011.1080p.BluRay.H264.AAC-RARBG' (2) out of map.
Oct 24, 2022 10:33:36.547 [0x7fb051050b38] DEBUG -     * Taking parent directory '' (1) out of map.
Oct 24, 2022 10:33:36.548 [0x7fb051050b38] DEBUG - Activity: updated activity 1828c5dc-7446-4b17-8b0e-fbdb36900ab3 - completed 99.0% - Scanning Movies
Oct 24, 2022 10:33:36.548 [0x7fb051050b38] DEBUG - Scanner [Plex Movie]: Idle and left with 1 media items.
Oct 24, 2022 10:33:36.548 [0x7fb051050b38] DEBUG - Removing 0 media items that were left.

This is the only clue of incorrect permissions making the movie unavailable.

Oct 24, 2022 10:33:36.547 [0x7fb051050b38] DEBUG -     * Taking directory 'Blitz.2011.1080p.BluRay.H264.AAC-RARBG' (2) out of map.
Oct 24, 2022 10:33:36.547 [0x7fb051050b38] DEBUG -     * Taking parent directory '' (1) out of map.

Make certain to have rx for /mnt, /mnt/disk1, /mnt/disk1/plexmedia and lastly, /mnt/disk1/plexmedia/movies in the “world” field (right-most permissions group)

I just checked the permissions.

ronnie@Skynet:~$ ls -l /
total 2097232
lrwxrwxrwx   1 root root          7 Oct 23 05:17 bin -> usr/bin
drwxr-xr-x   4 root root       4096 Oct 23 09:37 boot
drwxrwxr-x   2 root root       4096 Oct 23 05:22 cdrom
drwxr-xr-x  19 root root       4280 Oct 24 21:08 dev
drwxr-xr-x 129 root root      12288 Oct 24 10:17 etc
drwxr-xr-x   3 root root       4096 Oct 23 05:23 home
lrwxrwxrwx   1 root root          7 Oct 23 05:17 lib -> usr/lib
lrwxrwxrwx   1 root root          9 Oct 23 05:17 lib32 -> usr/lib32
lrwxrwxrwx   1 root root          9 Oct 23 05:17 lib64 -> usr/lib64
lrwxrwxrwx   1 root root         10 Oct 23 05:17 libx32 -> usr/libx32
drwx------   2 root root      16384 Oct 23 05:16 lost+found
drwxr-xr-x   4 root root       4096 Oct 23 23:13 media
drwxr-xr-x   3 root root       4096 Oct 23 10:25 mnt
drwxr-xr-x   2 root root       4096 Aug  9 17:18 opt
dr-xr-xr-x 276 root root          0 Oct 24 21:07 proc
drwx------   6 root root       4096 Oct 24 01:23 root
drwxr-xr-x  36 root root        960 Oct 24 21:08 run
lrwxrwxrwx   1 root root          8 Oct 23 05:17 sbin -> usr/sbin
drwxr-xr-x  11 root root       4096 Aug  9 17:25 snap
drwxr-xr-x   2 root root       4096 Aug  9 17:18 srv
-rw-------   1 root root 2147483648 Oct 23 05:17 swapfile
dr-xr-xr-x  13 root root          0 Oct 24 21:07 sys
drwxrwxrwt  22 root root       4096 Oct 24 21:13 tmp
drwxr-xr-x  15 root root       4096 Oct 23 10:19 usr
drwxr-xr-x  15 root root       4096 Oct 23 10:19 var
ronnie@Skynet:~$ ls -l /mnt
total 4
drwxr-xr-x 5 ronnie ronnie 4096 Oct 24 03:07 disk1
ronnie@Skynet:~$ ls -l /mnt/disk1
total 20
drwxr-xr-x 2 ronnie root   16384 Oct 23 23:22 lost+found
drwxr-xr-x 3 ronnie ronnie  4096 Oct 24 10:20 plexmedia
ronnie@Skynet:~$ ls -l /mnt/disk1/plexmedia
total 4
drwxr-xr-x 2 ronnie ronnie 4096 Oct 24 10:33 movies

All have rx in the “world” field.

Did you also check the permissions all the way down and into the movie directory which your log shows being removed?

If this is a remote/network mount, can you also confirm permissions on the distal end?

A little update.
I added another movie and scanned it. This time the poster of the previous movie ‘Blitz’ shows the ‘Garbage’ icon. To be sure I deleted the second movie and scanned it again, but the poster of the second movie doesn’t show the “garbage” icon like before but shows “unavailable” when clicked.

Here is the latest log.
Plex Media Server Logs_2022-10-24_22-12-03.zip (283.6 KB)

Did you also check the permissions all the way down and into the movie directory which your log shows being removed

‘movie’ directory is the last directory.
Here are my folder structure

/mnt/disk1/plexmedia/movies
    40.Days.And.40.Nights.2002
    Blitz.2011 

I checked the permissions of the movie also. All have rx in the world field.

If this is a remote/network mount, can you also confirm permissions on the distal end?

No. It is a second hard drive and is connected to the motherboard via a sata cable.

Scan files won’t clear the condition?

When you hover over the media, does the path shown match the current path?

Would you consider a PlexDance of the media file?
(move away, scan, empty trash, clean bundles, move back, scan again)

I’m not sure if the issue is in the DB or the filesystem

No

After deleting the files, I scanned the library, emptied the trash, and cleaned the bundles. But the movie is still there. I even deleted the root folder (movies), but the movie is still there with marked “unavailable”


This is the second time I install the server, but each time I have had the same issue.

If you delete the root folder, PMS will never delete the media.
(this is deliberate to protect against external HDDs being unplugged and entire libraries being removed by accident).

Put the media folder back in place
-OR-
Remove the media folder from the list of folders (best choice)

Now scan, empty, and clean bundles.

Sorry, By root folder I mean media folder which contains the movies folder.

Ok, I delete the library and create a new one. Add the movie to the library> delete it from the hard disk>scan it>empt trash>clean bundles>movie is still there

Let’s create a test PMS but save everything you’ve done.

  1. Sign out of Plex/web
  2. Stop PMS
  3. In a terminal window
sudo bash
cd /var/lib/plexmediaserver
mv Library  Library.save
  1. Start PMS
  2. Close the web browser
  3. Open an incognito browser window
  4. Open the server by IP address (loopback or LAN)
  5. Create a new server – HOWEVER
    – Give it a TEST name so we won’t conflict with your main server
    – Add only one media library
    – Use the directory path which contains the one media file which causes you trouble.
    – 4. Let it scan and complete normally.
  6. When complete
  7. Download the logs ZIP file
  8. Attach here for me to review.

If this recreates & captures your error, then I’ll make arrangements with you to get your databases

Here is the server log of the new test server.
Plex Media Server Logs_2022-10-25_03-33-54.zip (141.1 KB)

PMS is working fine according to your logs.

I looked at your account.

  1. The servers Z*** and X****** had questionable certificates. I reset them. Please restart them when convenient.

  2. You show both Linux and Windows servers from the same IP. Is the Linux server in a VM?

PMS is working fine. The actual problem is the movies are not deleted from the library even though they are deleted from the hard disk. I didn’t delete the movie from the disk as you did not mention it in the comment.

here is the log after deleting the movie.
Plex Media Server Logs_2022-10-25_04-13-23.zip (177.3 KB)

No. They are two different PCs. Windows PC is my main server and this is my test PC. I use it for learning Linux and Docker.

Thanks for confirming two different machines.

This bothers me. There is a certificate mismatch where none should exist.

Oct 25, 2022 03:34:10.256 [0x7fd780328b38] DEBUG - Completed: [127.0.0.1:44984] 401 GET / (7 live) GZIP 0ms 552 bytes
Oct 25, 2022 03:34:10.613 [0x7fd780328b38] WARN - [CERT] TLS connection from [::ffff:192.168.0.11]:44110 came in with unrecognized plex.direct SNI name '192-168-0-11.5326e3a3314040ea9650d2d113cb2438.plex.direct'; using installed plex.direct cert
Oct 25, 2022 03:34:10.619 [0x7fd780328b38] DEBUG - CERT: incomplete TLS handshake from [::ffff:192.168.0.11]:44110: sslv3 alert bad certificate
Oct 25, 2022 03:34:10.633 [0x7fd77921db38] DEBUG - Request: [192.168.0.11:47030 (Subnet)] GET /media/providers (7 live) #459 GZIP Signed-in Token (sloke123) (Firefox)

Have all involved browsers been restarted?
Unrecognized SNI will occur if one browser still has the production server cached but connecting to the TEST server.

Sorry. I didn’t restart the browser. I didn’t know it could cause problems. I have restarted the browser now.

Here is the new log after restarting the browser(incognito mode).
Plex Media Server Logs_2022-10-25_04-30-50.zip (200.9 KB)

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