Docker Databases


rmp5s

Recommended Posts

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.

image.png.c06c44984f1d3a1913959edb5b062aa4.png

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:

image.thumb.png.53bfb58e7f5b9b38b5e4d8c5f1dc3fe5.png

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

image.thumb.png.e744e392b1cf0c288156818c61b3ef00.png

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.

Link to comment

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 by jmztaylor
Link to comment
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!

Link to comment

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 by rdawg1234
Link to comment
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

Link to comment
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...

image.thumb.png.a44035e4d908bb98cc35c84d1be08e46.png

Link to comment

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 by rmp5s
Link to comment

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

Link to comment
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...

image.thumb.png.7699ab4f23e32526fa8d3600fe4db63d.png

 

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.

Link to comment

Literally the very last comment on desktop is literally the very first comment on mobile because...reasons...I guess.

image.thumb.png.b31837392c5f764607ccdb4e7eeb4d19.png

 

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

Link to comment
  • 2 months later...

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

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.