Hoping for help with DB corruption

that happens too. One on each ear… simultaneously.

@ChuckPa - Just wanted to say thank you for the instructions on starting the built-in sqlite; worked like a charm on my end… Hopefully the OP can also get it to work :+1:

Yeah, something isn’t working correctly on my end. Using the internal tool, and ignoring the integrity_check error, I attempted to dump the database. While my db is 407MB, the dump was only 115MB.

Ideas?

You can try to replace the .dump by .recover
This will try to salvage as many data as possible, but may also create garbage tables which are of no use to Plex.
https://sqlite.org/cli.html#recover_data_from_a_corrupted_database

According to .help, there is no .recover option.

This is the official sqlite documentation.
Have you tried it?

I’m getting different answers here. My attempt at reading the tea leaves from @BigWheel’s post suggest that we should not use the official sqlite tool, and should use the built-in one. What is the risk of using the official tools?

AFAIK, the built-in one is basically the same sqlite, with the added compatibility for the special collations.

Afaik the article needs to be updated as sqllite recently changed with the added compatibility for the collations. (this is something i learned myself very recently) The info that @ChuckPa gave above is how to use the built in one.

Though I don’t like being all doom and gloom, it is possible that your DBs are not recoverable.

Oh wow. Recover turned my 400MB database to an 85GB SQL file. Just for fun I tried to restore it and it seems that every line is erroring out. The end result was a new database that was just 44MB.

It was worth a try, as it helped a few users in the past.
But in your case I’m afraid the database is toast, unless someone with intimate knowledge can save it manually.

I’m putting up the :bat: signal for @anon18523487 , but even he can’t do magic.

Actually, I wonder if maybe I could back up here. What all started this was the sudden inability to play certain shows, locally or remotely. Would it be possible for you fine people to determine that cause? Maybe the database thing is a red herring?

Freshly rebooted logs:
https://1drv.ms/u/s!AtdKjV47ADPOkFsfrV6csp8IrfNC?e=Nc92jl

Is it bad form to bump threads here? Preemptive apologies if so.

@fly

I’m not seeing any database errors per se.

What I am seeing in your logs specifically is damaged media.

Mar 19, 2021 20:06:38.577 [0x1504dc909640] ERROR - [Transcoder] [mp4 @ 0x1347e00] Application provided duration: -16 / timestamp: 37297544 is out of range for mov/mp4 format
Mar 19, 2021 20:06:38.638 [0x15051d50d640] ERROR - [Transcoder] [mp4 @ 0x1347e00] Application provided duration: -16 / timestamp: 37442984 is out of range for mov/mp4 format
Mar 19, 2021 20:06:38.699 [0x15051d50d640] ERROR - [Transcoder] [mp4 @ 0x1347e00] Application provided duration: -16 / timestamp: 37586312 is out of range for mov/mp4 format
Mar 19, 2021 20:06:38.759 [0x15051f71e640] ERROR - [Transcoder] [mp4 @ 0x1347e00] Application provided duration: -16 / timestamp: 37731752 is out of range for mov/mp4 format
Mar 19, 2021 20:06:38.821 [0x15051f31c640] ERROR - [Transcoder] [mp4 @ 0x1347e00] Application provided duration: -16 / timestamp: 37875080 is out of range for mov/mp4 format
Mar 19, 2021 20:06:38.941 [0x15051f31c640] ERROR - [Transcoder] [mp4 @ 0x1347e00] Application provided duration: -16 / timestamp: 38163848 is out of range for mov/mp4 format

It’s entirely possible the codec is damaged but if this only occurs on specific (not all) files then the answer is clear – Specific file has a problem / damaged.

It’s been happening on a bunch of files, but some play fine. How would I attempt to fix a possible damaged codec?

edit: Based on some memory and a quick Google search, I renamed the Codecs folder. That did not appear to help.

Fixing damaged codecs is easy.

Have you identified any common characteristics ?

Your codecs are stored under Plex Media Server/Codecs

You’ll see the server (.device-id) . Don’t delete that. it’s your license file.

In the most recent (date created) directory, you’ll find something which looks like this.

[/share/CACHEDEV3_DATA/.qpkg/PlexMediaServer/Library/Plex Media Server/Codecs/367b3d4-3673-linux-x86_64] # ls -la
total 9812
drwxr-xr-x 2 admin administrators    4096 2021-02-13 03:58 ./
drwxrwxrwx 6 admin administrators    4096 2021-03-05 23:32 ../
-rw-r--r-- 1 admin administrators  308744 2021-02-13 03:58 libaac_decoder.so
-rw-r--r-- 1 admin administrators  269528 2021-02-13 03:58 libaac_encoder.so
-rw-r--r-- 1 admin administrators  175016 2021-02-13 03:58 libac3_decoder.so
-rw-r--r-- 1 admin administrators  121424 2021-02-13 03:58 libape_decoder.so
-rw-r--r-- 1 admin administrators  347016 2021-02-13 03:58 libdca_decoder.so
-rw-r--r-- 1 admin administrators 1981496 2021-02-13 03:58 libh264_decoder.so
-rw-r--r-- 1 admin administrators 1588288 2021-02-13 03:58 libhevc_decoder.so
-rw-r--r-- 1 admin administrators  187320 2021-02-13 03:58 libmp3_decoder.so
-rw-r--r-- 1 admin administrators  527712 2021-02-13 03:58 libmpeg1video_decoder.so
-rw-r--r-- 1 admin administrators  671456 2021-02-13 03:58 libmpeg2video_decoder.so
-rw-r--r-- 1 admin administrators  893624 2021-02-13 03:58 libmpeg4_decoder.so
-rw-r--r-- 1 admin administrators  664968 2021-02-13 03:58 libmsmpeg4v2_decoder.so
-rw-r--r-- 1 admin administrators  664968 2021-02-13 03:58 libmsmpeg4v3_decoder.so
-rw-r--r-- 1 admin administrators 1312584 2021-02-13 03:58 libvc1_decoder.so
-rw-r--r-- 1 admin administrators  113224 2021-02-13 03:58 libwmalossless_decoder.so
-rw-r--r-- 1 admin administrators  166824 2021-02-13 03:58 libwmav2_decoder.so
[/share/CACHEDEV3_DATA/.qpkg/PlexMediaServer/Library/Plex Media Server/Codecs/367b3d4-3673-linux-x86_64] # 

These are the individual codecs.

They have a 1-1 mapping for codec+action .

Are any of them Zero length?

Based on your post, I have replaced the original codecs folder, so please ignore my previous post. That said, even with a brand new codecs folder, I had issues playing shows.

No zero byte files. This is what I’m working with:

image

If you have issues playing a specific file,

  1. Verify DEBUG logging is enabled, VERBOSE logging is disabled. SAVE if you make changes.
  2. Start Playback.
  3. Play until it causes problem / faults. (or fails to play)
  4. Stop Playback
  5. Wait 20 seconds for logs to flush to disk
  6. Download the logs ZIP file
  7. Attach that ZIP file here for review.

Here ya go. Thank you so much.

https://1drv.ms/u/s!AtdKjV47ADPOkFxDTzxEn18UGkYr?e=TzJ5Y8

@fly

where is your docker container storage? Local or Network ?
If local, are the drives spinning down?

You’re getting timeouts waiting for the reply from the transcoe

Mar 22, 2021 16:21:53.003 [0x14abef202640] DEBUG - Completed: [172.17.0.7:46870] 200 GET /status/sessions (63 live) GZIP 0ms 1787 bytes (pipelined: 1)
Mar 22, 2021 16:21:53.560 [0x14ab96df6640] DEBUG - [Transcode] Exists("/config/Plex Media Server/Cache/Transcode/Sessions/plex-transcode-zujpqozpsdpvjb295qioln8n-3ba8d0be-0714-40ad-8198-26325893a1e1/init-stream0.m4s") => 1
Mar 22, 2021 16:21:53.560 [0x14ab96df6640] DEBUG - Content-Length of /config/Plex Media Server/Cache/Transcode/Sessions/plex-transcode-zujpqozpsdpvjb295qioln8n-3ba8d0be-0714-40ad-8198-26325893a1e1/init-stream0.m4s is 805 (of total: 805).
Mar 22, 2021 16:21:53.561 [0x14abef202640] DEBUG - Completed: [192.168.1.120:59645] 200 GET /video/:/transcode/universal/dash/zujpqozpsdpvjb295qioln8n/0/initial.mp4 (63 live) TLS GZIP 120482ms 805 bytes (pipelined: 4)
Mar 22, 2021 16:21:53.886 [0x14ab959ec640] WARN - [Transcode/zujpqozpsdpvjb295qioln8n] Timed out waiting for segment.
Mar 22, 2021 16:21:53.886 [0x14abef403640] DEBUG - Completed: [192.168.1.120:59647] 404 GET /video/:/transcode/universal/dash/zujpqozpsdpvjb295qioln8n/0/0.m4s (61 live) TLS GZIP 119994ms 504 bytes (pipelined: 4)
Mar 22, 2021 16:21:53.897 [0x14ab95dee640] WARN - [Transcode/zujpqozpsdpvjb295qioln8n] Timed out waiting for segment.
Mar 22, 2021 16:21:53.898 [0x14abef202640] DEBUG - Completed: [192.168.1.120:59633] 404 GET /video/:/transcode/universal/dash/zujpqozpsdpvjb295qioln8n/1/0.m4s (60 live) TLS GZIP 119995ms 504 bytes (pipelined: 23)
Mar 22, 2021 16:21:54.089 [0x14ab971f8640] DEBUG - Request: [127.0.0.1:41338 (Loopback)] GET /:/metadata/notify/changeItemState?librarySectionID=2&metadataItemID=179450&metadataType=4&state=-1&parentID=-1&rootID=-1&mediaState=analyzing (60 live) GZIP Signed-in Token (fly)