rmp5s Posted November 26, 2022 Share Posted November 26, 2022 I had a massive system crash a week or two ago that caused TONS of database issues in basically all of my Docker containers. I've since gotten most of them mostly sorted except for two specific problem children...Binhex-Sonarr and Plex. Binhex-Sonarr: I've done every database repair, restore, etc thing I can possibly think of and I STILL get "database disk image is malformed" at the top of the page as soon as I go to the UI. I've tried everything I can think of...are there any ways to fix the DB other than this and restoring from backup? Maybe I'm repairing/restoring the wrong "sonarr.db"? Maybe I have to do something to one of these other things? Maybe a thing somewhere else? I don't know. This is the current directory contents: Maybe I'm missing something. Maybe I'm in the wrong directory altogether. I don't know. And...Plex: Plex refuses to cooperate. Getting another "disk image is malformed" error... The problem with all this isn't that I can't work with SQL...I am relatively familiar with DBs. The problem is that I don't know where all these DBs are! Once I figure out where all this junk is, I can try to fix it. Worst case scenario, I can just delete it and let it rebuild. If I figure out what's broken with Sonarr for instance, I supposed I can just blow it away and restore from a backup. I still have all my data and I'm relatively diligent about backing up most stuff and I know I have pretty recent backups out of Sonarr. (Backing up from within the GUI backs up the DB, right?) I just gotta be able to get in the thing! Anyway...any help greatly appreciated. This has been a real nightmare!! Thanks. Quote Link to comment
jmztaylor Posted November 27, 2022 Share Posted November 27, 2022 (edited) One thing I have had to do previously, was copy the DB files out and let it rebuild it from scratch. Then I just moved the data from the old db to the new one it created. I typically use https://sqlitebrowser.org/ I am sure there are better ways to repair it but this seemed like an easy way. And the most important part of plex is the watched state. I have used this previously https://support.plex.tv/articles/201154527-move-viewstate-ratings-from-one-install-to-another/ Edited November 27, 2022 by jmztaylor Quote Link to comment
rmp5s Posted November 27, 2022 Author Share Posted November 27, 2022 11 minutes ago, jmztaylor said: One thing I have had to do previously, was copy the DB files out and let it rebuild it from scratch. Then I just moved the data from the old db to the new one it created. I typically use https://sqlitebrowser.org/ I am sure there are better ways to repair it but this seemed like an easy way. And the most important part of plex is the watched state. I have used this previously https://support.plex.tv/articles/201154527-move-viewstate-ratings-from-one-install-to-another/ Nice. I'll check those out! Thanks! Quote Link to comment
bwnautilus Posted November 27, 2022 Share Posted November 27, 2022 5 hours ago, rmp5s said: Nice. I'll check those out! Thanks! Have you looked at Spaceinvader One's video on how to fix a corrupt Plex DB? Quote Link to comment
rdawg1234 Posted December 1, 2022 Share Posted December 1, 2022 (edited) I have been following through the video which is far more helpful than most content out there! i got to the step for running the SQL Lite command and it tells me the command is not found. When i type ls it shows up as “SQL\ Lite*” and whether i try and run SQL Lite, SQL Lite*, SQL\ Lite* nothing runs. any suggestions? (Also trying to get support from Plex forums here: https://forums.plex.tv/t/plex-media-server-docker-in-unraid-media-libraries-something-went-wrong/814674/2) Edited December 1, 2022 by rdawg1234 Quote Link to comment
rmp5s Posted December 1, 2022 Author Share Posted December 1, 2022 On 11/27/2022 at 2:07 PM, bwnautilus said: Have you looked at Spaceinvader One's video on how to fix a corrupt Plex DB? Nope! He's the best but I didn't even know that video existed! Will definitely check that out. How would one go about "resetting" other Dockers that have lost their way? I have backups of most of my Dockers so flat out deleting everything wouldn't really be a huge problem. (I don't think...) Is that a thing? Remove container, delete folders? Which folders? This goes back to my previous, "where is all this stuff" post. lol Quote Link to comment
rmp5s Posted December 4, 2022 Author Share Posted December 4, 2022 On 11/30/2022 at 7:20 PM, rdawg1234 said: I have been following through the video which is far more helpful than most content out there! i got to the step for running the SQL Lite command and it tells me the command is not found. When i type ls it shows up as “SQL\ Lite*” and whether i try and run SQL Lite, SQL Lite*, SQL\ Lite* nothing runs. any suggestions? (Also trying to get support from Plex forums here: https://forums.plex.tv/t/plex-media-server-docker-in-unraid-media-libraries-something-went-wrong/814674/2) Where'd you find the "custom Plex SQLite" program? I'm at 4:20 in (giggidy) and I don't have any Plex anything in /usr/lib... Quote Link to comment
rmp5s Posted December 4, 2022 Author Share Posted December 4, 2022 (edited) Had to start the container, start a terminal INTO the container, go to /usr/lib and find what the Plex directory is called. For me, even though the container is called "Plex-Media-Server", the directory is /plexmediaserver...got it! Now to continue through the vid. 👍 Edited December 4, 2022 by rmp5s Quote Link to comment
rmp5s Posted December 4, 2022 Author Share Posted December 4, 2022 Uuuuuuuuuuuuuuuuuuuuuuuuum... Why can't anything just WORK!? What am I missing here??? Quote Link to comment
rmp5s Posted December 4, 2022 Author Share Posted December 4, 2022 I thought it may be freaking out because of that escape character so I renamed it to plex-sqlite...still nothing. Thought maybe it didn't have executable permissions...nope. Sure does. I'm at a loss... Quote Link to comment
rmp5s Posted December 4, 2022 Author Share Posted December 4, 2022 Running "/mnt/user/appdata/Plex-Media-Server/Library/Application Support/Plex Media Server/Plug-in Support/Databases/com.plexapp.plugins.library.db" --sqlite "PRAGMA integrity_check" as described here, I get: "bash: /mnt/user/appdata/Plex-Media-Server/Library/Application Support/Plex Media Server/Plug-in Support/Databases/com.plexapp.plugins.library.db: Permission denied"...maybe it IS a permissions issue?... Quote Link to comment
rmp5s Posted December 4, 2022 Author Share Posted December 4, 2022 Thought maybe it was saying the permissions of the DB files are the problem so I ran in and gave them a quick 777, ran it again and got this... So. Yea. No idea. I'm lost. Quote Link to comment
Kilrah Posted December 4, 2022 Share Posted December 4, 2022 4 hours ago, rmp5s said: Thought maybe it was saying the permissions of the DB files are the problem so I ran in and gave them a quick 777, ran it again and got this... So. Yea. No idea. I'm lost. You have your quotes such that you're trying to execute the db file, unlike what the post you linked to shows. Quote Link to comment
rmp5s Posted December 5, 2022 Author Share Posted December 5, 2022 42 minutes ago, Kilrah said: You have your quotes such that you're trying to execute the db file, unlike what the post you linked to shows. Yea, I tried it both ways...neither worked. Quote Link to comment
rmp5s Posted December 5, 2022 Author Share Posted December 5, 2022 Literally the very last comment on desktop is literally the very first comment on mobile because...reasons...I guess. The hero we don't deserve...kind of embarrassed I didn't try that, honestly. lol #fail Back in business!...until the next damn thing doesn't work, anyway...🤣 Quote Link to comment
rmp5s Posted December 5, 2022 Author Share Posted December 5, 2022 Made it through the rest of the steps in the video without a hitch!! Now I get this... I'm done with this. Can I just wipe it all and start over? This is insane... Quote Link to comment
rmp5s Posted December 6, 2022 Author Share Posted December 6, 2022 Or maybe I'll install a different Plex container...maybe Binhex? Would that cause problems? I can't think of any...thoughts? Quote Link to comment
rmp5s Posted December 11, 2022 Author Share Posted December 11, 2022 Ended up installing Binhex PlexPass and calling it good. I tried EVERYTHING I could think of to get the old official container back up and running and NOTHING worked. Oh well, I guess. Quote Link to comment
rdawg1234 Posted February 23, 2023 Share Posted February 23, 2023 Sorry I disappeared after getting frustrated. In the end I rebuilt my plex media server and recreated the libraries. Annoying but wasnt end of the world. I believe a hard reboot caused the plex server file corruptions. GL all Quote Link to comment
Recommended Posts
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.