Plex not deleting tmp folder for Video Chapter Thumbnails

Server Version#: 1.41.3.9232

I enabled Video Chapter Thumbnails and set up the scheduled maintenance to run 23 hours a day. After running this for a while, when checking the Media folder for a specific hash, I could see the Indexes bif file generated, but also the tmp file remained with 322 temporary jpg files, starting with img-000051.jpg. I then checked a variety of other hashes and noticed this was true of all of the files that had chapter thumbnails generated, with all of the leftover files starting with the 51st jpg. I then deleted all tmp folders within my Media directory, resulting in the size of that media folder being cut in half. Earlier each subdirectory (0, 1, 2, etc.) was close to 40gb, now they are at 20gb, meaning these tmp files were eating up a ton of unnecessary space (20gb extra * 16 folders means I cleaned up 320gb of tmp files).

Initially I thought it was because I was seeing lines in the logs where the Butler was being interrupted when doing this task when new media was being scanned during that 23 hour window. When that happened, it would stop generating more preview thumbnails to handle the new media, and I would have to restart the server to kick off the generation again. However, I analyzed a single file, checked the hash, and saw that it had failed to properly clean up the tmp folder again.

I enabled debug logging but don’t really see any useful information for the cleanup task, sharing the relevant snippet below

Plex Server Version: 1.41.3.9232

Nov 29, 2024 08:59:41.806 [140445139909432] DEBUG - [Req#1d5/BaseIndexFrameFileManager] Activity: registered new activity 9db9f0ad-9c8b-4447-89ef-d305703a2c78 - "Generating video preview thumbnails"
Nov 29, 2024 08:59:41.807 [140445139909432] DEBUG - [Req#1d5/BaseIndexFrameFileManager/JobRunner] Job running: FFMPEG_EXTERNAL_LIBS='/config/Library/Application\ Support/Plex\ Media\ Server/Codecs/e613bce-38cf5cd1fd57f37d2412c608-linux-x86_64/' X_PLEX_TOKEN=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx "/usr/lib/plexmediaserver/Plex Transcoder" -codec:v h264 -skip_frame:v nokey -i '/mnt/media/Anime/Akame ga Kill! (2014) {imdb-tt3742982}/Season 01/Akame ga Kill! (2014) - S01E02 (002) - Kill Authority [Bluray-1080p] [10bit] [x264] [FLAC 5.1] [EN+JA].mkv' -threads 0 -nostats -q 3 -loglevel quiet -filter_complex "[0:V:0] fps=fps=0.500000:round=up,scale=w=320:h=240:force_original_aspect_ratio=decrease [out]" -map "[out]" "/config/Library/Application Support/Plex Media Server/Media/localhost/1/8c04a036bad771a9ff92ef633833e51e472ff72.bundle/Contents/Indexes/tmp/img-%06d.jpg" -progressurl http://127.0.0.1:32400/video/:/transcode/session/bif/9db9f0ad-9c8b-4447-89ef-d305703a2c78/progress
Nov 29, 2024 08:59:41.807 [140445139909432] DEBUG - [Req#1d5/BaseIndexFrameFileManager/JobRunner] In directory: "/config/Library/Application Support/Plex Media Server/Media/localhost/1/8c04a036bad771a9ff92ef633833e51e472ff72.bundle/Contents/Indexes"
Nov 29, 2024 08:59:41.808 [140445139909432] DEBUG - [Req#1d5/BaseIndexFrameFileManager/JobRunner] Jobs: Starting child process with pid 549
Nov 29, 2024 08:59:41.808 [140445169412920] DEBUG - There were 1 top-level paths for Akame ga Kill!.
Nov 29, 2024 09:03:25.018 [140445169412920] DEBUG - [Req#f9b/Transcode/bif/9db9f0ad-9c8b-4447-89ef-d305703a2c78] Activity: updated activity 9db9f0ad-9c8b-4447-89ef-d305703a2c78 - completed 100.0% - Generating video preview thumbnails
Nov 29, 2024 09:03:25.083 [140445222181688] DEBUG - Jobs: '/usr/lib/plexmediaserver/Plex Transcoder' exit code for process 549 is 0 (success)
Nov 29, 2024 09:03:27.139 [140445163187000] DEBUG - Request: [172.20.0.26:36528 (Subnet)] GET /library/sections (7 live) #f6d GZIP Signed-in Token
Nov 29, 2024 09:03:27.141 [140445211962168] DEBUG - Completed: [172.20.0.26:36528] 200 GET /library/sections (7 live) #f6d GZIP 2ms 1112 bytes (pipelined: 1)
Nov 29, 2024 09:03:27.867 [140445169412920] DEBUG - Request: [127.0.0.1:49646 (Loopback)] GET /identity (8 live) #fa8 Signed-in
Nov 29, 2024 09:03:27.867 [140445211962168] DEBUG - Completed: [127.0.0.1:49646] 200 GET /identity (8 live) #fa8 0ms 417 bytes (pipelined: 1)
Nov 29, 2024 09:03:29.308 [140445105236792] DEBUG - Request: [172.20.0.1:49648 (Subnet)] GET /clients (8 live) #faa TLS GZIP Signed-in Token
Nov 29, 2024 09:03:29.309 [140445211962168] DEBUG - Completed: [172.20.0.1:49648] 200 GET /clients (8 live) #faa TLS GZIP 0ms 397 bytes (pipelined: 1)
Nov 29, 2024 09:03:32.932 [140445163187000] DEBUG - Request: [127.0.0.1:56696 (Loopback)] GET /identity (9 live) #fad Signed-in
Nov 29, 2024 09:03:32.932 [140445211962168] DEBUG - Completed: [127.0.0.1:56696] 200 GET /identity (9 live) #fad 0ms 417 bytes (pipelined: 1)
Nov 29, 2024 09:03:35.105 [140445209852728] DEBUG - Request: didn't get any data from 172.20.0.41:41122: End of file
Nov 29, 2024 09:03:37.096 [140445139909432] DEBUG - [Req#1d5/BaseIndexFrameFileManager] Activity: Ended activity 9db9f0ad-9c8b-4447-89ef-d305703a2c78.

Bumping since I posted during the Thanksgiving break in case anyone has noticed the same behavior/can reproduce it or help me troubleshoot it

Bumping once more for visibility since this issue still seems unresolved. I asked a handful of people to share if they had tmp files leftover if they were running video preview thumbnail generation, and the results varied. I saw people who had thousands of the tmp folders but no jpg images, people who had the tmp jpg images, people who had no tmp files, and it seems like there are people who have leftover tmp bif files as well ( Video preview thumbnail generation leaves behind temp BIF files - Plex Media Server / Desktops & Laptops - Plex Forum). Not entirely sure what’s going on, but seems like the cleanup is prone to failing in certain situations

I’m having the exact same issue. My appdata directory has been stuffed full with this issue. My plex appdata has exceeded 1.5T of data which is a bit much.

I’m on mobile most of the time so not much use to get much in the way of logs. But from what I’m able to hunt down my issue is very very similar.

I figured out why it is happening in my case at least. I mount these folders from a different drive into my Docker container since that has a lot more space. This drive is a lot slower than where the rest of Plex’s data is stored. When I mounted my normal Plex data folder for these previews, the temp files were cleaned properly.

It seems like maybe disk I/O might be impacting the cleanup of these temporary files?

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