June 16, 20224 yr I've tried everything and can't figure this out... I would be eternally grateful for some advice/assistance. *I haven't touched any settings in Plex or Unraid for that matter, in literally months, by the way. So I don't think it's anyhthing I did. Let me break it down chronologically: 1. Monday evening, I noticed that while on the HOME section of Plex, my "Recently Added TV Shows" suddenly stopped appearing. Any shows my wife and I are watching were still showing up in "Continue Watching", though, so I investigated further. When I left the HOME section and went down to TV SHOWS, the library appeared, but the RECOMMENDED tab at the top said "We've encountered a bug." I slept on it. 2. Tueday morning, all of a sudden, my Movies and TV Shows stopped appearing altogether, and all that was appearing was MUSIC. I called a few friends I'm sharing with to double check and quickly realized that it was also affecting them. Deep breaths, get er' fixed, I said to myself. So I worked my regular work day and started troubleshooting and searching online for solutions after I finished my shift. The Plex forums were helpful in one way, wherein I was able to send a zip file of a bug log and a staff member told me that there was a corrupted database and it should be replaced with a backup. I was given a few links, followed the instructions, but they weren't much help as their mods/staff don't have much experience with Unraid, apparently, so I found myself on the Plex subreddit. A few people have performed this fix and it has worked, so i gave it a go. 2.1. I went to the appdata folder and found the plugins-support subfolder which contained the backups and the current database which Plex pulls info from. I stopped the Plex Docker, moved the appropriate files out, and renamed the others so that they would be used instead. Nothing. Same. Nay - MUSIC wasn't showing anymore, in fact. So... my patience and noral level of cheer was diminishing. 3. I upgraded Unraid to its current stable version. No change. 4. Today (Wednesday afternoon) - This one was a long shot, but someone on the subreddit also suggested (not directly to me) to stop the docker, uninstall it, find all Plex related folders in the appdata share and delete them, reboot the server, re-install the docker so to create new appdata subfolders for Plex and populate them anew. Nothing. 5. Tonight (Wednesday evening) - I uninstalled the docker again. That's where I'm at right now. There are new databases remaining in the appdata share, and I kinda don't want to touch them, and I still have the previous ones backed up. I hate when things don't work and I can't figure it out. I'm at my wits end. If you can help, I would be so thankful. I feel useless to not be able to fix it myself, so just know it's taking a lot out of me to ask for help. TIA.
June 16, 20224 yr Hey G1BZ, I've had similar issues (unable to see libraries when logged in as admin, but able to see some when logged in as a managed user; pals are reporting a "files don't exist/drive not mounted" error). I think something with the recent Plex update must have broken things (interestingly, when I click "scan library files" it works through the files and tries to repopulate before saying "an unexpected error occurred."). People over on the Plex forums are reporting loads of issues on every OS (Mac, Windows, Unraid, etc.). So, I don't think it's anything we've done. And I'm also not seeing any info on how to fix it. Might be time to switch to Emby or Jellyfin, if they don't patch things up quickly.
February 27, 20233 yr Also, there's a great new Plex DB tool that im using regularly to keep my DB working nicely. It can be found here:- https://github.com/ChuckPa/PlexDBRepair
March 4, 20233 yr @BigDanTI can't get that DBRepair to work using unraid with binhex plexpass. Anything you may know I might be doing wrong?
March 4, 20233 yr Sooooooo a couple of things. Did you run the script from within the Plex container console ? And did you stop the Plex service first from within the container console ? I think its:- # Stop Plex in binhex containers kill -15 $(pidof 'Plex Media Server') Not sure how to restart it though, but once your DB is fixed restarting the container should bring it back. That's the extent of my knowledge sorry
March 7, 20233 yr It's ok. I'll mess with it, but yes, I did do all of that...Actually, my DB wasn't broken!! YAY!!
March 23, 20233 yr Hey sorry to crash this thread and I know it is a rookie question, but what is the best way to install the plexdbrepair tool in the containter? I do not see anything on how to install it on the git page. Is it as simple as pulling down the taz.gz, copying to my unraid via SMB and then uncompressing via terminal? Or is there a more sophisticated way that I dont know? Appreciate it.
March 23, 20233 yr 4 minutes ago, Mike Glenny said: Hey sorry to crash this thread and I know it is a rookie question, but what is the best way to install the plexdbrepair tool in the containter? I do not see anything on how to install it on the git page. Is it as simple as pulling down the taz.gz, copying to my unraid via SMB and then uncompressing via terminal? Or is there a more sophisticated way that I dont know? Appreciate it. You can use the built-in sqlite executable. I bookmarked this reddit thread:
April 22, 20233 yr On 3/23/2023 at 3:54 AM, Mike Glenny said: Hey sorry to crash this thread and I know it is a rookie question, but what is the best way to install the plexdbrepair tool in the containter? I do not see anything on how to install it on the git page. Is it as simple as pulling down the taz.gz, copying to my unraid via SMB and then uncompressing via terminal? Or is there a more sophisticated way that I dont know? Appreciate it. I just stumbled by this thread from Google fixing my own corrupt Plex DB on the binhex plexpass image. I thought I'd drop my findings here since I used this thread to solve my issue. My original error in the container logs for anyone searching for similar: Error: Unable to set up server: sqlite3_statement_backend::prepare: no such table: metadata_agent_providers for SQL: update metadata_agent_providers set online = 0 (N4soci10soci_errorE) I fixed my DB using the tool linked above by running the following commands from the container console: cd / pacman -S wget --noconfirm wget https://github.com/ChuckPa/PlexDBRepair/archive/refs/tags/v1.0.4.tar.gz tar xf v1.0.4.tar.gz rm v1.0.4.tar.gz cd PlexDBRepair-1.0.4 chmod +x DBRepair.sh ./DBRepair.sh Then running automatic repair when the tool's menu appears. You'll ideally need to have stopped Plex running somehow before running a repair, mine was stuck in a crash loop so I got it to run in between starts following a crash, and that apparently worked.
April 22, 20233 yr 15 hours ago, Merrrp said: I just stumbled by this thread from Google fixing my own corrupt Plex DB on the binhex plexpass image. I thought I'd drop my findings here since I used this thread to solve my issue. My original error in the container logs for anyone searching for similar: Error: Unable to set up server: sqlite3_statement_backend::prepare: no such table: metadata_agent_providers for SQL: update metadata_agent_providers set online = 0 (N4soci10soci_errorE) I fixed my DB using the tool linked above by running the following commands from the container console: cd / pacman -S wget --noconfirm wget https://github.com/ChuckPa/PlexDBRepair/archive/refs/tags/v1.0.4.tar.gz tar xf v1.0.4.tar.gz rm v1.0.4.tar.gz cd PlexDBRepair-1.0.4 chmod +x DBRepair.sh ./DBRepair.sh Then running automatic repair when the tool's menu appears. You'll ideally need to have stopped Plex running somehow before running a repair, mine was stuck in a crash loop so I got it to run in between starts following a crash, and that apparently worked. FYI, I was getting these exact same errors but the database repair did not fix it, even though its said the integrity was okay. What did end up fixing it was rolling back to a previous binhex-plexpass image. More info in the post here:
July 8, 20232 yr I can't seem to get either solution to work for my issue Plex database error in logs: Starting Plex Media Server. Error: Unable to set up server: sqlite3_statement_backend::loadOne: database disk image is malformed (N4soci10soci_errorE) when running ./DBRepair.sh I receive the error below: root@Tower:~# ./DBRepair.sh bash: ./DBRepair.sh: /bin/sh^M: bad interpreter: No such file or directory I’ve also tried to follow SpaceInvader One’s video, but get the below error when trying to run Plex SQLite root@Tower:/mnt/cache/appdata/plex-sqlite/plexmediaserver# ls CrashUploader* Plex\ DLNA\ Server* Plex\ Media\ Scanner* Plex\ Relay* Plex\ Script\ Host* Plex\ Tuner\ Service* etc/ Plex\ Commercial\ Skipper* Plex\ Media\ Fingerprinter* Plex\ Media\ Server* Plex\ SQLite* Plex\ Transcoder* Resources/ lib/ root@Tower:/mnt/cache/appdata/plex-sqlite/plexmediaserver# “Plex SQLite” “$DB” “PRAGMA integrity_check” bash: Plex SQLite: command not found any other suggestions?
July 25, 20232 yr When I had faced this issue upon a migration from Windows Server to BinHex, I had eventually identified that somehow my blobs DB had become corrupted - but only the copy that had been moved over to Unraid. My original copy was OK. I copied the unzipped blobs DB back over and overwrote it, did permissions tweaks and was right as rain. TLDR: Check the integrity of your Blobs DB as well. You may need to do this pragma integrity check manually, outside of the script. Edited July 25, 20232 yr by ixit
March 30, 20242 yr i know this is an old topic, but i recently had to install this script to fix my database. put the script (DBrepair.sh) in your appdata folder for plex (i did this using VSCode). Next open the console for plex and change directory to /config(if you LS in the config directory you should see the sh file). Once in the config directory type sh DBrepair.sh you will then be presented with the menu. Then 1) stop PMS, 2) run repair 3) start PMS 4) exit
June 15, 20242 yr I updated my Plex docker and then it wouldn't start properly and the log was filled with these error: Error: Unable to set up server: sqlite3_statement_backend::loadOne: database disk image is malformed (N4soci10soci_errorE) Starting Plex Media Server. . . (you can ignore the libusb_init error) I was able to fix it by opening the docker's console and downloading and running the db repair script with these commands (thank you Merrrp) : wget https://github.com/ChuckPa/PlexDBRepair/archive/refs/tags/v1.0.4.tar.gz tar xf v1.0.4.tar.gz rm v1.0.4.tar.gz cd PlexDBRepair-1.0.4 chmod +x DBRepair.sh ./DBRepair.sh
July 3, 20242 yr I have been struggling with a corrupted DB for a while now. The normal PRAGMA checks were always showing OK for the main and blobs DB and even after doing the reindexing, I would still get a notification randomly telling me the DB was corrupt. The noticeable issue was that my Home page would no longer show my Movie Recommendations (Recently Released, Recently Added, etc.). I have plans to move Plex to my Unraid server but currently it's running on a Windows machine. I was able to fix my issue using https://github.com/ChuckPa/PlexDBRepair. They have a Windows Powershell script that I could run and now I can see my Movie Recommendations again! :) I hope this can help someone else in the future.
August 14, 20241 yr I also run into this issue basically weekly. I run Plex in a Docker container. Posting my solution here. Good luck all! 1. open the unraid web console 2. wget the zip from this github -- https://github.com/ChuckPa/PlexDBRepair e.g. wget https://github.com/ChuckPa/PlexDBRepair/archive/refs/heads/master.zip 3. Use unzip to open the archive downloaded in the previous step. X e.g. unzip master.zip This creates a new directory in the current working directory that will be used in a few steps. PlexDBRepair-master/ 4. Find the plex docker container id. For this, I have my plex docker running. e.g. docker ps This should create a table. What you are looking for is the first field of characters in the plex row. This value is the Container ID. 5. Copy the PlexDBRepair-master directory to the docker container to run them e.g. docker cp PlexDBRepair-master/ xxxxxxxxx:/ Where xxxxxxxxx is the Container ID you found above. 5. Access a shell in the docker container e.g. docker exec -it xxxxxxxxx bash Again where xxxxxxxxx is the Container ID from above. 6. In this shell get the necessary script into the root of the container e.g. cp PlexDBRepair-master/* . This is a bit messy, but I'm here for results. This should move what you need into the root of the container for the next step. 7. Execute DBRepair.sh e.g. sh DBRepair.sh This should spawn a bunch of options that you can read over for your own cases. 8. For my cases automatic has been good enough. YMMV. e.g. 2
January 20, 20251 yr Thank you @ussfletcher. Your instructions worked like a charm. My server is finally finding newly added media.
August 26, 2025Aug 26 On 2/27/2023 at 6:13 AM, BigDanT said:Also, there's a great new Plex DB tool that im using regularly to keep my DB working nicely. It can be found here:- https://github.com/ChuckPa/PlexDBRepairI know this is old, but thank you for sharing this, it helped me quite a bit.
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.