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

Well finally the script ran fine but it wasn't my problem actually :-/

Thanks anyway for this!

  • 4 weeks later...

I keep getting the fatal error despite it seemingly being set up correctly. I pointed the Plex Database Folder to the correct path but I still keep getting the error. Im probably missing something, but I dont know what it is. Anyone?

image.pngimage.png

image.png

  • Author
2 hours ago, Austin7777 said:

I keep getting the fatal error despite it seemingly being set up correctly. I pointed the Plex Database Folder to the correct path but I still keep getting the error. Im probably missing something, but I dont know what it is. Anyone?

image.pngimage.png

image.png

1st post picture your too far deep you need to mount
/mnt/user/appdata/Plex-Media-Server

As the Libray folder need shown... this should be the same as your appdata folder...
https://forums.unraid.net/topic/196453-support-plex-db-repair-docker/#findComment-1601211

image.png

This is the only thing that needs set to run... the continer will then see /config/Library

and things will work as intended...

Its the only data I don't have that the end users must set. as you can see my appdata for plex is different and each docker is different for appdata...

my scirpt will traverse into the databse folder folwing default folder nested...

  • Author

That fixed it, thanks!

  • 3 weeks later...

Good evening, folks. This is one of my first posts, so please bear with me. I too require a bit of hand holding in fear of making a mistake.

·         I am using repository Iscro.io/linuxserver/plex on Unraid 7.2.4 saved in appdata/plex

·         I have backed up the entire Plex Media server folder as a precaution.

·         Here are the settings I believe I need to set when installing DBRepair, but am not 100%:

o   Name: dbrepair (default)

o   Repository: bmmbmm01/plex-dbrepair (default)

o   Network Type: Host (defaulted to Bridge but my Plex is set to Host)

o   Use Tailscale: Off (default)

o   Console shell command: Bash (default & what Plex docker is set to)

o   Privileged" Off (default)

o   Plex Databse Folder: /mnt/user/appdata/plex (where Plex is stored on my Unraid)

o   DBREPAIR_MODE: automatic (default)

o   the remaining settings (default)

Are any settings incorrect? Once correct and installed, do I simply run the docker, or does it run automatically after installation? Lastly, do I stop the docker once it's been used?

I appreciate your help in advance as I believe I may have a corrupted database since Plex is not recognizing any new TV Shows and I'm unable to empty trash from any library since I last updated Plex docker.

Thanks!

  • Author
16 hours ago, CaptainMB289 said:

Good evening, folks. This is one of my first posts, so please bear with me. I too require a bit of hand holding in fear of making a mistake.

·         I am using repository Iscro.io/linuxserver/plex on Unraid 7.2.4 saved in appdata/plex

·         I have backed up the entire Plex Media server folder as a precaution.

·         Here are the settings I believe I need to set when installing DBRepair, but am not 100%:

o   Name: dbrepair (default)

o   Repository: bmmbmm01/plex-dbrepair (default)

o   Network Type: Host (defaulted to Bridge but my Plex is set to Host)

o   Use Tailscale: Off (default)

o   Console shell command: Bash (default & what Plex docker is set to)

o   Privileged" Off (default)

o   Plex Databse Folder: /mnt/user/appdata/plex (where Plex is stored on my Unraid)

o   DBREPAIR_MODE: automatic (default)

o   the remaining settings (default)

Are any settings incorrect? Once correct and installed, do I simply run the docker, or does it run automatically after installation? Lastly, do I stop the docker once it's been used?

I appreciate your help in advance as I believe I may have a corrupted database since Plex is not recognizing any new TV Shows and I'm unable to empty trash from any library since I last updated Plex docker.

Thanks!


That is correct, the only thing someone needs to do is set the app data folder. The only piece of inofmration that chagnes.

image.png

also per the 1st post of this forum when setting your plex path in the tempate you must see the Library folder.

no other settng change is required.

Per your post your running

image.png

if you edit the old docker enable teh advance togle at the top top right. then Scroll down down to bottom and show more settings. You will see an appdata path.

image.png

COPY THAT PATH!

Per that appdata default template path is
/mnt/user/appdata/plex

so you would change the first option in my template to that path...that's it..

image.png

as it say in yellow.

WHEN DONE CORRECTLY!

image.png

You should see the Library Folder.

This is the only thing that needs editing to run automatic repair...

This is user preference and customizeable this is why a default location is not set and can't be set as not all templates use the same path...

Edited by bmartino1
update data

  • 3 weeks later...

Thank you so much for this ... I attempted the .sh injection into docker but couldn't get it to work right.. would show the menu four times and EOF without any input from me.

Installed and setup okay and this is the result: dose this mean its to late for my db to be repaird?

log.txt

Edited by warinc

  • Author
58 minutes ago, warinc said:

Thank you so much for this ... I attempted the .sh injection into docker but couldn't get it to work right.. would show the menu four times and EOF without any input from me.

Installed and setup okay and this is the result: dose this mean its to late for my db to be repaird?

log.txt

Page 111421: btreeInitPage() returns error code 11

[2026-03-31 22:22:26] Check : com.plexapp.plugins.library.blobs.db

ok

[2026-03-31 22:23:02] Vacuum : com.plexapp.plugins.library.db

Error: stepping, database disk image is malformed (11)

it means teh comand that is ran via autmatic fialed to coreclty edit and fix the database.

Correct, sadlly it is better to delete teh dataabse and start over at that point. sorry.

com.plexapp.plugins.library.db is corrupted enough that VACUUM cannot run on it.

Your log shows two separate things:

  1. PRAGMA integrity_check on the main DB fails with
    Page 111421: btreeInitPage() returns error code 11

  2. then VACUUM fails with
    database disk image is malformed (11)

That means this is beyond a simple optimize/reindex pass. VACUUM only helps when SQLite can still read the structure well enough to rebuild it. Plex’s own docs say to try VACUUM and REINDEX for lighter corruption, but for deeper corruption the next step is low-level recovery with .recover, using Plex SQLite, not generic sqlite3.

in theroy it can still be recovered but with that much damage it would be hard to fix.

16 minutes ago, bmartino1 said:

Page 111421: btreeInitPage() returns error code 11

[2026-03-31 22:22:26] Check : com.plexapp.plugins.library.blobs.db

ok

[2026-03-31 22:23:02] Vacuum : com.plexapp.plugins.library.db

Error: stepping, database disk image is malformed (11)

it means teh comand that is ran via autmatic fialed to coreclty edit and fix the database.

Correct, sadlly it is better to delete teh dataabse and start over at that point. sorry.

com.plexapp.plugins.library.db is corrupted enough that VACUUM cannot run on it.

Your log shows two separate things:

  1. PRAGMA integrity_check on the main DB fails with
    Page 111421: btreeInitPage() returns error code 11

  2. then VACUUM fails with
    database disk image is malformed (11)

That means this is beyond a simple optimize/reindex pass. VACUUM only helps when SQLite can still read the structure well enough to rebuild it. Plex’s own docs say to try VACUUM and REINDEX for lighter corruption, but for deeper corruption the next step is low-level recovery with .recover, using Plex SQLite, not generic sqlite3.

in theroy it can still be recovered but with that much damage it would be hard to fix.

Thank you very much for the response, guess time to delete and recreate the db overnight

  • Author

Additional Data:

The documentation link that was followed to attempt to assist others.
Please see Support Post
https://support.plex.tv/articles/repair-a-corrupted-database/

I think chuck PA scirpt might ahve a depper repair but that would require high level docker knowledge and the ability to execute the script manually in the original Plex Docker.(they may require docker mods and 3rd party docker adon to execute the script.)

https://github.com/ChuckPa/DBRepair
Which is what this docker is based off of. But I don't think the deeper level was added to that script.

the plex forum would be the area I would ask for further support if attempting to repair. Notes for future users.
example Plex fourm post:
https://forums.plex.tv/t/database-is-corrupt-or-maintenance/882894

  • 1 month later...

I changed the one line to my plex location, library folder was there. It is started and running, does it stop automatically? How long should I let it run? And where do I find the log file?

The post making it clear that you only have to update one line was very helpful. That maybe should have been obvious, but it was not to me. A youtube video would be great, even though it is simple.

Thanks for doing this!

Ross

  • Author
On 5/13/2026 at 4:00 PM, Ross said:

I changed the one line to my plex location, library folder was there. It is started and running, does it stop automatically? How long should I let it run? And where do I find the log file?

The post making it clear that you only have to update one line was very helpful. That maybe should have been obvious, but it was not to me. A youtube video would be great, even though it is simple.

Thanks for doing this!

Ross

Apologies for the late reply

https://forums.unraid.net/topic/196453-support-plex-db-repair-docker/#findComment-1601211
most can be seen earlier in the post. Not aware of any YouTube videos and don't have time to make a screen share video of the process.

Only the appdata path showing libray needs to be set.
once it starts it will stop after some time, which depends on age of the hardware. In my testing, no more than 30 min on a bad repir on the healthy plex database, less then 10 min. refreshing the unraid docker tab will show the docker stopped. Click logs to see where it is at and to monitor progress.

The log file can be found within the plex library path. data explained in the link posted above...

  • 2 weeks later...

So what is the use of this docker? Do you leave it up and running? Does it run on a schedule? Does it automatically download the latest copy of DBRepair.sh? What is the best use scenario of the docker?

  • Author
59 minutes ago, dentnshell said:

So what is the use of this docker? Do you leave it up and running? Does it run on a schedule? Does it automatically download the latest copy of DBRepair.sh? What is the best use scenario of the docker?


for a end user to run this docker and hav eit auto repair the pelx sql database due to coruption.
the docker runs does its things and stops. its meant as a stop gap and a quick run this to help some not so tech savy users run teh needed sqlite comands to run the reapirs per plex to fix common database issues.

I have always used the repair utility via command line. I have the docker installed now and working.... I can see that it ran. Just didn't know how I should be setting it up.

So if you set the docker to autostart, is the idea that it will run and stay running? Should it always be running? Will the docker shut down when it is done? If so I can see a use for autostart to do an automatic cleanup / repair on an unraid reboot.

  • Author
17 minutes ago, dentnshell said:

I have always used the repair utility via command line. I have the docker installed now and working.... I can see that it ran. Just didn't know how I should be setting it up.

So if you set the docker to autostart, is the idea that it will run and stay running? Should it always be running? Will the docker shut down when it is done? If so I can see a use for autostart to do an automatic cleanup / repair on an unraid reboot.

then this is not for you. the idea and goal was for this to be used for thoses who need help. idealy you shold run teh ca script maunaly inteh docker this is a side alternative due to to many useing having isseus and neding a quick fix...

the docker logs tell you whats happening when it stops the operation is complete check the docker logs and see the secod post of this forum...

My question is, should you uninstall the docker after a successful run and then reinstall if you need it again? Or just turn autostart off unless you think you need it?

Ross

  • Author
4 hours ago, Ross said:

My question is, should you uninstall the docker after a successful run and then reinstall if you need it again? Or just turn autostart off unless you think you need it?

Ross

only if you want to, unriad installs a template of your last setting, going to add a container and reselecting the name in the drop down will keep previous edits...

I set this up where you can use the tempalte to run other operations as well. user script plugin to call the docker start command. then cron to run 1 a month.
Thats more a a personal preference and space question.

example cache clearing. I chagne automtic to xyz and run the docker. options explaind in 2nd post of this forum and on github.
https://github.com/bmartino1/plex-dbrepair-docker#environment-variables

setting automatic to prune will then see the default set 30 days whcih will delete old cache.

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.