Hoping for help with DB corruption

Drives are all local and set to never spin down in Unraid.

edit: Even if a drive was spun down, shouldn’t any normal drive just spin right back up?

You’ve got some serious slowdowns going on.

Mar 22, 2021 16:19:39.646 [0x14abef202640] DEBUG - Auth: authenticated user 1 as fly
Mar 22, 2021 16:19:39.646 [0x14ab971f8640] DEBUG - Request: [192.168.1.120:59615 (Subnet)] GET /library/sections (26 live) TLS GZIP Signed-in Token (fly)
Mar 22, 2021 16:19:39.648 [0x14abef202640] DEBUG - Completed: [192.168.1.120:59615] 200 GET /library/sections (26 live) TLS GZIP 1ms 1081 bytes (pipelined: 6)
Mar 22, 2021 16:19:39.671 [0x14ab975fa640] WARN - SLOW QUERY: It took 1350.000000 ms to retrieve 17 items.
Mar 22, 2021 16:19:39.671 [0x14ab975fa640] DEBUG - PlayQueue: Start index: 0 End index: 17 Count: 18
Mar 22, 2021 16:19:39.671 [0x14ab975fa640] DEBUG - PlayQueue: 18 generated IDs compressed down to a 69 byte blob.
Mar 22, 2021 16:19:39.675 [0x14ab975fa640] DEBUG - PlayQueue: Added 18 items in 0.0 sec.

13.5 seconds to pull 17 records from the DB tells me and one of the following:

  1. The database is fragmented very badly (needs Optimize Database)
  2. Disk i/o overload
  3. The CPU is very over loaded and can’t transcode even a little MP4 in time.

Let’s start with the database first then restart PMS.

I just did an optimize yesterday. And the server was restarted again right before I pulled those most recent logs.

edit: Also I’m using hardware transcoding. But as a troubleshooting step, I turned it off last night. That did not seem to help.

Your logs show:

Hands of God [WEBDL-720p][8bit][h264][AC3 5.1]-BTN.mkv
Mar 22, 2021 16:19:42.431 [0x14ab975fa640] DEBUG - [Transcode] TPU: hardware transcoding: final decoder: , final encoder: 
Mar 22, 2021 16:19:42.433 [0x14ab975fa640] DEBUG - [Transcode/JobRunner] Job running: FFMPEG_EXTERNAL_LIBS='/config/Plex\ Media\ Server/Codecs/73e06c8-3759-linux-x86_64/' X_PLEX_TOKEN=xxxxxxxxxxxxxxxxxxxxK' '/usr/lib/plexmediaserver/Plex Transcoder' '-codec:0' 'h264' '-codec:1' 'ac3' '-ss' '0' '-noaccurate_seek' '-analyzeduration' '20000000' '-probesize' '20000000' '-i' '/media/TV/Black Jesus (2014)/Season 02/Black Jesus (2014) - S02E04 - Hands of God [WEBDL-720p][8bit][h264][AC3 5.1]-BTN.mkv' '-map' '0:0' '-metadata:s:0' 'language=eng' '-codec:0' 'copy' '-filter_complex' '[0:1] aresample=async=1:ocl='\''stereo'\'':rematrix_maxval=0.000000dB:osr=48000[0]' '-map' '[0]' '-metadata:s:1' 'language=eng' '-codec:1' 'aac' '-b:1' '256k' '-f' 'dash' '-seg_duration' '5' '-init_seg_name' 'init-stream$RepresentationID$.m4s' '-media_seg_name' 'chunk-stream$RepresentationID$-$Number%05d$.m4s' '-window_size' '5' '-delete_removed' 'false' '-skip_to_segment' '1' '-time_delta' '0.0625' '-manifest_name' 'http://127.0.0.1:32400/video/:/transcode/session/zujpqozpsdpvjb295qioln8n/3ba8d0be-0714-40ad-8198-26325893a1e1/manifest?X-Plex-Http-Pipeline=infinite' '-avoid_negative_ts' 'disabled' '-map_metadata' '-1' '-map_chapters' '-1' 'dash' '-start_at_zero' '-copyts' '-vsync' 'cfr' '-y' '-nostats' '-loglevel' 'quiet' '-loglevel_plex' 'error' '-progressurl' 'http://127.0.0.1:32400/video/:/transcode/session/zujpqozpsdpvjb295qioln8n/3ba8d0be-0714-40ad-8198-26325893a1e1/progress'

The CPU does not have native QSV support.

I’m using nVidia GPU hw transcoding.

If you’re turning the nvidia off, which I didn’t know you have and use, then everything we just did is for naught.

I would like to see it fail under normal circumstances – how you use it.

Can we repeat please with the Nvidia enabled?

I believe that I had it enabled when I posted the previous logs, but just in case, here are new logs where I’m positive the GPU is enabled.

https://1drv.ms/u/s!AtdKjV47ADPOkF2e9osmMaFuFgS_?e=JSRmqY

@fly

Thanks for redoing that.

  1. I’m seeing the transcoding enable.
  2. I’m then seeing it play on a “PlayStation” ?
  3. I then see playback stopped.

Did it play correctly or did you stop it?

Mar 22, 2021 18:04:21.124 [0x1458d61f0640] DEBUG - [Transcode/1hn3eoz2ilgpn9410x42ehuv] TPU: hardware transcoding: final decoder: nvdec, final encoder: nvenc
Mar 22, 2021 18:04:21.126 [0x1458d61f0640] DEBUG - [Transcode/1hn3eoz2ilgpn9410x42ehuv/JobRunner] Job running: EAE_ROOT='/config/transcode/pms-a9f067c8-bf29-4721-84ec-1ccdb1972caf/EasyAudioEncoder' FFMPEG_EXTERNAL_LIBS='/config/Plex\ Media\ Server/Codecs/73e06c8-3759-linux-x86_64/' X_PLEX_TOKEN=xxxxxxxxxxxxxxxxxxxxK' '/usr/lib/plexmediaserver/Plex Transcoder' '-codec:0' 'h264' '-hwaccel:0' 'nvdec' '-hwaccel_fallback_threshold:0' '10' '-hwaccel_output_format:0' 'cuda' '-hwaccel_device:0' 'cuda' '-codec:1' 'eac3_eae' '-eae_prefix:1' '1hn3eoz2ilgpn9410x42ehuv_' '-analyzeduration' '20000000' '-probesize' '20000000' '-i' '/media/Movies/Trolls World Tour (2020)/Trolls World Tour (2020) WEBDL-720p - TEPES.mkv' '-filter_complex' '[0:0]hwupload[0];[0]scale_cuda=w=1280:h=544:format=nv12[1]' '-map' '[1]' '-codec:0' 'h264_nvenc' '-b:0' '2526k' '-maxrate:0' '3368k' '-bufsize:0' '6736k' '-forced-idr:0' '1' '-r:0' '23.975999999999999' '-force_key_frames:0' 'expr:gte(t,n_forced*5)' '-filter_complex' '[0:1] aresample=async=1:ocl='\''5.1'\'':rematrix_maxval=0.000000dB:osr=48000[2]' '-map' '[2]' '-metadata:s:1' 'language=eng' '-codec:1' 'aac' '-strict:1' 'experimental' '-aac_coder:1' 'fast' '-q:1' '0' '-segment_format' 'mpegts' '-f' 'ssegment' '-individual_header_trailer' '0' '-segment_time' '5' '-segment_start_number' '0' '-segment_copyts' '1' '-segment_time_delta' '0.0625' '-segment_list' 'http://127.0.0.1:32400/video/:/transcode/session/1hn3eoz2ilgpn9410x42ehuv/87f537c7-0b32-4b56-9fe5-e97130ea7c77/seglist?X-Plex-Http-Pipeline=infinite' '-segment_list_type' 'csv' '-segment_list_size' '5' '-segment_list_separate_stream_times' '1' '-segment_list_unfinished' '1' '-max_delay' '5000000' '-avoid_negative_ts' 'disabled' '-map_metadata' '-1' '-map_chapters' '-1' 'media-%05d.ts' '-start_at_zero' '-copyts' '-vsync' 'cfr' '-init_hw_device' 'cuda=cuda:' '-filter_hw_device' 'cuda' '-y' '-nostats' '-loglevel' 'quiet' '-loglevel_plex' 'error' '-progressurl' 'http://127.0.0.1:32400/video/:/transcode/session/1hn3eoz2ilgpn9410x42ehuv/87f537c7-0b32-4b56-9fe5-e97130ea7c77/progress'
Mar 22, 2021 18:04:21.127 [0x1458d61f0640] DEBUG - [Transcode/1hn3eoz2ilgpn9410x42ehuv/JobRunner] Jobs: Starting child process with pid 435
Mar 22, 2021 18:04:21.127 [0x1458d61f0640] DEBUG - [Transcode/1hn3eoz2ilgpn9410x42ehuv] Started session successfully: 1hn3eoz2ilgpn9410x42ehuv
Mar 22, 2021 18:04:21.127 [0x14592e50e640] DEBUG - [Transcode/1hn3eoz2ilgpn9410x42ehuv] Streaming Resource: Resetting play progress due to seek
Mar 22, 2021 18:04:21.134 [0x1458d63f1640] DEBUG - Request: [127.0.0.1:33988 (Loopback)] PUT /video/:/transcode/session/1hn3eoz2ilgpn9410x42ehuv/87f537c7-0b32-4b56-9fe5-e97130ea7c77/progress?status=startup (43 live) Signed-in Token (fly) (range: bytes=0-) 
Mar 22, 2021 18:04:21.134 [0x14592f796640] DEBUG - Completed: [127.0.0.1:33988] 204 PUT /video/:/transcode/session/1hn3eoz2ilgpn9410x42ehuv/87f537c7-0b32-4b56-9fe5-e97130ea7c77/progress?status=startup (43 live) 0ms 203 bytes (pipelined: 1) (range: bytes=0-) 
Mar 22, 2021 18:04:21.159 [0x14592f997640] DEBUG - Auth: authenticated user 2440769 as nserrano
Mar 22, 2021 18:04:21.160 [0x1458d5fef640] DEBUG - Request: [107.145.230.14:61613 (WAN)] GET /:/timeline?key=%2Flibrary%2Fmetadata%2F234370&ratingKey=234370&state=playing&time=1914&duration=5444032&playbackTime=10997&playQueueItemID=2350933 (43 live) TLS GZIP Signed-in Token (nserrano)
Mar 22, 2021 18:04:21.161 [0x1458d5fef640] DEBUG - Client [fpo1mkp658jenefajw23hepx] reporting timeline state playing, progress of 1914/5444032ms for guid=, playbackTime=10997ms ratingKey=234370 url=, key=/library/metadata/234370, containerKey=, metadataId=234370, source=
Mar 22, 2021 18:04:21.181 [0x145933fff640] DEBUG - Jobs: '/usr/lib/plexmediaserver/Plex Transcoder' exit code for process 357 is -9 (signal: Killed)
Mar 22, 2021 18:04:21.295 [0x14592f997640] DEBUG - Auth: authenticated user 1 as fly

Based on thread topic, I am not seeing any signs of the previous database issue.

Maybe you can describe for me what you’re seeing happening so I understand the current state?

This started happening about 2 weeks ago at this point. The issue is that some shows play just fine. Others hang at the start and never actually play. In the most recent logs above, I was trying to play Black Jesus from Chrome on the LAN and I just got the spinning circle.

but if you change to another file , it plays fine?

-or-

If you play that same file on another device, it plays fine there ?

The issues with a file follows the file. If it doesn’t play on Chrome, it also doesn’t play on my Xbox, for example.

If the issue follows the file, replace the file ?

It’s suddenly many files. There’s now a total of 4 On Deck items that I can’t play.

Take those items , whether they be Series or Movies,

  1. Move them to somewhere Plex can’t see them
  2. Scan Files – so Plex notices they are gone
  3. Empty Trash – start the deletion process
  4. Clean Bundles – Take out the metadata for them
  5. Optimize Database – erase even the deleted records from the database for them
  6. Move them back to where they belong.
  7. Scan files and let PMS bring them back in as new media.
  8. Retest

You might have some damaged records in the DB. This sequence will clear it out

Plex dance? :grin:

If that works, is it possible to just dump out the watched status so I don’t lose that, and start with a fresh db?

You’d have to dump the entire database watch status and then re-import it – bulk.
Is that what you want to do?

how many do you need to do this to?

From what I gather, you had a pretty massive corruption. Do you really trust it to re-use as is?

In theory, I’d just reuse watch status, while rebuilding everything else fresh. Seems better, no?

Either way I’ll try the dance first.

Try the Dance with one.
See how it goes.

For me, If my database were hosed that badly, I would start fresh or from a distant backup and come forward. I’d never try to use a repaired DB

Sadly I don’t have a distant backup. Default keeps what, four? Yeah, yeah, yeah, lesson learned.

FWIW: I have a cron job run. easy peasy

1 Like