Skip to content
View in the app

A better way to browse. Learn more.

Unraid

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

[Support] Plex DB Repair Docker

Featured Replies

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 Does

  • Runs DBRepair.sh adjacent code inside a controlled Docker environment

  • Writes a persistent log file and mirrors output to Docker logs

  • Exits automatically when the repair completes

  • if variables enabled, it will also:

    • backup (file copy) the current database.

    • stop other plex dockers from running

  • with unraid variables for prune picture cache and db file restore(if you used this docker to make the backup...)

Edited by bmartino1
Appologies due to scirpting errors on my end and with main scirpt during main release

  • Author

DBREPAIR_MODE

Default: automatic

Description:
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).

Value

Menu #

Action Description

automatic

2

Full maintenance run: Integrity check → Repair/Optimize (VACUUM) → Reindex

check

3

Perform SQLite integrity check only (no changes made)

vacuum

4

Vacuum databases to reclaim unused space

repair

5

Repair / optimize databases (VACUUM)

reindex

6

Rebuild all database indexes

this 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!!!)
image.png

For the Docker Variable Plex_Container_Match:


it is best to give your dockers plex repository image... example pulled form the Unraid tempalte
image.png
or docker name
image.png
*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"
image.png

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:
image.png

image.png


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 Timestamp

root@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.db

ok

[2026-01-13 17:17:17] Check : com.plexapp.plugins.library.blobs.db

ok

[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: 3249418f44b5

root@BMM-Tower:/mnt/user/Dockers/Plex/database/Library/Application Support/Plex Media Server/Plug-in Support/Databases#

Edited by bmartino1
Updates on how its runs what it should look like...

  • Author
On 1/11/2026 at 5:23 PM, bmartino1 said:

DBREPAIR_MODE

Default: automatic

Description:
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).

Value

Menu #

Action Description

automatic

2

Full maintenance run: Integrity check → Repair/Optimize (VACUUM) → Reindex

check

3

Perform SQLite integrity check only (no changes made)

vacuum

4

Vacuum databases to reclaim unused space

repair

5

Repair / optimize databases (VACUUM)

reindex

6

Rebuild all database indexes

this 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!!!)
image.png

For the Docker Variable Plex_Container_Match:


it is best to give your dockers plex repository image... example pulled form the Unraid tempalte
image.png
or docker name
image.png
*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"
image.png

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:
image.png

image.png


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 Timestamp

root@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.db

ok

[2026-01-13 17:17:17] Check : com.plexapp.plugins.library.blobs.db

ok

[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: 3249418f44b5

root@BMM-Tower:/mnt/user/Dockers/Plex/database/Library/Application Support/Plex Media Server/Plug-in Support/Databases#


Plex DB Repair Docker for Unraid

Forum-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 usage

  1. Install the container from Community Apps / template.

  2. Mount your Plex appdata folder so the container can see the full Plex nested folder structure.

  3. Leave DBREPAIR_MODE=automatic for the normal repair run.

  4. Set PLEX_CONTAINER_MATCH so DBRepair can find your Plex container.

  5. Start the DBRepair container.

  6. Wait for it to finish and stop.

  7. Check the Unraid Docker log or the saved log file in the Plex database folder.

Recommended first run

For 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=false

The automatic mode runs:

integrity check → VACUUM / repair → reindex

Required mounts

Plex appdata

The 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/Write

Inside the DBRepair container, this path must exist:

/config/Library/Application Support/Plex Media Server/Plug-in Support/Databases

This full path matters because some modes, such as PhotoTranscoder pruning, need access to more than just the database folder.

Docker socket

The 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/Write

If you do not mount the Docker socket, set:

ALLOW_PLEX_KILL=false
RESTART_PLEX=false

Then manually stop Plex before running the container.

Plex container matching

PLEX_CONTAINER_MATCH is used to find the Plex Docker container that should be stopped before repair.

PLEX_CONTAINER_MATCH=plex

This 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-plex

Best 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 variables

Variable

Default

Description

DBREPAIR_MODE

automatic

Operation to run. See mode list below.

ALLOW_PLEX_KILL

true

Allows the container to stop Plex before database work.

PLEX_CONTAINER_MATCH

plex

Name/image match used to find the Plex container.

RESTART_PLEX

true

Restart Plex after DBRepair finishes.

ENABLE_BACKUPS

true

Make file-copy backups before write operations.

RESTORE_LAST_BACKUP

false

Restore the most recent DBRepair backup and exit.

PRUNE_DAYS

30

Days to keep PhotoTranscoder cache files when using prune mode.

TZ

unset

Timezone for logs and timestamps. Example: America/Chicago.

EXCLUDE_CONTAINER_NAMES

dbrepair,plex-dbrepair

Container names that should never be stopped.

EXCLUDE_IMAGE_REGEX

plex-dbrepair

Image regex excluded from stop matching, mainly to prevent the container from killing itself.

DBREPAIR_MODE options

Only use one mode at a time. If the value is missing or invalid, the container falls back to automatic.

Mode

Action

automatic

Full maintenance run: integrity check → VACUUM / repair → reindex.

check

SQLite integrity check only. No changes made.

vacuum

Vacuum databases to reclaim unused space.

repair

Repair / optimize databases using VACUUM.

reindex

Rebuild database indexes.

deflate

Rewrite database using VACUUM INTO for full compaction.

prune

Delete old Plex PhotoTranscoder cache files older than PRUNE_DAYS.

manual

Start an interactive/manual container shell for testing or advanced use.

Backups

ENABLE_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-backups

This 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 backup

To restore the most recent backup made by this container:

RESTORE_LAST_BACKUP=true

When 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=false

PhotoTranscoder cache prune

The container can also be used to clear old Plex PhotoTranscoder cache files.

DBREPAIR_MODE=prune
PRUNE_DAYS=30

Example:

DBREPAIR_MODE=prune
PRUNE_DAYS=14

That keeps the last 14 days and removes older cache files.

Where logs are saved

A 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.log

Example Unraid host-side path:

/mnt/user/appdata/plex/Library/Application Support/Plex Media Server/Plug-in Support/Databases/dbrepair-docker-*.log

A 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: plex

Unraid template note

Unraid 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
restore

Just make sure to review the variables before starting the container.

Optional monthly run with User Scripts

This is optional and more of a personal preference / storage-space question.

  1. Install the Unraid User Scripts plugin.

  2. Create a script like:

#!/bin/bash
docker start dbrepair

Set the schedule to monthly.

For monthly cache pruning, edit the container template first:

DBREPAIR_MODE=prune
PRUNE_DAYS=30

For normal monthly database maintenance, use:

DBREPAIR_MODE=automatic

Quick troubleshooting

Container starts and immediately stops

Check 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/Databases

Plex did not stop

Check:

ALLOW_PLEX_KILL=true
PLEX_CONTAINER_MATCH=your Plex name or image

Also make sure the Docker socket is mounted:

/var/run/docker.sock:/var/run/docker.sock

I do not want DBRepair stopping Plex

ALLOW_PLEX_KILL=false
RESTART_PLEX=false

Then manually stop Plex before running DBRepair.

I changed to prune/restore/check and want normal repair again

DBREPAIR_MODE=automatic
RESTORE_LAST_BACKUP=false

Links

GitHub README / Environment Variables

Upstream ChuckPa DBRepair project

Edited by bmartino1

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 Does

  • Runs DBRepair.sh inside a controlled Docker environment

  • Provides a real TTY using expect (required by the script)

  • Automatically responds to required prompts

  • Emits heartbeat status messages while the repair is running

  • Writes a persistent log file and mirrors output to Docker logs

  • Exits automatically when the repair completes

testing 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.

image.png

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 by VlarpNL

Any news? Success??

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.

image.png

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.

image.png

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 )

  • 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 by bmartino1
forum clenup - typo

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:

image.png

The contents of the Databases directory:

image.png

Contents of the dbrepair-backups folder (these all contain proper copies of teh SQLite databases):

image.png

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 by VlarpNL

  • 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:

image.png

The contents of the Databases directory:

image.png

Contents of the dbrepair-backups folder (these all contain proper copies of teh SQLite databases):

image.png

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...

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 ** 

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
  • Author

Correct I would think that is permission based.

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 by VlarpNL

  • 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.log

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..

image.png

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...

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..

image.png

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.

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 ** 
  • 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 by bmartino1
forum clenup - typo

Thanks for letting me know!

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!!

2 minutes ago, ManixQC said:

I need some help

This is a container that runs the script for you.

Did you read the first post in this thread?

Yes but unsure to understand it properly :(

Go to the Apps page, search for dbrepair, install the container.

Oh great that makes things much easier, thanks!

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.

Guest
Reply to this topic...

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.