DBRepair development

Here it is. Testing completed.

[2026-07-03 22.47.38] 
[2026-07-03 22.47.38]   Sqlite3 Cache Size  [0]
[2026-07-03 22.47.38]   Sqlite3 Page Size   [32768]
[2026-07-03 22.47.38]   DBRepair Notify Cmd [Hello there you PEBKAC]
[2026-07-03 22.47.38]  
  • Sqlite3 Cache Size = 0 (let the OS & Sqlite3 determine the I/O buffer size)
  • Sqlite3 Page Size == DBREPAIR_PAGESIZE value from the environment
  • DBREPAIR Notify Cmd = “Whatever you want in that command”

Have a great holiday everyone!

Made progress today.

Windows executable lives.
It doesn’t do anything functional yet but spit errors :slight_smile:

Here’s the best it can currently do.
It accepts and validates the --databases directory then continues in manual mode.

(it has no identification or personality detection yet)

Folks,

I had some free time.

DBRepair now understands Windows configurations. (somewhat)

I would appreciate feedback.

  1. It understands C:\Users\username\AppData\Local
  2. It understands C:\Users\username\AppData\Roaming

The screenshot below is from Windows 11 VM and DBRepair automagically configuring itself.

Guidance appreciated
Additionally, if anyone understands the mysteries of ICU, I would be appreciative

Binaries now built are:

pc-darwin-arm64-release
pc-darwin-x86_64-release
pc-linux-arm32-release
pc-linux-arm64-release
pc-linux-x86_64-release
pc-windows-x86_64-release

Where do I download the binaries @ChuckPa ?

I’ve only ever downloaded the dbrepair.sh script from your Github, or am I missing something (as usual)?

:smiley:

I’ve not posted binaries yet because I’ve not finished testing with all the databases I have.

I’m looping through all the DBs with

  1. Test
  2. Fix
  3. Go back to step 1

It’s a lot of little things but it is getting closer.

I will be having a few folks help me test.

Hosts needing to be tested by others are:

  1. Armv7 Linux (pc-linux-arm32)
  2. X86_64 MacOS (pc-darwin-x86_64)
  3. Win 64 (pc-windows-x86_64) — My VM is painful to use.
  4. Any other configuration/NAS/Containers DBRepair.sh already runs on.
    ( I can test Darwin-arm64, Linux-arm64 and Linux-x86_64)

Anyone interested in helping, please let me know

My PMS runs on macOS (ARM64) so happy to test that when you are ready, but sounds like you have that one covered anyway.

ALL:

Packages for v0.1999.01 have been removed in favor of
v0.1999.02

Forgot to show the console log.

SYSTEM: macOS,(MacOS)
ENGINE: SQLite v3.53.0
STEEL:  ICU Headers LINKED
[Smoke Test Complete]
Binary Architecture: 64-bit




      Database Repair Utility for Plex Media Server  (MacOS)
                       Version 0.1999.01 (Jul  8 2026)

[2026-07-09 00.58.58]  
[2026-07-09 00.58.58] Stopping PMS. (60 second max delay)
[2026-07-09 00.59.04] Stopped PMS.
[2026-07-09 00.59.04]  
[2026-07-09 00.59.04] Checking the PMS databases...
[2026-07-09 00.59.04] Database is damaged: row 67 missing from index index_title_sort_icu
[2026-07-09 00.59.04]   PMS main database is damaged.
[2026-07-09 00.59.04]   PMS blobs database is damaged.
[2026-07-09 00.59.04] 
[2026-07-09 00.59.06] Checking the PMS databases... complete.
[2026-07-09 00.59.06]  
[2026-07-09 00.59.06] --- Processing Main DB ---
[2026-07-09 00.59.07] Rebuilding and Verifying Main DB structure...
[2026-07-09 00.59.07] Rebuilding pristine indexes from source schema...
[2026-07-09 00.59.08] Rebuilding FTS Virtual Tables for ...

[2026-07-09 00.59.10] --- Processing Blobs DB ---
[2026-07-09 00.59.11] Rebuilding and Verifying Blobs DB structure...
[2026-07-09 00.59.11] Rebuilding pristine indexes from source schema...
[2026-07-09 00.59.11] Rebuilding FTS Virtual Tables for ...

[2026-07-09 00.59.11] Executing file swap for completed pipelines...
[2026-07-09 00.59.11] Swap complete. Live databases updated.
[2026-07-09 00.59.11]  
[2026-07-09 00.59.11] Starting PMS.
[2026-07-09 00.59.11] Started PMS.
[2026-07-09 00.59.11]  
[2026-07-09 00.59.11] Deleting temporary work files.
chuck@tirol ~ % dbrepair/build/pc-darwin-arm64-release/bin/DBRepair                             
SYSTEM: macOS,(MacOS)
ENGINE: SQLite v3.53.0
STEEL:  ICU Headers LINKED
[Smoke Test Complete]
Binary Architecture: 64-bit




      Database Repair Utility for Plex Media Server  (MacOS)
                       Version 0.1999.01 (Jul  8 2026)


Select

  1 - 'stop'      - Stop PMS.
  3 - 'check'     - Perform integrity check of database and FTS indexes.
  5 - 'repair'    - Repair/Optimize databases.
  7 - 'start'     - Start PMS

 10 - 'show'      - Show logfile.
 11 - 'status'    - Report status of PMS (run-state and databases).

 21 - 'prune'     - Remove old image files from PhotoTranscoder cache & all temp files left by PMS.
 42 - 'ignore'    - Ignore duplicate/constraint errors.

 98 - 'quit'      - Quit immediately.  Keep all temporary files.
 99 - 'exit'      - Exit with cleanup options.

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

--- [ DBRepair: Host Configuration Dump ] ---

  Version:            [0.1999.01]
  Os                  [1]
  Uid / Gid           [501:20]
  Username            [chuck]
  Home Directory:     [/Users/chuck]
  Host Type:          [MacOS]
  Distro Name:        [macOS]
  Time Stamp:         [2026-07-09_00.59.59]
  Last User:          [None]
  Last Run:           [Never]

  Manual Config:      No
  Root Required:      No
  Scripted Mode:      No
  Ignore Errors:      No
  Checked DB:         No
  Damaged:            No
  Main Damaged:       No
  Blobs Damaged:      No
  Checked Main FTS:   No
  Main FTS Damaged:   No
  Checked Blobs FTS:  No
. Blobs FTS Damaged:  No
  Remove Duplicates:  No
  Fail Status:        No

  Owner UID/GID:      0:0
  Default Perms:      0644
  Stat Format:        [-f]
  Stat Bytes:         [%z]
  Stat Perms:         [%Lp]

  Package Dir:        [/Users/chuck//Applications/Plex Media Server.app]
  SQLite Version:     [3.53.0]
  App Support Dir:    [/Users/chuck/Library/Application Support]
  Database Dir:       [/Users/chuck/Library/Application Support/Plex Media Server/Plug-in Support/Databases]
  Database Temp Dir:  [/Users/chuck/Library/Application Support/Plex Media Server/Plug-in Support/Databases/dbtmp]
  Main DB Path:       [/Users/chuck/Library/Application Support/Plex Media Server/Plug-in Support/Databases/com.plexapp.plugins.library.db]
  Blobs DB Path:      [/Users/chuck/Library/Application Support/Plex Media Server/Plug-in Support/Databases/com.plexapp.plugins.library.blobs.db]
  Cache Dir:          [/Users/chuck/Library/Caches/PlexMediaServer/PhotoTranscoder]
  Log File:           [/Users/chuck/Library/Application Support/Plex Media Server/Plug-in Support/Databases/DBRepair.log]
  Pid File:           []
  Temp Dir (Local):   [/tmp]
  System Temp:        [/tmp]

  Script Name:        []
  Script Path:        []
  Working Dir:        []

  Sqlite3 Cache Size  [0]
  Sqlite3 Page Size   [0]
  DBRepair Notify Cmd []
 
  Pidof Utility:      [pgrep]
  FTS Query:          [SELECT name FROM sqlite_master WHERE sql LIKE '%FTS%';]
  Have Start/Stop:    (Yes)
  Start Command:      [TMPDIR=/tmp osascript -e 'tell app "Plex Media Server" to launch']
  Stop Command:       [TMPDIR=/tmp osascript -e 'tell app "Plex Media Server" to quit']
------------------------------------------------------


Select

  1 - 'stop'      - Stop PMS.
  3 - 'check'     - Perform integrity check of database and FTS indexes.
  5 - 'repair'    - Repair/Optimize databases.
  7 - 'start'     - Start PMS

 10 - 'show'      - Show logfile.
 11 - 'status'    - Report status of PMS (run-state and databases).

 21 - 'prune'     - Remove old image files from PhotoTranscoder cache & all temp files left by PMS.
 42 - 'ignore'    - Ignore duplicate/constraint errors.

 98 - 'quit'      - Quit immediately.  Keep all temporary files.
 99 - 'exit'      - Exit with cleanup options.

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

Deflating a 33 GB database on MacOS Arm64 (-v == verbose output)

chuck@tirol dbrepair % sudo build/pc-darwin-arm64-release/bin/DBRepair -v --databases ./databases stop config check repair exit
DEBUG: Setting H.CacheDir [./databases/../../Cache/PhotoTranscoder]
WARNING: Manual config provided. Cache directory (./databases/../../Cache/PhotoTranscoder) not found.
         Default Cache directory location cleared
SYSTEM: macOS,(MANUAL)
ENGINE: SQLite v3.53.0
STEEL:  ICU Headers LINKED
[Smoke Test Complete]
Binary Architecture: 64-bit




      Database Repair Utility for Plex Media Server  (MANUAL)
                       Version 0.1999.01 (Jul  8 2026)

[2026-07-09 01.04.53]       SQLite     = '3.53.0'
[2026-07-09 01.04.53]       Databases  = './databases'
[2026-07-09 01.04.53]  
[2026-07-09 01.04.53] Start/Stop feature not available.
[2026-07-09 01.04.53]  
[2026-07-09 01.04.53] 
--- [ DBRepair: Host Configuration Dump ] ---

[2026-07-09 01.04.53]   Version:            [0.1999.01]
[2026-07-09 01.04.53]   Os                  [1]
[2026-07-09 01.04.53]   Uid / Gid           [0:0]
[2026-07-09 01.04.53]   Username            [root]
[2026-07-09 01.04.53]   Home Directory:     [/Users/chuck]
[2026-07-09 01.04.53]   Host Type:          [MANUAL]
[2026-07-09 01.04.53]   Distro Name:        [macOS]
[2026-07-09 01.04.53]   Time Stamp:         [2026-07-09_01.04.53]
[2026-07-09 01.04.53]   Last User:          [None]
[2026-07-09 01.04.53]   Last Run:           [Never]
[2026-07-09 01.04.53] 
[2026-07-09 01.04.53]   Manual Config:      Yes
[2026-07-09 01.04.53]   Root Required:      No
[2026-07-09 01.04.53]   Scripted Mode:      Yes
[2026-07-09 01.04.53]   Ignore Errors:      No
[2026-07-09 01.04.53]   Checked DB:         No
[2026-07-09 01.04.53]   Damaged:            No
[2026-07-09 01.04.53]   Main Damaged:       No
[2026-07-09 01.04.53]   Blobs Damaged:      No
[2026-07-09 01.04.53]   Checked Main FTS:   No
[2026-07-09 01.04.53]   Main FTS Damaged:   No
[2026-07-09 01.04.53]   Checked Blobs FTS:  No
[2026-07-09 01.04.53] . Blobs FTS Damaged:  No
[2026-07-09 01.04.53]   Remove Duplicates:  No
[2026-07-09 01.04.53]   Fail Status:        No
[2026-07-09 01.04.53] 
[2026-07-09 01.04.53]   Owner UID/GID:      0:0
[2026-07-09 01.04.53]   Default Perms:      0644
[2026-07-09 01.04.53]   Stat Format:        [-c]
[2026-07-09 01.04.53]   Stat Bytes:         [%s]
[2026-07-09 01.04.53]   Stat Perms:         [%a]
[2026-07-09 01.04.53] 
[2026-07-09 01.04.53]   Package Dir:        []
[2026-07-09 01.04.53]   SQLite Version:     [3.53.0]
[2026-07-09 01.04.53]   App Support Dir:    []
[2026-07-09 01.04.53]   Database Dir:       [./databases]
[2026-07-09 01.04.53]   Database Temp Dir:  [./databases/dbtmp]
[2026-07-09 01.04.53]   Main DB Path:       [./databases/com.plexapp.plugins.library.db]
[2026-07-09 01.04.53]   Blobs DB Path:      [./databases/com.plexapp.plugins.library.blobs.db]
[2026-07-09 01.04.53]   Cache Dir:          []
[2026-07-09 01.04.53]   Log File:           [./databases/DBRepair.log]
[2026-07-09 01.04.53]   Pid File:           []
[2026-07-09 01.04.53]   Temp Dir (Local):   []
[2026-07-09 01.04.53]   System Temp:        []
[2026-07-09 01.04.53] 
[2026-07-09 01.04.53]   Script Name:        []
[2026-07-09 01.04.53]   Script Path:        []
[2026-07-09 01.04.53]   Working Dir:        []
[2026-07-09 01.04.53] 
[2026-07-09 01.04.53]   Sqlite3 Cache Size  [0]
[2026-07-09 01.04.53]   Sqlite3 Page Size   [0]
[2026-07-09 01.04.53]   DBRepair Notify Cmd []
[2026-07-09 01.04.53]  
[2026-07-09 01.04.53]   Pidof Utility:      [pidof]
[2026-07-09 01.04.53]   FTS Query:          [SELECT name FROM sqlite_master WHERE sql LIKE '%FTS%';]
[2026-07-09 01.04.53]   Have Start/Stop:    (No)
[2026-07-09 01.04.53]   Start Command:      []
[2026-07-09 01.04.53]   Stop Command:       []
[2026-07-09 01.04.53] ------------------------------------------------------
[2026-07-09 01.04.53] 
[2026-07-09 01.04.53]  
[2026-07-09 01.04.53] Checking the PMS databases...
[2026-07-09 01.16.01] Database is damaged: row 1202 missing from index index_title_sort_icu
[2026-07-09 01.16.01]   Main DB: FTS shadow table missing: 'fts4_metadata_titles_content'
[2026-07-09 01.16.01]   Main DB: FTS shadow table missing: 'fts4_tag_titles_content'
[2026-07-09 01.16.01]   Main DB: FTS shadow table missing: 'fts4_metadata_titles_icu_content'
[2026-07-09 01.16.01]   Main DB: FTS shadow table missing: 'fts4_tag_titles_icu_content'
[2026-07-09 01.16.01]   PMS main database is damaged.
[2026-07-09 01.16.02]   Blobs DB: FTS shadow table missing: 'fts4_metadata_titles_content'
[2026-07-09 01.16.02]   Blobs DB: FTS shadow table missing: 'fts4_tag_titles_content'
[2026-07-09 01.16.02]   Blobs DB: FTS shadow table missing: 'fts4_metadata_titles_icu_content'
[2026-07-09 01.16.02]   Blobs DB: FTS shadow table missing: 'fts4_tag_titles_icu_content'
[2026-07-09 01.16.02]   PMS blobs database is damaged.
[2026-07-09 01.16.02] 
[2026-07-09 01.16.02]   Main DB: FTS index 'spellfix_metadata_titles' - OK
[2026-07-09 01.16.02]   Main DB: FTS index 'spellfix_tag_titles' - OK
[2026-07-09 01.16.02]   Main DB: FTS index 'fts4_metadata_titles' - OK
[2026-07-09 01.16.02]   Main DB: FTS index 'fts4_tag_titles' - OK
[2026-07-09 01.16.02]   Main DB: FTS index 'fts4_metadata_titles_icu' - OK
[2026-07-09 01.16.03]   Main DB: FTS index 'fts4_tag_titles_icu' - OK
[2026-07-09 01.16.03]   Blobs DB: Missing FTS index 'locations' - MISSING
[2026-07-09 01.16.03]   Blobs DB: FTS index 'spellfix_metadata_titles' - OK
[2026-07-09 01.16.03]   Blobs DB: FTS index 'spellfix_tag_titles' - OK
[2026-07-09 01.16.03]   Blobs DB: FTS index 'fts4_metadata_titles' - OK
[2026-07-09 01.16.03]   Blobs DB: FTS index 'fts4_tag_titles' - OK
[2026-07-09 01.16.03]   Blobs DB: FTS index 'fts4_metadata_titles_icu' - OK
[2026-07-09 01.16.03]   Blobs DB: FTS index 'fts4_tag_titles_icu' - OK
[2026-07-09 01.16.03] 
[2026-07-09 01.16.03]   NOTE: FTS indexes are damaged but main database structure is OK.
[2026-07-09 01.16.03]         Use 'reindex' (option 6) or 'automatic' (option 2) to rebuild.
[2026-07-09 01.16.03] Checking the PMS databases... complete.
[2026-07-09 01.16.03]  
[2026-07-09 01.16.03] --- Processing Main DB ---
[2026-07-09 01.16.03] [Bulk] Extracting schema_migrations: 431 rows completed.   
[2026-07-09 01.16.03] [Bulk] Extracting media_parts: 49091 rows completed.   
[2026-07-09 01.16.03] [Bulk] Extracting library_sections: 24 rows completed.   
[2026-07-09 01.16.03] [Bulk] Extracting section_locations: 61 rows completed.   
[2026-07-09 01.16.03] [Bulk] Extracting directories: 3401 rows completed.   
[2026-07-09 01.16.03] [Bulk] Extracting stream_types: 3 rows completed.   
[2026-07-09 01.16.03] [Bulk] Extracting metadata_item_views: 9588 rows completed.   
[2026-07-09 01.16.03] [Bulk] Extracting plugins: 13 rows completed.   
[2026-07-09 01.16.03] [Bulk] Extracting plugin_prefixes: 2 rows completed.   
[2026-07-09 01.16.03] [Bulk] Extracting tags: 131575 rows completed.   
[2026-07-09 01.16.03] [Bulk] Extracting taggings: 404984 rows completed.   
[2026-07-09 01.16.03] [Bulk] Extracting metadata_relations: 16249 rows completed.   
[2026-07-09 01.16.03] [Bulk] Extracting metadata_item_settings: 12113 rows completed.   
[2026-07-09 01.16.03] [Bulk] Extracting accounts: 23 rows completed.   
[2026-07-09 01.16.03] [Bulk] Extracting media_part_settings: 1448 rows completed.   
[2026-07-09 01.16.03] [Bulk] Extracting media_streams: 108759 rows completed.   
[2026-07-09 01.16.03] [Bulk] Extracting media_items: 49091 rows completed.   
[2026-07-09 01.16.03] [Bulk] Extracting metadata_items: 25898 rows completed.   
[2026-07-09 01.16.03] [Bulk] Extracting play_queue_items: 2071 rows completed.   
[2026-07-09 01.16.03] [Bulk] Extracting play_queues: 162 rows completed.   
[2026-07-09 01.16.03] [Bulk] Extracting play_queue_generators: 164 rows completed.   
[2026-07-09 01.16.03] [Bulk] Extracting metadata_item_accounts: 8 rows completed.   
[2026-07-09 01.16.03] [Bulk] Extracting preferences: 15 rows completed.   
[2026-07-09 01.16.03] [Bulk] Extracting devices: 484 rows completed.   
[2026-07-09 01.16.33] [Bulk] Extracting statistics_bandwidth: 24513 rows completed.   
[2026-07-09 01.16.33] [Bulk] Extracting statistics_media: 6800 rows completed.   
[2026-07-09 01.16.33] [Bulk] Extracting locations_node: 1 rows completed.   
[2026-07-09 01.16.33] [Bulk] Extracting external_metadata_sources: 1 rows completed.   
[2026-07-09 01.16.33] [Bulk] Extracting external_metadata_items: 190 rows completed.   
[2026-07-09 01.16.33] [Bulk] Extracting media_stream_settings: 171 rows completed.   
[2026-07-09 01.16.33] [Bulk] Extracting hub_templates: 25 rows completed.   
[2026-07-09 01.16.33] [Bulk] Extracting activities: 90004 rows completed.   
[2026-07-09 01.16.33] [Bulk] Extracting metadata_agent_providers: 5 rows completed.   
[2026-07-09 01.16.33] [Bulk] Extracting download_queues: 3 rows completed.   
[2026-07-09 01.16.34] Rebuilding and Verifying Main DB structure...
[2026-07-09 01.16.34] Rebuilding pristine indexes from source schema...
[2026-07-09 01.16.34] Rebuilding FTS Virtual Tables for ...

[2026-07-09 01.16.37] --- Processing Blobs DB ---
[2026-07-09 01.16.37] [Bulk] Extracting schema_migrations: 427 rows completed.   
[2026-07-09 01.16.37] [Bulk] Extracting stream_types: 3 rows completed.   
[2026-07-09 01.16.37] [Bulk] Extracting accounts: 1 rows completed.   
[2026-07-09 01.16.37] [Bulk] Extracting preferences: 1 rows completed.   
[2026-07-09 01.16.37] [Bulk] Extracting locations_node: 1 rows completed.   
[2026-07-09 01.16.37] [Bulk] Extracting blobs: 13399 rows completed.   
[2026-07-09 01.16.37] Rebuilding and Verifying Blobs DB structure...
[2026-07-09 01.16.37] Rebuilding pristine indexes from source schema...
[2026-07-09 01.16.37] Rebuilding FTS Virtual Tables for ...

[2026-07-09 01.16.37] Executing file swap for completed pipelines...
[2026-07-09 01.16.37] Swap complete. Live databases updated.
[2026-07-09 01.16.37]  
[2026-07-09 01.16.37] Deleting temporary work files.
chuck@tirol dbrepair %

@ChuckPa

Gave it a run, it seemed very quick compared to the script version.

It seemed to find a couple of errors it couldn’t fix.

Checking the PMS databases...
Database is damaged: malformed inverted index for FTS4 table main.fts4_metadata_titles_icu
  PMS main database is damaged.
  PMS blobs database is damaged.

  Main DB: Missing FTS index 'locations' - MISSING
  Blobs DB: Missing FTS index 'locations' - MISSING

  NOTE: FTS indexes are damaged but main database structure is OK.
        Use 'reindex' (option 6) or 'automatic' (option 2) to rebuild.
Checking the PMS databases... complete.

Plex seems to be running OK, not sure if I should restore the backup or not?

Any suggestions?

I enclose the whole session as captured, including log and config.

Last login: Thu Jul  9 17:16:07 on ttys000
/Users/Shared/PlexDBRepair/DBRepair-darwin-arm64/DBRepair ; exit;
stephenh@MacStudio ~ % /Users/Shared/PlexDBRepair/DBRepair-darwin-arm64/DBRepair ; exit;
SYSTEM: macOS,(MacOS)
ENGINE: SQLite v3.53.0
STEEL:  ICU Headers LINKED
[Smoke Test Complete]
Binary Architecture: 64-bit




      Database Repair Utility for Plex Media Server  (MacOS)
                       Version 0.1999.01 (Jul  8 2026)


Select

  1 - 'stop'      - Stop PMS.
  3 - 'check'     - Perform integrity check of database and FTS indexes.
  5 - 'repair'    - Repair/Optimize databases.
  7 - 'start'     - Start PMS

 10 - 'show'      - Show logfile.
 11 - 'status'    - Report status of PMS (run-state and databases).

 21 - 'prune'     - Remove old image files from PhotoTranscoder cache & all temp files left by PMS.
 42 - 'ignore'    - Ignore duplicate/constraint errors.

 98 - 'quit'      - Quit immediately.  Keep all temporary files.
 99 - 'exit'      - Exit with cleanup options.

Enter command # -or- command name (4 char min) : stop
 
Stopping PMS. (60 second max delay)
Stopped PMS.

Select

  1 - 'stop'      - Stop PMS.
  3 - 'check'     - Perform integrity check of database and FTS indexes.
  5 - 'repair'    - Repair/Optimize databases.
  7 - 'start'     - Start PMS

 10 - 'show'      - Show logfile.
 11 - 'status'    - Report status of PMS (run-state and databases).

 21 - 'prune'     - Remove old image files from PhotoTranscoder cache & all temp files left by PMS.
 42 - 'ignore'    - Ignore duplicate/constraint errors.

 98 - 'quit'      - Quit immediately.  Keep all temporary files.
 99 - 'exit'      - Exit with cleanup options.

Enter command # -or- command name (4 char min) : check
 
Checking the PMS databases...
Database is damaged: malformed inverted index for FTS4 table main.fts4_metadata_titles_icu
  PMS main database is damaged.
  PMS blobs database is damaged.

  Main DB: Missing FTS index 'locations' - MISSING
  Blobs DB: Missing FTS index 'locations' - MISSING

  NOTE: FTS indexes are damaged but main database structure is OK.
        Use 'reindex' (option 6) or 'automatic' (option 2) to rebuild.
Checking the PMS databases... complete.

Select

  1 - 'stop'      - Stop PMS.
  3 - 'check'     - Perform integrity check of database and FTS indexes.
  5 - 'repair'    - Repair/Optimize databases.
  7 - 'start'     - Start PMS

 10 - 'show'      - Show logfile.
 11 - 'status'    - Report status of PMS (run-state and databases).

 21 - 'prune'     - Remove old image files from PhotoTranscoder cache & all temp files left by PMS.
 42 - 'ignore'    - Ignore duplicate/constraint errors.

 98 - 'quit'      - Quit immediately.  Keep all temporary files.
 99 - 'exit'      - Exit with cleanup options.

Enter command # -or- command name (4 char min) : repair
 
--- Processing Main DB ---
Rebuilding and Verifying Main DB structure...
Rebuilding pristine indexes from source schema...
Rebuilding FTS Virtual Tables for ...

--- Processing Blobs DB ---
Rebuilding and Verifying Blobs DB structure...
Rebuilding pristine indexes from source schema...
Rebuilding FTS Virtual Tables for ...

Executing file swap for completed pipelines...
Swap complete. Live databases updated.

Select

  1 - 'stop'      - Stop PMS.
  3 - 'check'     - Perform integrity check of database and FTS indexes.
  5 - 'repair'    - Repair/Optimize databases.
  7 - 'start'     - Start PMS

 10 - 'show'      - Show logfile.
 11 - 'status'    - Report status of PMS (run-state and databases).

 21 - 'prune'     - Remove old image files from PhotoTranscoder cache & all temp files left by PMS.
 42 - 'ignore'    - Ignore duplicate/constraint errors.

 98 - 'quit'      - Quit immediately.  Keep all temporary files.
 99 - 'exit'      - Exit with cleanup options.

Enter command # -or- command name (4 char min) : check
 
Checking the PMS databases...
  PMS main database is damaged.
  PMS blobs database is damaged.

  Main DB: Missing FTS index 'locations' - MISSING
  Blobs DB: Missing FTS index 'locations' - MISSING

  NOTE: FTS indexes are damaged but main database structure is OK.
        Use 'reindex' (option 6) or 'automatic' (option 2) to rebuild.
Checking the PMS databases... complete.

Select

  1 - 'stop'      - Stop PMS.
  3 - 'check'     - Perform integrity check of database and FTS indexes.
  5 - 'repair'    - Repair/Optimize databases.
  7 - 'start'     - Start PMS

 10 - 'show'      - Show logfile.
 11 - 'status'    - Report status of PMS (run-state and databases).

 21 - 'prune'     - Remove old image files from PhotoTranscoder cache & all temp files left by PMS.
 42 - 'ignore'    - Ignore duplicate/constraint errors.

 98 - 'quit'      - Quit immediately.  Keep all temporary files.
 99 - 'exit'      - Exit with cleanup options.

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

--- [ DBRepair: Host Configuration Dump ] ---

  Version:            [0.1999.01]
  Os                  [1]
  Uid / Gid           [501:20]
  Username            [stephenh]
  Home Directory:     [/Users/stephenh]
  Host Type:          [MacOS]
  Distro Name:        [macOS]
  Time Stamp:         [2026-07-09_17.18.40]
  Last User:          [None]
  Last Run:           [Never]

  Manual Config:      No
  Root Required:      No
  Scripted Mode:      No
  Ignore Errors:      No
  Checked DB:         Yes
  Damaged:            Yes
  Main Damaged:       Yes
  Blobs Damaged:      Yes
  Checked Main FTS:   Yes
  Main FTS Damaged:   Yes
  Checked Blobs FTS:  Yes
. Blobs FTS Damaged:  Yes
  Remove Duplicates:  No
  Fail Status:        No

  Owner UID/GID:      0:0
  Default Perms:      0644
  Stat Format:        [-f]
  Stat Bytes:         [%z]
  Stat Perms:         [%Lp]

  Package Dir:        [/Applications/Plex Media Server.app]
  SQLite Version:     [3.53.0]
  App Support Dir:    [/Users/stephenh/Library/Application Support]
  Database Dir:       [/Users/stephenh/Library/Application Support/Plex Media Server/Plug-in Support/Databases]
  Database Temp Dir:  [/Users/stephenh/Library/Application Support/Plex Media Server/Plug-in Support/Databases/dbtmp]
  Main DB Path:       [/Users/stephenh/Library/Application Support/Plex Media Server/Plug-in Support/Databases/com.plexapp.plugins.library.db]
  Blobs DB Path:      [/Users/stephenh/Library/Application Support/Plex Media Server/Plug-in Support/Databases/com.plexapp.plugins.library.blobs.db]
  Cache Dir:          [/Users/stephenh/Library/Caches/PlexMediaServer/PhotoTranscoder]
  Log File:           [/Users/stephenh/Library/Application Support/Plex Media Server/Plug-in Support/Databases/DBRepair.log]
  Pid File:           []
  Temp Dir (Local):   [/tmp]
  System Temp:        [/tmp]

  Script Name:        []
  Script Path:        []
  Working Dir:        []

  Sqlite3 Cache Size  [0]
  Sqlite3 Page Size   [0]
  DBRepair Notify Cmd []
 
  Pidof Utility:      [pgrep]
  FTS Query:          [SELECT name FROM sqlite_master WHERE sql LIKE '%FTS%';]
  Have Start/Stop:    (Yes)
  Start Command:      [TMPDIR=/tmp osascript -e 'tell app "Plex Media Server" to launch']
  Stop Command:       [TMPDIR=/tmp osascript -e 'tell app "Plex Media Server" to quit']
------------------------------------------------------


Select

  1 - 'stop'      - Stop PMS.
  3 - 'check'     - Perform integrity check of database and FTS indexes.
  5 - 'repair'    - Repair/Optimize databases.
  7 - 'start'     - Start PMS

 10 - 'show'      - Show logfile.
 11 - 'status'    - Report status of PMS (run-state and databases).

 21 - 'prune'     - Remove old image files from PhotoTranscoder cache & all temp files left by PMS.
 42 - 'ignore'    - Ignore duplicate/constraint errors.

 98 - 'quit'      - Quit immediately.  Keep all temporary files.
 99 - 'exit'      - Exit with cleanup options.

Enter command # -or- command name (4 char min) : show
 
Displaying Session Log: /Users/stephenh/Library/Application Support/Plex Media Server/Plug-in Support/Databases/DBRepair.log
------------------------------------------------------------
2026-07-09 17.17.39 - ============================================================
2026-07-09 17.17.39 - Session start. Thu Jul  9 17:17:39 2026
2026-07-09 17.17.39 - ============================================================
2026-07-09 17.17.48 - RunSysCmd executing: 'TMPDIR=/tmp osascript -e 'tell app "Plex Media Server" to quit''
2026-07-09 17.17.48 - RunSysCmd: Command exited with status 0
2026-07-09 17.17.54 - Stop - PASS
2026-07-09 17.17.57 - CheckDB - Checking basic integrity - /Users/stephenh/Library/Application Support/Plex Media Server/Plug-in Support/Databases/com.plexapp.plugins.library.db
2026-07-09 17.17.58 - CheckDB - FAIL - /Users/stephenh/Library/Application Support/Plex Media Server/Plug-in Support/Databases/com.plexapp.plugins.library.db: malformed inverted index for FTS4 table main.fts4_metadata_titles_icu
2026-07-09 17.17.58 - CheckDB - Checking Indexes and FTS tables - /Users/stephenh/Library/Application Support/Plex Media Server/Plug-in Support/Databases/com.plexapp.plugins.library.db
2026-07-09 17.17.58 - CheckDB - Main DB: FTS Shadow table missing - fts4_metadata_titles_content
2026-07-09 17.17.58 - CheckDB - Main DB: FTS Shadow table missing - fts4_tag_titles_content
2026-07-09 17.17.58 - CheckDB - Main DB: FTS Shadow table missing - fts4_metadata_titles_icu_content
2026-07-09 17.17.58 - CheckDB - Main DB: FTS Shadow table missing - fts4_tag_titles_icu_content
2026-07-09 17.17.58 - CheckDB - Full check complete - /Users/stephenh/Library/Application Support/Plex Media Server/Plug-in Support/Databases/com.plexapp.plugins.library.db
2026-07-09 17.17.58 - Check   - Check /Users/stephenh/Library/Application Support/Plex Media Server/Plug-in Support/Databases/com.plexapp.plugins.library.db DB - FAIL
2026-07-09 17.17.58 - CheckDB - Checking basic integrity - /Users/stephenh/Library/Application Support/Plex Media Server/Plug-in Support/Databases/com.plexapp.plugins.library.blobs.db
2026-07-09 17.17.58 - CheckDB - Checking Indexes and FTS tables - /Users/stephenh/Library/Application Support/Plex Media Server/Plug-in Support/Databases/com.plexapp.plugins.library.blobs.db
2026-07-09 17.17.58 - CheckDB - Blobs DB: FTS Shadow table missing - fts4_metadata_titles_content
2026-07-09 17.17.58 - CheckDB - Blobs DB: FTS Shadow table missing - fts4_tag_titles_content
2026-07-09 17.17.58 - CheckDB - Blobs DB: FTS Shadow table missing - fts4_metadata_titles_icu_content
2026-07-09 17.17.58 - CheckDB - Blobs DB: FTS Shadow table missing - fts4_tag_titles_icu_content
2026-07-09 17.17.58 - CheckDB - Full check complete - /Users/stephenh/Library/Application Support/Plex Media Server/Plug-in Support/Databases/com.plexapp.plugins.library.blobs.db
2026-07-09 17.17.58 - Check   - Check Blobs DB - FAIL
2026-07-09 17.17.58 - Check   - FAIL
2026-07-09 17.17.58 - Check   - CheckFTS Main DB - START
2026-07-09 17.17.58 - Main DB: FTS Check: Check   - MISSING
2026-07-09 17.17.58 - GetSqlOutput - Prepare FAIL: table spellfix_metadata_titles has no column named spellfix_metadata_titles
2026-07-09 17.17.58 - Check   - FTS Check: spellfix_metadata_titles - PASS
2026-07-09 17.17.58 - GetSqlOutput - Prepare FAIL: table spellfix_tag_titles has no column named spellfix_tag_titles
2026-07-09 17.17.58 - Check   - FTS Check: spellfix_tag_titles - PASS
2026-07-09 17.17.58 - Check   - FTS Check: fts4_metadata_titles - PASS
2026-07-09 17.17.58 - Check   - FTS Check: fts4_tag_titles - PASS
2026-07-09 17.17.58 - Check   - FTS Check: fts4_metadata_titles_icu - PASS
2026-07-09 17.17.58 - Check   - FTS Check: fts4_tag_titles_icu - PASS
2026-07-09 17.17.58 - Check   - CheckFTS Blobs DB - START
2026-07-09 17.17.58 - Blobs DB: FTS Check: Check   - MISSING
2026-07-09 17.17.58 - GetSqlOutput - Prepare FAIL: table spellfix_metadata_titles has no column named spellfix_metadata_titles
2026-07-09 17.17.58 - Check   - FTS Check: spellfix_metadata_titles - PASS
2026-07-09 17.17.58 - GetSqlOutput - Prepare FAIL: table spellfix_tag_titles has no column named spellfix_tag_titles
2026-07-09 17.17.58 - Check   - FTS Check: spellfix_tag_titles - PASS
2026-07-09 17.17.58 - Check   - FTS Check: fts4_metadata_titles - PASS
2026-07-09 17.17.58 - Check   - FTS Check: fts4_tag_titles - PASS
2026-07-09 17.17.58 - Check   - FTS Check: fts4_metadata_titles_icu - PASS
2026-07-09 17.17.58 - Check   - FTS Check: fts4_tag_titles_icu - PASS
2026-07-09 17.18.08 - Repair  - START
2026-07-09 17.18.08 - CheckDB - Checking basic integrity - /Users/stephenh/Library/Application Support/Plex Media Server/Plug-in Support/Databases/dbtmp/com.plexapp.plugins.library.db-DBREPAIR-2026-07-09_17.18.08
2026-07-09 17.18.08 - CheckDB - Checking basic integrity - /Users/stephenh/Library/Application Support/Plex Media Server/Plug-in Support/Databases/dbtmp/com.plexapp.plugins.library.db-DBREPAIR-2026-07-09_17.18.08
2026-07-09 17.18.09 - FTSRebuild - Rebuilt fts4_metadata_titles
2026-07-09 17.18.09 - FTSRebuild - Rebuilt fts4_tag_titles
2026-07-09 17.18.09 - Recreating missing virtual table from fallback: locations
2026-07-09 17.18.09 - Error: Failed to create virtual table locations from fallback schema.
2026-07-09 17.18.09 - FTSRebuild - Rebuilt fts4_metadata_titles_icu
2026-07-09 17.18.09 - FTSRebuild - Rebuilt fts4_tag_titles_icu
2026-07-09 17.18.09 - Repair  - SUCCESS - Main DB Pipeline Complete
2026-07-09 17.18.09 - CheckDB - Checking basic integrity - /Users/stephenh/Library/Application Support/Plex Media Server/Plug-in Support/Databases/dbtmp/com.plexapp.plugins.library.blobs.db-DBREPAIR-2026-07-09_17.18.08
2026-07-09 17.18.09 - CheckDB - Checking basic integrity - /Users/stephenh/Library/Application Support/Plex Media Server/Plug-in Support/Databases/dbtmp/com.plexapp.plugins.library.blobs.db-DBREPAIR-2026-07-09_17.18.08
2026-07-09 17.18.10 - FTSRebuild - Rebuilt fts4_metadata_titles
2026-07-09 17.18.10 - FTSRebuild - Rebuilt fts4_tag_titles
2026-07-09 17.18.10 - Recreating missing virtual table from fallback: locations
2026-07-09 17.18.10 - Error: Failed to create virtual table locations from fallback schema.
2026-07-09 17.18.10 - FTSRebuild - Rebuilt fts4_metadata_titles_icu
2026-07-09 17.18.10 - FTSRebuild - Rebuilt fts4_tag_titles_icu
2026-07-09 17.18.10 - Repair  - SUCCESS - Blobs DB Pipeline Complete
2026-07-09 17.18.10 - Repair  - PUSH - Saved state to stack (Timestamp: 2026-07-09_17.18.08)
2026-07-09 17.18.10 - Repair  - MakeActive - Main DB updated to live (Timestamp: 2026-07-09_17.18.08)
2026-07-09 17.18.10 - Repair  - MakeActive - Blobs DB updated to live (Timestamp: 2026-07-09_17.18.08)
2026-07-09 17.18.10 - Repair  - COMPLETED (Active Timestamp: 2026-07-09_17.18.08)
2026-07-09 17.18.15 - CheckDB - Checking basic integrity - /Users/stephenh/Library/Application Support/Plex Media Server/Plug-in Support/Databases/com.plexapp.plugins.library.db
2026-07-09 17.18.15 - CheckDB - Checking Indexes and FTS tables - /Users/stephenh/Library/Application Support/Plex Media Server/Plug-in Support/Databases/com.plexapp.plugins.library.db
2026-07-09 17.18.15 - CheckDB - Main DB: FTS Shadow table missing - fts4_metadata_titles_content
2026-07-09 17.18.15 - CheckDB - Main DB: FTS Shadow table missing - fts4_tag_titles_content
2026-07-09 17.18.15 - CheckDB - Main DB: FTS Shadow table missing - fts4_metadata_titles_icu_content
2026-07-09 17.18.15 - CheckDB - Main DB: FTS Shadow table missing - fts4_tag_titles_icu_content
2026-07-09 17.18.15 - CheckDB - Full check complete - /Users/stephenh/Library/Application Support/Plex Media Server/Plug-in Support/Databases/com.plexapp.plugins.library.db
2026-07-09 17.18.15 - Check   - Check /Users/stephenh/Library/Application Support/Plex Media Server/Plug-in Support/Databases/com.plexapp.plugins.library.db DB - FAIL
2026-07-09 17.18.15 - CheckDB - Checking basic integrity - /Users/stephenh/Library/Application Support/Plex Media Server/Plug-in Support/Databases/com.plexapp.plugins.library.blobs.db
2026-07-09 17.18.15 - CheckDB - Checking Indexes and FTS tables - /Users/stephenh/Library/Application Support/Plex Media Server/Plug-in Support/Databases/com.plexapp.plugins.library.blobs.db
2026-07-09 17.18.15 - CheckDB - Blobs DB: FTS Shadow table missing - fts4_metadata_titles_content
2026-07-09 17.18.15 - CheckDB - Blobs DB: FTS Shadow table missing - fts4_tag_titles_content
2026-07-09 17.18.15 - CheckDB - Blobs DB: FTS Shadow table missing - fts4_metadata_titles_icu_content
2026-07-09 17.18.15 - CheckDB - Blobs DB: FTS Shadow table missing - fts4_tag_titles_icu_content
2026-07-09 17.18.15 - CheckDB - Full check complete - /Users/stephenh/Library/Application Support/Plex Media Server/Plug-in Support/Databases/com.plexapp.plugins.library.blobs.db
2026-07-09 17.18.15 - Check   - Check Blobs DB - FAIL
2026-07-09 17.18.15 - Check   - FAIL
2026-07-09 17.18.15 - Check   - CheckFTS Main DB - START
2026-07-09 17.18.15 - Main DB: FTS Check: Check   - MISSING
2026-07-09 17.18.15 - GetSqlOutput - Prepare FAIL: table spellfix_metadata_titles has no column named spellfix_metadata_titles
2026-07-09 17.18.15 - Check   - FTS Check: spellfix_metadata_titles - PASS
2026-07-09 17.18.15 - GetSqlOutput - Prepare FAIL: table spellfix_tag_titles has no column named spellfix_tag_titles
2026-07-09 17.18.15 - Check   - FTS Check: spellfix_tag_titles - PASS
2026-07-09 17.18.15 - Check   - FTS Check: fts4_metadata_titles - PASS
2026-07-09 17.18.15 - Check   - FTS Check: fts4_tag_titles - PASS
2026-07-09 17.18.16 - Check   - FTS Check: fts4_metadata_titles_icu - PASS
2026-07-09 17.18.16 - Check   - FTS Check: fts4_tag_titles_icu - PASS
2026-07-09 17.18.16 - Check   - CheckFTS Blobs DB - START
2026-07-09 17.18.16 - Blobs DB: FTS Check: Check   - MISSING
2026-07-09 17.18.16 - GetSqlOutput - Prepare FAIL: table spellfix_metadata_titles has no column named spellfix_metadata_titles
2026-07-09 17.18.16 - Check   - FTS Check: spellfix_metadata_titles - PASS
2026-07-09 17.18.16 - GetSqlOutput - Prepare FAIL: table spellfix_tag_titles has no column named spellfix_tag_titles
2026-07-09 17.18.16 - Check   - FTS Check: spellfix_tag_titles - PASS
2026-07-09 17.18.16 - Check   - FTS Check: fts4_metadata_titles - PASS
2026-07-09 17.18.16 - Check   - FTS Check: fts4_tag_titles - PASS
2026-07-09 17.18.16 - Check   - FTS Check: fts4_metadata_titles_icu - PASS
2026-07-09 17.18.16 - Check   - FTS Check: fts4_tag_titles_icu - PASS
------------------------------------------------------------

Select

  1 - 'stop'      - Stop PMS.
  3 - 'check'     - Perform integrity check of database and FTS indexes.
  5 - 'repair'    - Repair/Optimize databases.
  7 - 'start'     - Start PMS

 10 - 'show'      - Show logfile.
 11 - 'status'    - Report status of PMS (run-state and databases).

 21 - 'prune'     - Remove old image files from PhotoTranscoder cache & all temp files left by PMS.
 42 - 'ignore'    - Ignore duplicate/constraint errors.

 98 - 'quit'      - Quit immediately.  Keep all temporary files.
 99 - 'exit'      - Exit with cleanup options.

Enter command # -or- command name (4 char min) : exit
 
Remove temporary databases/workfiles? (y/N): y
Deleting temporary work files.

Saving session...
...copying shared history...
...saving history...truncating history files...
...completed.

[Process completed]


Cheers,

@StephenH

Thank you for trying it out.

Did you run REPAIR or Reindex ?

REPAIR is the correct correction. Thanks for catching that bad message.

The fact it knows “locations” is missing means it also knows how to add it.
(why I did it this way)

I will work through these two discrepancies

2026-07-09 17.17.58 - Main DB: FTS Check: Check   - MISSING
2026-07-09 17.17.58 - GetSqlOutput - Prepare FAIL: table spellfix_metadata_titles has no column named spellfix_metadata_titles
2026-07-09 17.17.58 - Check   - FTS Check: spellfix_metadata_titles - PASS
2026-07-09 17.17.58 - GetSqlOutput - Prepare FAIL: table spellfix_tag_titles has no column named spellfix_tag_titles
2026-07-09 17.17.58 - Check   - FTS Check: spellfix_tag_titles - PASS
2026-07-09 17.17.58 - Check   - FTS Check: fts4_metadata_titles - PASS

It looks like I made a mistake with repopulating the spellfix tables.
I’ll work on that today.

You should have a working FTS search (searching works and is quick).

PMS should rebuild the locations table but the point here is that I should be doing it so PMS doesn’t need to.

I worked on things last night and got more work done.
I’ll work on this today.

I’ll have a 0.1999.02 as soon as possible. (Today?)

when ran thur cmd line on native win 11 pro build 22631

ERROR: Cannot write to Databases directory. Insufficient privilege.
ERROR: Unable to initialise DBRepair. Aborting.

ran as admin with full rights both with plex open and closed maybe if intended use was wrong include first use instructions in the readme file

@lordmage

What can you tell me about where the Plex directories are ?

I use APPDATA/LOCAL then APPDATA/ROAMING.

Can you help me identify what I’m missing here?
( I tested on Win 11 Pro, PMS installed on C:, Run from C: )

// Windows host
  } else if (H.UserInfo.Os == 2) {

    // Determine if local or roaming
    H.AppSuppDir[0]='\0';
    setString(TestDir, "%s/%s", H.UserInfo.HomeDir,"/AppData/Local/Plex Media Server");
    if (isDir(TestDir)) {
      setString(H.AppSuppDir,"%s/%s",H.UserInfo.HomeDir,"/AppData/Local");
    } else {
      setString(TestDir,"%s/%s",H.UserInfo.HomeDir,"/AppData/Roaming/Plex Media Server");
      if (isDir(TestDir)) {
        setString(H.AppSuppDir,"%s/%s",H.UserInfo.HomeDir,"/AppData/Roaming");
      }
    }
    if ( *H.AppSuppDir && isDir(H.AppSuppDir)) {
      // Window PMS server
      setString(H.HostType,"Windows");
      setString(H.AppSuppDir,"%s/%s/AppData/Local",H.UserInfo.HomeDir);
      setString(H.DbDir, "%s/Plex Media Server/Plug-in Support/Databases", H.AppSuppDir);
      setString(H.DbTmp, "%s/dbtmp", H.DbDir);
      setString(H.CacheDir, "%s/Plex Media Server/Cache/PhotoTranscoder", H.AppSuppDir);
      setString(H.PidFile, "%s/Plex Media Server/plexmediaserver.pid", H.AppSuppDir);
      setString(H.LogFile, "%s/DBRepair.log", H.DbDir);

      // Full Database Path Construction
      setString(H.MainDb.Path, "%s/com.plexapp.plugins.library.db", H.DbDir);
      setString(H.BlobsDb.Path, "%s/com.plexapp.plugins.library.blobs.db", H.DbDir);

      H.RootRequired  = false;
      H.HaveStartStop = false;

      // questionable to use TMP this way
      strcpy(H.TmpDir,getenv("TMP"));
      strcpy(H.SysTmp,getenv("TMP"));

      // Good news
      return true;
    }

  }

Finding Windows path for PMS, using windows build-in reg query

Windows_PMS.zip (141.2 KB)

@ChuckPa Just confirming I ran “Repair”.

In fact I ran Stop, Check, Repair, Check as shown in my 2nd long code block in my last message above.

C:\Users\Username\AppData\Local\Plex Media Server the program may not be asking for write privilege correctly for a win11 program

i tried to run the code you have this was At line:2 char:3

  • } else if (H.UserInfo.Os == 2) {
  • ~
    Unexpected token ‘}’ in expression or statement.
    At line:6 char:22
  • setString(TestDir, "%s/%s", H.UserInfo.HomeDir,"/AppData/Local/Pl ...
    
  •                  ~
    

Missing argument in parameter list.
At line:8 char:29

  •   setString(H.AppSuppDir,"%s/%s",H.UserInfo.HomeDir,"/AppData/Loc ...
    
  •                         ~
    

Missing argument in parameter list.
At line:10 char:24

  •   setString(TestDir,"%s/%s",H.UserInfo.HomeDir,"/AppData/Roaming/ ...
    
  •                    ~
    

Missing argument in parameter list.
At line:12 char:31

  •     setString(H.AppSuppDir,"%s/%s",H.UserInfo.HomeDir,"/AppData/R ...
    
  •                           ~
    

Missing argument in parameter list.
At line:15 char:24

  • if ( *H.AppSuppDir && isDir(H.AppSuppDir)) {
    
  •                    ~~
    

The token ‘&&’ is not a valid statement separator in this version.
At line:17 char:27

  •   setString(H.HostType,"Windows");
    
  •                       ~
    

Missing argument in parameter list.
At line:18 char:29

  •   setString(H.AppSuppDir,"%s/%s/AppData/Local",H.UserInfo.HomeDir ...
    
  •                         ~
    

Missing argument in parameter list.
At line:19 char:24

  •   setString(H.DbDir, "%s/Plex Media Server/Plug-in Support/Databa ...
    
  •                    ~
    

Missing argument in parameter list.
At line:20 char:24

  •   setString(H.DbTmp, "%s/dbtmp", H.DbDir);
    
  •                    ~
    

Missing argument in parameter list.
Not all parse errors were reported. Correct the reported errors and try again.

  • CategoryInfo : ParserError: (:slight_smile: , ParentContainsErrorRecordException
  • FullyQualifiedErrorId : UnexpectedToken

PS C:\Users\Lord>

Is there full source available for this, @ChuckPa ?

Source is not yet available.

It is still development work.

@lordmage

Looking at your post is a unexpected.

Are you attempting to run the “DBRepair.exe” file from the ZIP or a different file and, if so, which file?

Did you try to run this in powershell ?

Would you mind using Powershell and share the FileHash?

Get-FileHash -Path "filename" -Algorithm SHA256

SHA256 92EF1FD06B80A6DF8ED120F0B8103569A9DC4E209219AAE9C45DB90716223410 C:\Users\Lord\DBrepair.exe

all attempts to run have actually been a cmd window as you should for a non-gui.exe file but also tried powershell as well for the code originally requested here > DBRepair development - #1002 by ChuckPa

Side note maybe caused by something causing the folder to autoset read only

also i was able to run the old .bat version which did work with no errors

11:50:14.27 --  ====== Session begins. (Fri 07/10/2026) ====== 
11:50:14.36 -- Performing DB cleanup tasks 
11:50:14.41 --  Exporting Main DB 
11:50:17.27 --  Exporting Blobs DB 
11:50:24.41 --  Exporting Complete. 
11:50:24.41 --  Creating Main DB 
11:50:25.57 --  Verifying Main DB 
11:50:25.81 --  Main DB verification check is: ok 
11:50:25.81 --  Main DB verification successful. 
11:50:25.82 --  Creating Blobs DB 
11:50:27.29 --  Verifying Blobs DB 
11:50:27.44 --  Blobs DB verification check is: ok 
11:50:27.44 --  Blobs DB verification successful. 
11:50:27.45 --  Import and verification complete. 
11:50:27.46 --  Reindexing Main DB 
11:50:27.77 --  Reindexing Blobs DB 
11:50:28.01 --  Reindexing complete. 
11:50:28.02 --  Moving current DBs to DBTMP and making new databases active 
11:50:28.03 --  Database repair/rebuild/reindex completed. 
11:50:28.03 --  ====== Session completed. ======

@lordmage

I figured out (thanks to @dane22) what the issue was.

Windows requires a .rc embedded in the executable, built from a .manifest file.

I did not have that. I don’t understand why it works here for me but not you.

Today, I added the Manifest/rc to the binary. It runs in the VM with no issues.

I did just start testing it and found another issue with Windows (UGH)
I’ll resolve that now.