January 11Jan 11 YOU ARE RESPONSIBLE FOR YOUR OWN DATA.This container runs a database repair tool that modifies your Plex SQLite database. Always ensure you have working backups before proceeding.About This Container, This Docker container is provided to assist users in running the Plex database repair tool to resolve common Plex database issues. It original design was to wrap and automates the excellent repair script created by ChuckPa. Due to scripting issues and the way their script worked. We used the main utility from their script. more info can be found on Plex support page with managing the sqlite database.Project: https://github.com/ChuckPa/DBRepair Please review the main project documentation to understand what the tool does and when it should be used.What This Container DoesRuns DBRepair.sh adjacent code inside a controlled Docker environmentWrites a persistent log file and mirrors output to Docker logsExits automatically when the repair completesif variables enabled, it will also:backup (file copy) the current database.stop other plex dockers from runningwith unraid variables for prune picture cache and db file restore(if you used this docker to make the backup...) Edited January 16Jan 16 by bmartino1 Appologies due to scirpting errors on my end and with main scirpt during main release
January 11Jan 11 Author DBREPAIR_MODEDefault: automaticDescription:Selects which Plex database maintenance operation to run.All modes operate directly on the mounted Plex database directory using Debian sqlite3.Unless otherwise noted, Plex containers will be stopped before execution and restarted afterward (if enabled).ValueMenu #Action Descriptionautomatic2Full maintenance run: Integrity check → Repair/Optimize (VACUUM) → Reindexcheck3Perform SQLite integrity check only (no changes made)vacuum4Vacuum databases to reclaim unused spacerepair5Repair / optimize databases (VACUUM)reindex6Rebuild all database indexesthis requires setting a few things. By default, automatic will run unless the variable is passed.to assist with plex kill. (as plex NEEDS TO BE STOPPED BEFORE EDITING ITS DATABASE!!!)For the Docker Variable Plex_Container_Match:it is best to give your dockers plex repository image... example pulled form the Unraid tempalte or docker name*Or stop them yourself and run the docker... setting the options to false (true by default...)We also need to mount the Plex Folder structure. I have my plex media on a zfs share per example we want the docker to show /config/Library/...example we must mount the plex nested folder "Library folder here"parts of the prune script and others are implemented that need access to the cached folder... (original script only wanted the nested database folder.): "${PLEX_MOUNT:=/config}": "${PLEX_REL:=Library/Application Support/Plex Media Server}"AS I try to make universal dockers while unraid designed I try to accommodate other systems... as such if your folder structure is non default...you can call the variable "PLEX_REL" to complete the nested folders If non default... so the docker can still access correct pathing.the goal was to reliably add the appdata folder that contains Library to the Plex Media Server to target the needed files and other locations...the log file will be in the database folder. Including a subfolder backup:Example:Where logging happens: /mnt/user/Dockers/Plex/database/Library/Application Support/Plex Media Server/Plug-in Support/Databases# cat dbrepair-docker-*.log Per the Timestamproot@BMM-Tower:/mnt/user/Dockers/Plex/database/Library/Application Support/Plex Media Server/Plug-in Support/Databases# cat dbrepair-docker-2026-01-13_17-17-07.log [2026-01-13 17:17:07] ==================================================[2026-01-13 17:17:07] Plex DBRepair – Native Docker[2026-01-13 17:17:07] ==================================================[2026-01-13 17:17:07] Mode : automatic[2026-01-13 17:17:07] Plex Root : /config/Library/Application Support/Plex Media Server[2026-01-13 17:17:07] Databases : /config/Library/Application Support/Plex Media Server/Plug-in Support/Databases[2026-01-13 17:17:07] SQLite : /usr/lib/plexmediaserver/Plex SQLite (plex)[2026-01-13 17:17:07] Backups Enabled : false[2026-01-13 17:17:07] Restore Last Backup : false[2026-01-13 17:17:07] ==================================================[2026-01-13 17:17:07] Stopping Plex containers (match: plex)[2026-01-13 17:17:07] ==================================================[2026-01-13 17:17:07] Skipping excluded container: dbrepair[2026-01-13 17:17:07] Stopping Plex container: plex (3249418f44b5)[2026-01-13 17:17:11] ==================================================[2026-01-13 17:17:11] Automatic (check → vacuum → reindex)[2026-01-13 17:17:11] ==================================================[2026-01-13 17:17:11] Backups disabled — skipping[2026-01-13 17:17:11] Check : com.plexapp.plugins.library.dbok[2026-01-13 17:17:17] Check : com.plexapp.plugins.library.blobs.dbok[2026-01-13 17:17:43] Vacuum : com.plexapp.plugins.library.db[2026-01-13 17:17:56] Vacuum : com.plexapp.plugins.library.blobs.db[2026-01-13 17:18:46] Reindex : com.plexapp.plugins.library.db[2026-01-13 17:18:56] Reindex : com.plexapp.plugins.library.blobs.db[2026-01-13 17:19:03] ==================================================[2026-01-13 17:19:03] DBRepair completed[2026-01-13 17:19:03] Log : /config/Library/Application Support/Plex Media Server/Plug-in Support/Databases/dbrepair-docker-2026-01-13_17-17-07.log[2026-01-13 17:19:03] Backups : /config/Library/Application Support/Plex Media Server/Plug-in Support/Databases/dbrepair-backups[2026-01-13 17:19:03] ==================================================[2026-01-13 17:19:03] ==================================================[2026-01-13 17:19:03] Restarting Plex containers[2026-01-13 17:19:03] ==================================================[2026-01-13 17:19:03] Started: 3249418f44b5root@BMM-Tower:/mnt/user/Dockers/Plex/database/Library/Application Support/Plex Media Server/Plug-in Support/Databases# Edited January 16Jan 16 by bmartino1 Updates on how its runs what it should look like...
January 12Jan 12 Author On 1/11/2026 at 5:23 PM, bmartino1 said:DBREPAIR_MODEDefault: automaticDescription:Selects which Plex database maintenance operation to run.All modes operate directly on the mounted Plex database directory using Debian sqlite3.Unless otherwise noted, Plex containers will be stopped before execution and restarted afterward (if enabled).ValueMenu #Action Descriptionautomatic2Full maintenance run: Integrity check → Repair/Optimize (VACUUM) → Reindexcheck3Perform SQLite integrity check only (no changes made)vacuum4Vacuum databases to reclaim unused spacerepair5Repair / optimize databases (VACUUM)reindex6Rebuild all database indexesthis requires setting a few things. By default, automatic will run unless the variable is passed.to assist with plex kill. (as plex NEEDS TO BE STOPPED BEFORE EDITING ITS DATABASE!!!)For the Docker Variable Plex_Container_Match:it is best to give your dockers plex repository image... example pulled form the Unraid tempalte or docker name*Or stop them yourself and run the docker... setting the options to false (true by default...)We also need to mount the Plex Folder structure. I have my plex media on a zfs share per example we want the docker to show /config/Library/...example we must mount the plex nested folder "Library folder here"parts of the prune script and others are implemented that need access to the cached folder... (original script only wanted the nested database folder.): "${PLEX_MOUNT:=/config}": "${PLEX_REL:=Library/Application Support/Plex Media Server}"AS I try to make universal dockers while unraid designed I try to accommodate other systems... as such if your folder structure is non default...you can call the variable "PLEX_REL" to complete the nested folders If non default... so the docker can still access correct pathing.the goal was to reliably add the appdata folder that contains Library to the Plex Media Server to target the needed files and other locations...the log file will be in the database folder. Including a subfolder backup:Example:Where logging happens: /mnt/user/Dockers/Plex/database/Library/Application Support/Plex Media Server/Plug-in Support/Databases# cat dbrepair-docker-*.log Per the Timestamproot@BMM-Tower:/mnt/user/Dockers/Plex/database/Library/Application Support/Plex Media Server/Plug-in Support/Databases# cat dbrepair-docker-2026-01-13_17-17-07.log[2026-01-13 17:17:07] ==================================================[2026-01-13 17:17:07] Plex DBRepair – Native Docker[2026-01-13 17:17:07] ==================================================[2026-01-13 17:17:07] Mode : automatic[2026-01-13 17:17:07] Plex Root : /config/Library/Application Support/Plex Media Server[2026-01-13 17:17:07] Databases : /config/Library/Application Support/Plex Media Server/Plug-in Support/Databases[2026-01-13 17:17:07] SQLite : /usr/lib/plexmediaserver/Plex SQLite (plex)[2026-01-13 17:17:07] Backups Enabled : false[2026-01-13 17:17:07] Restore Last Backup : false[2026-01-13 17:17:07] ==================================================[2026-01-13 17:17:07] Stopping Plex containers (match: plex)[2026-01-13 17:17:07] ==================================================[2026-01-13 17:17:07] Skipping excluded container: dbrepair[2026-01-13 17:17:07] Stopping Plex container: plex (3249418f44b5)[2026-01-13 17:17:11] ==================================================[2026-01-13 17:17:11] Automatic (check → vacuum → reindex)[2026-01-13 17:17:11] ==================================================[2026-01-13 17:17:11] Backups disabled — skipping[2026-01-13 17:17:11] Check : com.plexapp.plugins.library.dbok[2026-01-13 17:17:17] Check : com.plexapp.plugins.library.blobs.dbok[2026-01-13 17:17:43] Vacuum : com.plexapp.plugins.library.db[2026-01-13 17:17:56] Vacuum : com.plexapp.plugins.library.blobs.db[2026-01-13 17:18:46] Reindex : com.plexapp.plugins.library.db[2026-01-13 17:18:56] Reindex : com.plexapp.plugins.library.blobs.db[2026-01-13 17:19:03] ==================================================[2026-01-13 17:19:03] DBRepair completed[2026-01-13 17:19:03] Log : /config/Library/Application Support/Plex Media Server/Plug-in Support/Databases/dbrepair-docker-2026-01-13_17-17-07.log[2026-01-13 17:19:03] Backups : /config/Library/Application Support/Plex Media Server/Plug-in Support/Databases/dbrepair-backups[2026-01-13 17:19:03] ==================================================[2026-01-13 17:19:03] ==================================================[2026-01-13 17:19:03] Restarting Plex containers[2026-01-13 17:19:03] ==================================================[2026-01-13 17:19:03] Started: 3249418f44b5root@BMM-Tower:/mnt/user/Dockers/Plex/database/Library/Application Support/Plex Media Server/Plug-in Support/Databases#Plex DB Repair Docker for UnraidForum-ready second-post guide for the Plex DBRepair Docker template.This container is meant as a quick “run it and stop” helper for common Plex SQLite database problems. It starts, performs the selected maintenance or repair task, writes logs, optionally makes backups, optionally restarts Plex, and then exits.This is intended as a stop-gap and convenience wrapper so less technical users can run the needed Plex SQLite repair commands without manually entering a container, finding the Plex database path, and running the commands by hand.Important: Plex must be stopped before editing or repairing its database. This container can stop and restart your Plex Docker automatically when configured correctly, but you can also stop Plex manually before running DBRepair.Basic Unraid usageInstall the container from Community Apps / template.Mount your Plex appdata folder so the container can see the full Plex nested folder structure.Leave DBREPAIR_MODE=automatic for the normal repair run.Set PLEX_CONTAINER_MATCH so DBRepair can find your Plex container.Start the DBRepair container.Wait for it to finish and stop.Check the Unraid Docker log or the saved log file in the Plex database folder.Recommended first runFor most users trying to fix a corrupted or unhealthy Plex database, use:DBREPAIR_MODE=automatic ALLOW_PLEX_KILL=true PLEX_CONTAINER_MATCH=plex RESTART_PLEX=true ENABLE_BACKUPS=true RESTORE_LAST_BACKUP=falseThe automatic mode runs:integrity check → VACUUM / repair → reindexRequired mountsPlex appdataThe container needs access to the Plex appdata folder, not just the database files.Host path: /mnt/user/appdata/plex Container path: /config Access mode: Read/WriteInside the DBRepair container, this path must exist:/config/Library/Application Support/Plex Media Server/Plug-in Support/DatabasesThis full path matters because some modes, such as PhotoTranscoder pruning, need access to more than just the database folder.Docker socketThe Docker socket is only required if you want DBRepair to stop and restart Plex automatically.Host path: /var/run/docker.sock Container path: /var/run/docker.sock Access mode: Read/WriteIf you do not mount the Docker socket, set:ALLOW_PLEX_KILL=false RESTART_PLEX=falseThen manually stop Plex before running the container.Plex container matchingPLEX_CONTAINER_MATCH is used to find the Plex Docker container that should be stopped before repair.PLEX_CONTAINER_MATCH=plexThis is a case-insensitive substring match against the Plex container name and image name.Good examples:plex Plex-Media-Server plexinc/pms-docker linuxserver/plex binhex/arch-plexBest practice: use either your actual Plex container name or the Plex image/repository name from your Unraid template. If the DBRepair container cannot find Plex, stop Plex yourself first.Environment variablesVariableDefaultDescriptionDBREPAIR_MODEautomaticOperation to run. See mode list below.ALLOW_PLEX_KILLtrueAllows the container to stop Plex before database work.PLEX_CONTAINER_MATCHplexName/image match used to find the Plex container.RESTART_PLEXtrueRestart Plex after DBRepair finishes.ENABLE_BACKUPStrueMake file-copy backups before write operations.RESTORE_LAST_BACKUPfalseRestore the most recent DBRepair backup and exit.PRUNE_DAYS30Days to keep PhotoTranscoder cache files when using prune mode.TZunsetTimezone for logs and timestamps. Example: America/Chicago.EXCLUDE_CONTAINER_NAMESdbrepair,plex-dbrepairContainer names that should never be stopped.EXCLUDE_IMAGE_REGEXplex-dbrepairImage regex excluded from stop matching, mainly to prevent the container from killing itself.DBREPAIR_MODE optionsOnly use one mode at a time. If the value is missing or invalid, the container falls back to automatic.ModeActionautomaticFull maintenance run: integrity check → VACUUM / repair → reindex.checkSQLite integrity check only. No changes made.vacuumVacuum databases to reclaim unused space.repairRepair / optimize databases using VACUUM.reindexRebuild database indexes.deflateRewrite database using VACUUM INTO for full compaction.pruneDelete old Plex PhotoTranscoder cache files older than PRUNE_DAYS.manualStart an interactive/manual container shell for testing or advanced use.BackupsENABLE_BACKUPS=true makes a file-copy backup of the Plex database files before write operations.Backups are stored under the Plex database folder:/config/Library/Application Support/Plex Media Server/Plug-in Support/Databases/dbrepair-backupsThis includes Plex database files and related WAL/SHM files when present. This is helpful, but it is not a replacement for a proper Unraid Appdata backup.Restore last DBRepair backupTo restore the most recent backup made by this container:RESTORE_LAST_BACKUP=trueWhen this is enabled, the container restores the newest backup from dbrepair-backups and exits. No normal repair mode is run when restore is enabled. RESTORE_LAST_BACKUP=true overrides DBREPAIR_MODE.After restore, set it back to:RESTORE_LAST_BACKUP=falsePhotoTranscoder cache pruneThe container can also be used to clear old Plex PhotoTranscoder cache files.DBREPAIR_MODE=prune PRUNE_DAYS=30Example:DBREPAIR_MODE=prune PRUNE_DAYS=14That keeps the last 14 days and removes older cache files.Where logs are savedA timestamped log is written inside the Plex database folder:/config/Library/Application Support/Plex Media Server/Plug-in Support/Databases/dbrepair-docker-YYYY-MM-DD_HH-MM-SS.logExample Unraid host-side path:/mnt/user/appdata/plex/Library/Application Support/Plex Media Server/Plug-in Support/Databases/dbrepair-docker-*.logA successful automatic run should look roughly like:Mode : automatic Plex Root : /config/Library/Application Support/Plex Media Server Databases : /config/Library/Application Support/Plex Media Server/Plug-in Support/Databases Stopping Plex containers Automatic (check → vacuum → reindex) Check : com.plexapp.plugins.library.db ok Check : com.plexapp.plugins.library.blobs.db ok Vacuum : com.plexapp.plugins.library.db Vacuum : com.plexapp.plugins.library.blobs.db Reindex : com.plexapp.plugins.library.db Reindex : com.plexapp.plugins.library.blobs.db DBRepair completed Restarting Plex containers Started: plexUnraid template noteUnraid remembers the last settings used for a template/container name. If you remove and re-add the container, choosing the same name from the template dropdown can bring back previous edits. This can be helpful when switching between modes like:automatic check prune restoreJust make sure to review the variables before starting the container.Optional monthly run with User ScriptsThis is optional and more of a personal preference / storage-space question.Install the Unraid User Scripts plugin.Create a script like:#!/bin/bash docker start dbrepairSet the schedule to monthly.For monthly cache pruning, edit the container template first:DBREPAIR_MODE=prune PRUNE_DAYS=30For normal monthly database maintenance, use:DBREPAIR_MODE=automaticQuick troubleshootingContainer starts and immediately stopsCheck the Docker log. Most likely the Plex path is mounted wrong. Inside the container, this path must exist:/config/Library/Application Support/Plex Media Server/Plug-in Support/DatabasesPlex did not stopCheck:ALLOW_PLEX_KILL=true PLEX_CONTAINER_MATCH=your Plex name or imageAlso make sure the Docker socket is mounted:/var/run/docker.sock:/var/run/docker.sockI do not want DBRepair stopping PlexALLOW_PLEX_KILL=false RESTART_PLEX=falseThen manually stop Plex before running DBRepair.I changed to prune/restore/check and want normal repair againDBREPAIR_MODE=automatic RESTORE_LAST_BACKUP=falseLinksGitHub README / Environment VariablesUpstream ChuckPa DBRepair project Edited June 1Jun 1 by bmartino1
January 12Jan 12 9 hours ago, bmartino1 said:YOU ARE RESPONSIBLE FOR YOUR OWN DATA.This container runs a database repair tool that modifies your Plex SQLite database. Always ensure you have working backups before proceeding.About This Container This Docker container is provided to assist users in running the Plex database repair tool to resolve common Plex database issues. It wraps and automates the excellent repair script created by ChuckPa:Project: https://github.com/ChuckPa/DBRepair Please review the main project documentation to understand what the tool does and when it should be used.What This Container DoesRuns DBRepair.sh inside a controlled Docker environmentProvides a real TTY using expect (required by the script)Automatically responds to required promptsEmits heartbeat status messages while the repair is runningWrites a persistent log file and mirrors output to Docker logsExits automatically when the repair completestesting this out ... how long does it normally take to run? I couldn't find that information anywhere on github repo ... mines been running for over 15mins now.Might be worth adding that information somewhere.
January 12Jan 12 Same here, just running it now. It's been working for over 20 minutes. But the heartbeat is still updating and I see the script using CPU, so I guess it should be fine? Edited January 12Jan 12 by VlarpNL
January 12Jan 12 It seems this Docker is not working correctly. I ran the DBRepair script directly in my Plex Media Server container, following https://github.com/ChuckPa/DBRepair?tab=readme-ov-file#installation inside the container's console. The Check option finishes in seconds. Automatic finishes in less than a minute. The script outputs different details than the version in the Docker container. It would be helpful of the output of DBRepair.sh is also visible in this Docker's logfile. That way it might be possible to see what the problem is. I'm assuming it to be an issue with permissions, but since I can't see the raw output of the DBRepair.sh script I'm not 100% sure.
January 12Jan 12 12 minutes ago, VlarpNL said:It seems this Docker is not working correctly. I ran the DBRepair script directly in my Plex Media Server container, following https://github.com/ChuckPa/DBRepair?tab=readme-ov-file#installation inside the container's console.The Check option finishes in seconds. Automatic finishes in less than a minute. The script outputs different details than the version in the Docker container. It would be helpful of the output of DBRepair.sh is also visible in this Docker's logfile. That way it might be possible to see what the problem is. I'm assuming it to be an issue with permissions, but since I can't see the raw output of the DBRepair.sh script I'm not 100% sure.Yeah same, I just followed https://github.com/ChuckPa/DBRepair?tab=readme-ov-file#installation inside the container's console, and it worked fine. Check took about 1 minute, and automatic took a couple of minutes. Seems the DBRepair container still needs some work. But cool little tool none the less
January 12Jan 12 Author I'm waiting on chuckpa. There's an issue per his script when passing the script commands as this is currently a WIP, but the base of the system is there... but ATM it's a issue of there script and passing command line arguments per there GitHub readme......Time for the script varies per database sizes.Example to "check" only shouldn't take more then 15 min. Chukpa also has estimated time in their readme... But following his guide and tinkering with it. I'm waiting on an update to the "scripted=1" and there comandline utility of his script... and if not will rework his script in a fork for a fix. Edited January 16Jan 16 by bmartino1 forum clenup - typo
January 13Jan 13 Thanks for the update! Just tested it, but somehow it looks like it doesn't run the actual DBRepair.sh script? When I start the dbrepair container it does stop my Plex Media Server container and it makes a backup of the SQLite databases, but that seems to be all it's doing before starting the PMS container again (there is no DBRepair.log for example). I'm using the official Docker container by Plex Inc. (plexinc/pms-docker:beta). Let me know if I can help you figure out what goes wrong here.Below some data I collected. I also tried running dbrepair container privileged, but that made no difference.These are the settings I'm using:The contents of the Databases directory:Contents of the dbrepair-backups folder (these all contain proper copies of teh SQLite databases):Log output of the dbrepair container:[2026-01-13 09:18:37] ================================================== [2026-01-13 09:18:37] Plex DBRepair – Native Docker [2026-01-13 09:18:37] ================================================== [2026-01-13 09:18:37] Mode : automatic [2026-01-13 09:18:37] Plex Root : /plexmediaserver/Library/Application Support/Plex Media Server [2026-01-13 09:18:37] Databases : /plexmediaserver/Library/Application Support/Plex Media Server/Plug-in Support/Databases [2026-01-13 09:18:37] SQLite : /usr/bin/sqlite3 [2026-01-13 09:18:37] Backup Dir : /plexmediaserver/Library/Application Support/Plex Media Server/Plug-in Support/Databases/dbrepair-backups/2026-01-13_09-18-37 [2026-01-13 09:18:37] Exclude Names : dbrepair,plex-dbrepair [2026-01-13 09:18:37] Exclude Image Regex : plex-dbrepair [2026-01-13 09:18:37] ================================================== [2026-01-13 09:18:37] Scanning for Plex containers to stop (match: Plex-Media-Server) [2026-01-13 09:18:37] Skipping (excluded name): dbrepair [2026-01-13 09:18:37] Stopping Plex container: Plex-Media-Server (d2c15ce7fe52) image=plexinc/pms-docker:beta [2026-01-13 09:18:44] Creating backups... [2026-01-13 09:18:44] Restarting Plex containers that were stopped... [2026-01-13 09:18:44] Started: d2c15ce7fe52 ** Press ANY KEY to close this window ** Edited January 13Jan 13 by VlarpNL
January 13Jan 13 Author 6 hours ago, VlarpNL said:Thanks for the update! Just tested it, but somehow it looks like it doesn't run the actual DBRepair.sh script? When I start the dbrepair container it does stop my Plex Media Server container and it makes a backup of the SQLite databases, but that seems to be all it's doing before starting the PMS container again (there is no DBRepair.log for example). I'm using the official Docker container by Plex Inc. (plexinc/pms-docker:beta). Let me know if I can help you figure out what goes wrong here.Below some data I collected. I also tried running dbrepair container privileged, but that made no difference.These are the settings I'm using:The contents of the Databases directory:Contents of the dbrepair-backups folder (these all contain proper copies of teh SQLite databases):Log output of the dbrepair container:[2026-01-13 09:18:37] ================================================== [2026-01-13 09:18:37] Plex DBRepair – Native Docker [2026-01-13 09:18:37] ================================================== [2026-01-13 09:18:37] Mode : automatic [2026-01-13 09:18:37] Plex Root : /plexmediaserver/Library/Application Support/Plex Media Server [2026-01-13 09:18:37] Databases : /plexmediaserver/Library/Application Support/Plex Media Server/Plug-in Support/Databases [2026-01-13 09:18:37] SQLite : /usr/bin/sqlite3 [2026-01-13 09:18:37] Backup Dir : /plexmediaserver/Library/Application Support/Plex Media Server/Plug-in Support/Databases/dbrepair-backups/2026-01-13_09-18-37 [2026-01-13 09:18:37] Exclude Names : dbrepair,plex-dbrepair [2026-01-13 09:18:37] Exclude Image Regex : plex-dbrepair [2026-01-13 09:18:37] ================================================== [2026-01-13 09:18:37] Scanning for Plex containers to stop (match: Plex-Media-Server) [2026-01-13 09:18:37] Skipping (excluded name): dbrepair [2026-01-13 09:18:37] Stopping Plex container: Plex-Media-Server (d2c15ce7fe52) image=plexinc/pms-docker:beta [2026-01-13 09:18:44] Creating backups... [2026-01-13 09:18:44] Restarting Plex containers that were stopped... [2026-01-13 09:18:44] Started: d2c15ce7fe52 ** Press ANY KEY to close this window ** I'm using the script and it's logic/components the log is In the database folder if what chuck script does. That's correct the automatic runs it all and makes a backup...Try other modes and review that log in the database folder... I need to make a restore function and pipe that log back into the docker. As I haven't made the polish on it yet due to there script comandline options not working right and edits to add unraid/this docker variant with there variable changes to much when we can just use the main utility with out the menu...
January 13Jan 13 I tried all the DBREPAIR_MODE listed in your first post. All of them result in the same: Plex container is stopped, backup gets created, Plex is restarted. The repair script doesn't seem to run.The only difference was with the 'check' DBREPAIR_MODE this outputs an extra error: Error: in prepare, no such collation sequence: icu_root. Tried this twice and same error occurs.In this case also no backups are created.[2026-01-13 16:04:00] ================================================== [2026-01-13 16:04:00] Plex DBRepair – Native Docker [2026-01-13 16:04:00] ================================================== [2026-01-13 16:04:00] Mode : check [2026-01-13 16:04:00] Plex Root : /plexmediaserver/Library/Application Support/Plex Media Server [2026-01-13 16:04:00] Databases : /plexmediaserver/Library/Application Support/Plex Media Server/Plug-in Support/Databases [2026-01-13 16:04:00] SQLite : /usr/bin/sqlite3 [2026-01-13 16:04:00] Backup Dir : /plexmediaserver/Library/Application Support/Plex Media Server/Plug-in Support/Databases/dbrepair-backups/2026-01-13_16-04-00 [2026-01-13 16:04:00] Exclude Names : dbrepair,plex-dbrepair [2026-01-13 16:04:00] Exclude Image Regex : plex-dbrepair [2026-01-13 16:04:00] ================================================== [2026-01-13 16:04:00] Scanning for Plex containers to stop (match: Plex-Media-Server) [2026-01-13 16:04:00] Skipping (excluded name): dbrepair [2026-01-13 16:04:00] Stopping Plex container: Plex-Media-Server (d2c15ce7fe52) image=plexinc/pms-docker:beta [2026-01-13 16:04:06] Check: com.plexapp.plugins.library.db Error: in prepare, no such collation sequence: icu_root [2026-01-13 16:04:06] Restarting Plex containers that were stopped... [2026-01-13 16:04:07] Started: d2c15ce7fe52 ** Press ANY KEY to close this window **
January 13Jan 13 By the way, could it be a permission/rights issue? Permissions of the DB files is 644. Is that correct?root@XXXX:/mnt/fcache/appdata/Plex-Media-Server/Library/Application Support/Plex Media Server/Plug-in Support/Databases# ls -lh total 529M -rw-r--r-- 1 nobody users 348M Jan 13 15:59 com.plexapp.plugins.library.blobs.db -rw-r--r-- 1 nobody users 32K Jan 13 16:04 com.plexapp.plugins.library.blobs.db-shm -rw-r--r-- 1 nobody users 0 Jan 13 16:04 com.plexapp.plugins.library.blobs.db-wal -rw-r--r-- 1 nobody users 180M Jan 13 16:04 com.plexapp.plugins.library.db -rw-r--r-- 1 nobody users 32K Jan 13 16:09 com.plexapp.plugins.library.db-shm -rw-r--r-- 1 nobody users 769K Jan 13 16:09 com.plexapp.plugins.library.db-wal
January 13Jan 13 I tried changing permissions using chmod to 777 for the DB files, but same thing. Ran the container with the "automatic" option. However I don't want to mess around too much with chown and chmod on the DB files as don't want to break Plex.Just checked and somehow this container creates the log and backup files as root? I thought generally speaking Docker containers on Unraid should all run using the nobody:users permission/owner, right? I'm not sure how it works exactly though, I'm hardly a Linux/Docker expert 😅.So I do appreciate the effort you're putting in.root@XXXX:/mnt/fcache/appdata/Plex-Media-Server/Library/Application Support/Plex Media Server/Plug-in Support/Databases# ls -lh total 529M -rw-r--r-- 1 nobody users 348M Jan 13 20:23 com.plexapp.plugins.library.blobs.db -rw-r--r-- 1 nobody users 32K Jan 13 20:30 com.plexapp.plugins.library.blobs.db-shm -rw-r--r-- 1 nobody users 0 Jan 13 20:30 com.plexapp.plugins.library.blobs.db-wal -rw-r--r-- 1 nobody users 180M Jan 13 20:30 com.plexapp.plugins.library.db -rw-r--r-- 1 nobody users 32K Jan 13 20:31 com.plexapp.plugins.library.db-shm -rw-r--r-- 1 nobody users 532K Jan 13 20:31 com.plexapp.plugins.library.db-wal drwxr-xr-x 1 root root 38 Jan 13 20:30 dbrepair-backups/ -rw-r--r-- 1 root root 1.4K Jan 13 20:30 dbrepair-docker-2026-01-13_20-30-23.log Edited January 13Jan 13 by VlarpNL
January 13Jan 13 Author Just now, VlarpNL said:I tried changing permissions using chmod to 777 for the DB files, but same thing. Ran the container with the "automatic" option. However I don't want to mess around too much with chown and chmod on the DB files as don't want to break Plex.Just checked and somehow this container creates the log and backup files as root? I thought generally speaking Docker containers on Unraid should all run using the nobody:users permission/owner, right? I'm not sure how it works exactly though, I'm hardly a Linux/Docker expert 😅.So I do appreciate the effort you're putting in.root@XXXX:/mnt/fcache/appdata/Plex-Media-Server/Library/Application Support/Plex Media Server/Plug-in Support/Databases# ls -lh total 529M -rw-r--r-- 1 nobody users 348M Jan 13 20:23 com.plexapp.plugins.library.blobs.db -rw-r--r-- 1 nobody users 32K Jan 13 20:30 com.plexapp.plugins.library.blobs.db-shm -rw-r--r-- 1 nobody users 0 Jan 13 20:30 com.plexapp.plugins.library.blobs.db-wal -rw-r--r-- 1 nobody users 180M Jan 13 20:30 com.plexapp.plugins.library.db -rw-r--r-- 1 nobody users 32K Jan 13 20:31 com.plexapp.plugins.library.db-shm -rw-r--r-- 1 nobody users 532K Jan 13 20:31 com.plexapp.plugins.library.db-wal drwxr-xr-x 1 root root 38 Jan 13 20:30 dbrepair-backups/ -rw-r--r-- 1 root root 1.4K Jan 13 20:30 dbrepair-docker-2026-01-13_20-30-23.logI'm update the script to teset this now. your using the plex beta image and at creation the new sql files have a lock file for maintence tasks..That was new to me... I will be pushing an updated image here soon to corect this to work with icu SQLite locks.As I just finshed workign on the restroe and makien varables for optional backup and adational loging...
January 13Jan 13 2 minutes ago, bmartino1 said:I'm update the script to teset this now. your using the plex beta image and at creation the new sql files have a lock file for maintence tasks..That was new to me... I will be pushing an updated image here soon to corect this to work with icu SQLite locks.As I just finshed workign on the restroe and makien varables for optional backup and adational loging...Thanks! I'll gladly test if it works.
January 14Jan 14 Thanks for the update! Just tested and it seems to work correctly now! Great work![2026-01-14 09:48:40] ================================================== [2026-01-14 09:48:40] Plex DBRepair – Native Docker [2026-01-14 09:48:40] ================================================== [2026-01-14 09:48:40] Mode : automatic [2026-01-14 09:48:40] Plex Root : /config/Library/Application Support/Plex Media Server [2026-01-14 09:48:40] Databases : /config/Library/Application Support/Plex Media Server/Plug-in Support/Databases [2026-01-14 09:48:40] SQLite : /usr/lib/plexmediaserver/Plex SQLite (plex) [2026-01-14 09:48:40] Backups Enabled : true [2026-01-14 09:48:40] Restore Last Backup : false [2026-01-14 09:48:40] ================================================== [2026-01-14 09:48:40] Stopping Plex containers (match: Plex-Media-Server) [2026-01-14 09:48:40] ================================================== [2026-01-14 09:48:40] Skipping excluded container: dbrepair [2026-01-14 09:48:40] Stopping Plex container: Plex-Media-Server (d2c15ce7fe52) [2026-01-14 09:48:47] ================================================== [2026-01-14 09:48:47] Automatic (check → vacuum → reindex) [2026-01-14 09:48:47] ================================================== [2026-01-14 09:48:47] ================================================== [2026-01-14 09:48:47] Backup databases [2026-01-14 09:48:47] ================================================== [2026-01-14 09:48:47] Backup : com.plexapp.plugins.library.db [2026-01-14 09:48:47] Backup : com.plexapp.plugins.library.blobs.db [2026-01-14 09:48:47] Backup dir: /config/Library/Application Support/Plex Media Server/Plug-in Support/Databases/dbrepair-backups/2026-01-14_09-48-40 (2 file(s)) [2026-01-14 09:48:47] Check : com.plexapp.plugins.library.db ok [2026-01-14 09:48:50] Check : com.plexapp.plugins.library.blobs.db ok [2026-01-14 09:48:52] Vacuum : com.plexapp.plugins.library.db [2026-01-14 09:48:54] Vacuum : com.plexapp.plugins.library.blobs.db [2026-01-14 09:48:56] Reindex : com.plexapp.plugins.library.db [2026-01-14 09:48:58] Reindex : com.plexapp.plugins.library.blobs.db [2026-01-14 09:48:58] ================================================== [2026-01-14 09:48:58] DBRepair completed [2026-01-14 09:48:58] Log : /config/Library/Application Support/Plex Media Server/Plug-in Support/Databases/dbrepair-docker-2026-01-14_09-48-40.log [2026-01-14 09:48:58] Backups : /config/Library/Application Support/Plex Media Server/Plug-in Support/Databases/dbrepair-backups [2026-01-14 09:48:58] ================================================== [2026-01-14 09:48:58] ================================================== [2026-01-14 09:48:58] Restarting Plex containers [2026-01-14 09:48:58] ================================================== [2026-01-14 09:48:59] Started: d2c15ce7fe52 ** Press ANY KEY to close this window **
January 14Jan 14 Author On 1/12/2026 at 6:19 AM, carps.cygnet36 said:Yeah same, I just followed https://github.com/ChuckPa/DBRepair?tab=readme-ov-file#installation inside the container's console, and it worked fine. Check took about 1 minute, and automatic took a couple of minutes. Seems the DBRepair container still needs some work. But cool little tool none the less I've found that there are too many new users , who are not able to understand nor how to run that script properly... and thought that this is a needed necessity for unraid, especially for long-term users for general maintenance, checkup and tests and repairs to their database overtime.This is a multifaceted system and has been tested on multiple Plex docker versions. I ended up using the same script logic (issues with needing manual database and SQL lines and passing check, auto) as they would stall error out and be stuck at the menu screen with the original setup. While I could get it to work, it wasn't stable for others to fully ship... So a rewrite was done.The main functions of the original DB repair script that Chuck PA uses is running in this Docker. Their main utility if here without the menu. As we use docker variables to set the menu options before docker run...However, I am still partial and more prudent to direct users to use that repair script within the Plex Docker. The way that Chuck PA had intended...So Now, I could at least point a new user to a template that allows a one-click install and run automatic repair with backup by default...This way we can direct new users. Having issues to just run this Docker and be done. With No advance docker edits something simple for the end users.@EDalcin yes with the final polish and a updated / new ca template - new docker system layout. I was unable to get the original docker system running via of scrips command line (I originally did but pushing it to the hub and sharing found out that nope there is a weird scripting error/menu hang/freeze. However, I was able to reuse his code that runs the options they made via docker variable and similar logging. Edited January 16Jan 16 by bmartino1 forum clenup - typo
January 21Jan 21 Hello there! I need some help to run this script in unraid! I'm new to unraid but gotta fix my Plex database!How do I run this script in the terminal? Any basic advice would be of great help, thanks!!
January 21Jan 21 2 minutes ago, ManixQC said:I need some helpThis is a container that runs the script for you.Did you read the first post in this thread?
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.