DBRepair development

@Insomnic_1

I wrote “User Accounts”.

In Plex’s terms, it specifically is Plex ‘account_id’. This is the account id number Plex assigns to a user when they sign up.

In the database, Managed Users and Real Users are stored together.
I can’t tell which is which without connecting to Plex.tv

Maybe I didn’t explain what I mean very well. Let me try again. :slight_smile:

I’m suggesting changing “user accounts” to “plex accounts” in that summary of the expunge function because maybe not all server admins running Plex will associate “user accounts” in Plex’s terms as it relates to the DB label. I understand what you’re saying about how the tool works is accurate of course, but that context of “Plex’s terms” may not be the same perspective as a regular Plex admin picking up this tool to help with their local server.

Based on the initial discussion of the feature, I thought it would clean up the stale records from the user accounts I had removed from my server. You explained that it doesn’t do that because they still have Plex accounts. That distinction was my misunderstanding of the functionality because “user account” didn’t equate to “Plex account” for me. I am suggesting that by using “Plex accounts”, it may provide clearer context for other Plex server admins who don’t associate “non-existent user accounts” to mean “non-existent Plex accounts” like I did.

No biggie and no offense meant. It’s a minor thing. Just thought it might add some clarification for future “users” of the tool. :slight_smile:

Thank you. That makes sense.

I’ll make that change.

ALSO:

While testing today, I found one of my test databases didn’t clean up the way it should have.

I’ve found and fixed it.

Unfortunately, I now have to start testing all the DB’s again to make sure I didn’t break anything.

This will delay my releasing by 1-2 days.

The 0.1999.09 version will likely expire on the 12th.

Please don’t be surprised if it does.

Unable to solve my corrupted DB issue. :frowning:

Unraid - Docker

Enter command # -or- command name (4 char min) : 5

-– Processing Main DB —
Rebuilding Main DB
Transferring schema.
Building FTS tables.
Generating triggers.
Transferring data records.
Generating indexes.
Populating FTS tables.
Warning: Main DB: 2 track/album/episode row(s) missing parent context.
There is a small issue with the DB. Functionality is not impaired but should be
addressed by PMS as soon as convenient. In each section, listed below, do a
‘Scan Files’ and ‘Refresh All Metadata’. PMS will make the repair.

Library ‘(unknown)’: 2 item(s)

Checking Main DB after rebuild.
Database is damaged: malformed inverted index for FTS4 table main.fts4_metadata_titles

ERROR: Main DB final integrity check failed.

-– Processing Blobs DB —
Rebuilding Blobs DB
Transferring schema.
Building FTS tables.
Generating triggers.
Transferring data records.
Generating indexes.
Populating FTS tables.

Checking Blobs DB after rebuild.

Blobs DB rebuild and verification complete.
ERROR: Repair failed for one or both databases. Discarding output

Suggestions other than nuke, start over and rescan everything?

Edit to add the plex log error:

Error: Unable to set up server: sqlite3_statement_backend::prepare: table fts4_metadata_titles_icu already exists for SQL: CREATE VIRTUAL TABLE fts4_metadata_titles_icu USING fts4(title, title_sort, original_title, tokenize=collating ‘root@colStrength=primary;colAlternate=shifted’) (N4soci10soci_errorE)

@Malokhan

That should be working fine.

I know the ‘Unknown’ issue for metadata and have addressed it.
It’s PMS internal numbering for agents versus section id numbers.

Yes, when it can’t correct it completely and pass “CheckDB” it fails the operation to protect your DBs.

May I get your server databases and run them here ?

Which version of PMS do you have ? (version and build number please)

I am running Unraid - Docker, LSIO.

Version 1.43.4.10903

Sent you a PM with the link for the corrupted DB.

I’ve spun up a new DB for now. But I would still like to get this one resolved and restored, if possible.

That looks like it did it!
Thanks for the fast fix!

is it quick ?

How do you like the new look ?

For the rest of you who saw that, My apologies. :frowning:

I have more testing to finish but, as you can see, We’re almost there.

Yes it went quick, I think it went through everything in less 120 seconds.

I’m fairly new to this resource, so I didn’t notice a new look. But everything was clear and presented well.

in your Databases directory is DBRepair.log

You can see the timestamps.

I’m curious because when I ran it here, it took about 10 seconds

Here is a clip from that time in the log.

2026-09-12 18.07.27 - Load - Matched compiled schema for PMS 1.43.4.10903
2026-09-12 18.07.27 - PMS Version = +1.43.4.10903
2026-09-12 18.07.27 - ============================================================
2026-09-12 18.07.27 - Session start. Sat Sep 12 18:07:27 2026 (ver 0.1999.10)
2026-09-12 18.07.27 - ============================================================
2026-09-12 18.07.34 - Auto - START
2026-09-12 18.07.34 - CheckDB - Checking basic integrity - /config/Library/Application Support/Plex Media Server/Plug-in Support/Databases/com.plexapp.plugins.library.db
2026-09-12 18.07.35 - CheckDB - FAIL - /config/Library/Application Support/Plex Media Server/Plug-in Support/Databases/com.plexapp.plugins.library.db: *** in database main ***
Tree 94 page 203239 cell 2: Extends off end of page
2026-09-12 18.07.35 - CheckDB - Checking Indexes and FTS tables - /config/Library/Application Support/Plex Media Server/Plug-in Support/Databases/com.plexapp.plugins.library.db
2026-09-12 18.07.35 - IsFragmented - /config/Library/Application Support/Plex Media Server/Plug-in Support/Databases/com.plexapp.plugins.library.db is 0% fragmented.
2026-09-12 18.07.35 - CheckDB - Full check complete - /config/Library/Application Support/Plex Media Server/Plug-in Support/Databases/com.plexapp.plugins.library.db
2026-09-12 18.07.35 - Auto - Check /config/Library/Application Support/Plex Media Server/Plug-in Support/Databases/com.plexapp.plugins.library.db DB - FAIL
2026-09-12 18.07.35 - CheckDB - Checking basic integrity - /config/Library/Application Support/Plex Media Server/Plug-in Support/Databases/com.plexapp.plugins.library.blobs.db
2026-09-12 18.07.54 - CheckDB - Checking Indexes and FTS tables - /config/Library/Application Support/Plex Media Server/Plug-in Support/Databases/com.plexapp.plugins.library.blobs.db
2026-09-12 18.07.54 - IsFragmented - /config/Library/Application Support/Plex Media Server/Plug-in Support/Databases/com.plexapp.plugins.library.blobs.db is 0% fragmented.
2026-09-12 18.07.54 - CheckDB - Full check complete - /config/Library/Application Support/Plex Media Server/Plug-in Support/Databases/com.plexapp.plugins.library.blobs.db
2026-09-12 18.07.54 - Auto - Check Blobs DB - PASS
2026-09-12 18.07.54 - DoSchema - Main: 52 from source, 0 unrecognized, 0 recreated from fallback.
2026-09-12 18.07.54 - DoTriggers - Main: 8 from source, 0 unrecognized, 0 recreated from fallback.
2026-09-12 18.08.20 - DoIndex - Main: 155 from source, 0 unrecognized, 0 recreated from fallback.
2026-09-12 18.08.27 - DoFTSPopulate - FTS repopulation complete for Main
2026-09-12 18.08.27 - CheckDB - Checking basic integrity - /config/Library/Application Support/Plex Media Server/Plug-in Support/Databases/dbtmp/com.plexapp.plugins.library-REPAIR-2026-09-12_18-07-34-823.db
2026-09-12 18.08.34 - CheckDB - Checking Indexes and FTS tables - /config/Library/Application Support/Plex Media Server/Plug-in Support/Databases/dbtmp/com.plexapp.plugins.library-REPAIR-2026-09-12_18-07-34-823.db
2026-09-12 18.08.35 - IsFragmented - /config/Library/Application Support/Plex Media Server/Plug-in Support/Databases/dbtmp/com.plexapp.plugins.library-REPAIR-2026-09-12_18-07-34-823.db is 1% fragmented.
2026-09-12 18.08.35 - CheckDB - Full check complete - /config/Library/Application Support/Plex Media Server/Plug-in Support/Databases/dbtmp/com.plexapp.plugins.library-REPAIR-2026-09-12_18-07-34-823.db
2026-09-12 18.08.35 - Auto - SUCCESS - Main DB Repair Complete
2026-09-12 18.08.35 - DoSchema - Blobs: 52 from source, 0 unrecognized, 0 recreated from fallback.
2026-09-12 18.08.35 - DoTriggers - Blobs: 8 from source, 0 unrecognized, 0 recreated from fallback.
2026-09-12 18.08.54 - DoIndex - Blobs: 155 from source, 0 unrecognized, 0 recreated from fallback.
2026-09-12 18.08.55 - DoFTSPopulate - FTS repopulation complete for Blobs
2026-09-12 18.08.55 - CheckDB - Checking basic integrity - /config/Library/Application Support/Plex Media Server/Plug-in Support/Databases/dbtmp/com.plexapp.plugins.library.blobs-REPAIR-2026-09-12_18-07-34-823.db
2026-09-12 18.08.59 - CheckDB - Checking Indexes and FTS tables - /config/Library/Application Support/Plex Media Server/Plug-in Support/Databases/dbtmp/com.plexapp.plugins.library.blobs-REPAIR-2026-09-12_18-07-34-823.db
2026-09-12 18.08.59 - IsFragmented - /config/Library/Application Support/Plex Media Server/Plug-in Support/Databases/dbtmp/com.plexapp.plugins.library.blobs-REPAIR-2026-09-12_18-07-34-823.db is 0% fragmented.
2026-09-12 18.08.59 - CheckDB - Full check complete - /config/Library/Application Support/Plex Media Server/Plug-in Support/Databases/dbtmp/com.plexapp.plugins.library.blobs-REPAIR-2026-09-12_18-07-34-823.db
2026-09-12 18.08.59 - Auto - SUCCESS - Blobs DB Repair Complete
2026-09-12 18.09.00 - REPAIR - PUSH - Saved state to stack (Timestamp: 2026-09-12_18-07-34-823)
2026-09-12 18.09.00 - REPAIR - MakeActive - Main DB updated to live (Timestamp: 2026-09-12_18-07-34-823)
2026-09-12 18.09.00 - REPAIR - MakeActive - Blobs DB updated to live (Timestamp: 2026-09-12_18-07-34-823)
2026-09-12 18.09.00 - REPAIR - Databases active: (Active Timestamp: 2026-09-12_18-07-34-823)
2026-09-12 18.09.00 - Auto - COMPLETED SUCCESS
2026-09-12 18.09.00 - Auto - COMPLETED SUCCESS

Outstanding. Thank you. did its job nice and tidy