So about a week (shortly after upgrading to lifetime) I bought a WD data center drive and moved part of my collection onto it …then I added those library folders in addition to their current location(idea was that any manual changes I had made would be transferred over, which they weren’t) …then after it scans I removed the old folder location. This worked fine for the first few, no issues …then the last two it wouldn’t save changes when I tried to remove the old location and 1 of those apparently didn’t scan the new location at all but still shows as pointing to both directories(music) …while my UFC section shows everything in two locations. Reset sever/computer does nothing to fix, I did not take any more extreme measures to try and resolve.
New movies were still adding and identifying as they should …then it just stops. Not seeing new movie adds at all… annoyed so I just decided to deal with it later since movies still seem to be streaming for clients normally. Then a new server update came a couple days ago …normally it installs automatically but not this time, so I click to download it and install it through the windows plex app and it won’t install …looks like it takes server offline in app but it shows it still running in system tray, it come back on in app and still says I need to update …and one of the times I tried …that sound that is made when usb connects/disconnect goes nuts and my mouse freezes …after it calms down I unplug mouse dongle and plug back in and it’s fine, hasn’t done that again …no drives seemed to disconnect. Then I see activity spinner saying it was “backing up database” and then saying it failed “database corrupted” …it has not repeated this since.
…I have never had anything like this issue before …not even sure how I restore from backup and if that will actually fix my issue.
I tried to repeat the steps that gave me issues after restarting server before saving the log file but it it is insisting on scanning my library and I can’t seem to make it stop …so I hope that didn’t complicate the logs.
Your database is indeed corrupted. From your logs:
Aug 31, 2020 08:48:30.839 [111408] ERROR - SQLITE3:0x6182d27b, 11, database corruption at line 64757 of [bf8c1b2b7a]
Aug 31, 2020 08:48:30.839 [111408] ERROR - SQLITE3:0x6182d27b, 11, database corruption at line 64798 of [bf8c1b2b7a]
Aug 31, 2020 08:48:30.839 [111408] ERROR - SQLITE3:0x6182d27b, 11, statement aborts at 53: [delete from metadata_items where id=?] database disk image is malformed
Aug 31, 2020 08:48:30.840 [111408] ERROR - Exception inside transaction (inside=1) (..\Library\MetadataItem.cpp:812): sqlite3_statement_backend::loadOne: database disk image is malformed
Aug 31, 2020 08:48:30.840 [111408] ERROR - Exception inside transaction (inside=1) (..\Library\MediaItem.cpp:782): sqlite3_statement_backend::loadOne: database disk image is malformed
Aug 31, 2020 08:48:30.840 [111408] ERROR - Exception inside transaction (inside=1) (..\Library\Scanner\SectionLocation.cpp:59): sqlite3_statement_backend::loadOne: database disk image is malformed
Aug 31, 2020 08:48:30.840 [111408] ERROR - Exception inside transaction (inside=1) (..\Library\LibraryRequestHandler.cpp:3858): sqlite3_statement_backend::loadOne: database disk image is malformed
Aug 31, 2020 08:48:30.840 [111408] ERROR - Soci Exception handled: sqlite3_statement_backend::loadOne: database disk image is malformed
A corrupted database could certainly cause the problems you’re seeing. All the configuration information for your libraries, and metadata for items in them, is stored in the database. If it can’t be updated due to corruption, you’ll have these sorts of issues.
What caused the corruption? how could I avoid this happening again?
…it first had issues when I simply tried to save changed library folders when moving data to a new drive. Which worked till it didn’t …and then my problem snow balled from there apparently? Any reason my way of adding new library folders before removing old one could be the cause? …how do I move library folders in such a way that I can retain manual changes?
Wasn’t till sever update that it told me there was corruption. I hope I didn’t wait to long and my backups were over written with corrupted ones? …will attempt to fix using those guides shortly. Thank you
There are many things which could cause database corruption. A common one is having the Plex data directory on a network drive and experiencing a connectivity issue during a write. Disk issues could cause it as well. It’s possible there was a power outage at an inopportune time. I’ve seen other report where the user stated that it “just happened.”
As for mitigating it, make sure the Plex data directory isn’t on a network share; it isn’t by default. Make sure the disk where it is located is healthy. If you’re in an area which is prone to power outages, place the server on a UPS.
Did you move your Plex data directory? Or are you saying you moved your media? If the former, perhaps something was corrupted during the copy. If the latter, it likely didn’t contribute to the problem.
Ya …sometime ago but that went smoothly and solved my permissions issue with my metadata …server cache/data disk is a USB connected SSD through an adapter. (I am on dated ASUS gameing laptop G750JZ so I am stuck with USB …unless I resurrect an old tower I built over 10 years ago …which I am considering but concerned older video card not being up to snuff, all components were high end at the time)
Recent change was moving media to a 14tb Data Center Drive I bought since my 20tb my book duo filled up. It is plugged into a 4 port usb connected sabrient dock. Could be problem that took time to manifest and was there before I migrated data?
I haven’t had any power outages and I don’t think I had usb hub disconnects. I try and keep crystaldisk info up and running I think it should give me an alert if there was a drive/power disconnect that I wasn’t aware of?
Ok, I rolled it back about 9 days to before I moved some of the media to a different drive.
Library folder changes seem to be saving now and it’s seeing newly added movies (…other then 1 UFC fight stuck spinning looking for a poster) the only problem seems to be it still won’t update server …looking at the logs myself all I can see is some “parsing schema” errors? Plex Media Server Logs_2020-09-01_15-34-13.zip (8.0 MB)
EDIT: Just tried to empty trash for UFC folder that is showing doubles because I just switched library folders …and it’s telling me there was a problem. File location info still show files in two places but library settings only show it point to one folder?
Sep 01, 2020 15:09:26.628 [147140] ERROR - SQLITE3:0x35fb25c5, 11, database corruption at line 64757 of [bf8c1b2b7a]
Sep 01, 2020 15:09:26.628 [147140] ERROR - SQLITE3:0x35fb25c5, 11, database corruption at line 64798 of [bf8c1b2b7a]
Sep 01, 2020 15:12:54.907 [144988] ERROR - SQLITE3:0x35fb25c5, 11, database corruption at line 64757 of [bf8c1b2b7a]
Sep 01, 2020 15:12:54.907 [144988] ERROR - SQLITE3:0x35fb25c5, 11, database corruption at line 64798 of [bf8c1b2b7a]
Sep 01, 2020 15:20:50.387 [146312] ERROR - SQLITE3:0x35fb25c5, 11, database corruption at line 64757 of [bf8c1b2b7a]
Sep 01, 2020 15:20:50.387 [146312] ERROR - SQLITE3:0x35fb25c5, 11, database corruption at line 64798 of [bf8c1b2b7a]
Sep 01, 2020 15:26:46.520 [74700] ERROR - SQLITE3:0x35fb25c5, 11, database corruption at line 64757 of [bf8c1b2b7a]
Sep 01, 2020 15:26:46.520 [74700] ERROR - SQLITE3:0x35fb25c5, 11, database corruption at line 64798 of [bf8c1b2b7a]
Sep 01, 2020 15:26:53.398 [132320] ERROR - SQLITE3:0x35fb25c5, 11, database corruption at line 64757 of [bf8c1b2b7a]
Sep 01, 2020 15:26:53.398 [132320] ERROR - SQLITE3:0x35fb25c5, 11, database corruption at line 64798 of [bf8c1b2b7a]
If that’s your oldest backup you my not have an uncorrupted version. Have you attempted the database repair procedure? It’s the second link in my first reply. You’ll need the sqlite3 tools for Windows: https://www.sqlite.org/download.html
■■■■, the two from 8/09 won’t update either (which is the oldest blobs file but it’s the big one that matters? That’s the one I see the “modified” date changed)
Oldest regular “library” file I have is from 7/31 …and it seems to be stuck on “checking for update”? Different issue then before? Plex Media Server Logs_2020-09-01_16-37-37.zip (6.6 MB)
Ok… never mind. tried updating through browser and it did same kind of error.
I might have some older back ups on an older cache drive. Will have have to disconnect some stuff to get to the files …will get back after trying those and if same error I will try the repair …or maybe I should just try the repair first? might be easier at this point.
I find it hard to believe I have had corrupted database for this long and no issues?
Don’t do anything with the blobs database for the repair process; just follow the repair directions to the letter. They are specifically written to be used with your current database, not necessarily a backup (though there’s no reason why you could use the procedure on a backup).
If you do perform the repair on a backup DB then yes, you do want to use the corresponding blobs DB. It will be kind of a hybrid between the restore and repair directions. That is, do the restore precisely as documented (just don’t start Plex at the end), then do the repair precisely as documented.
I’d recommend only using backups where were created by Plex. If you have some other process copying out the live database while Plex is running it might itself be corrupted. If you’re talking about cached Plex DB backups, that should be okay.
There may have been issues which you just didn’t notice and they just compounded over time.
For what it’s worth, the most recent Plex Media Server log you provided didn’t have any malformed disk image or database corruption error messages. There are however many of these errors:
Sep 01, 2020 16:33:56.472 [149048] ERROR - LPE: unknown item 26692.
Sep 01, 2020 16:33:56.472 [149048] ERROR - Versions: failed to generate query for path library://0dd610b3-65fa-4dff-a814-e1722141e408/item/%2Flibrary%2Fmetadata%2F26692%3FincludeExternalMedia%3D1
Sep 01, 2020 16:33:56.472 [149048] ERROR - Versions: empty version set query, unable to update status for generator 1648
Any reason I shouldn’t be able to to take server cache files …all of the plex generated data and simply move it to a new drive and then point my server to that drive? …cause that is what I had done some time ago that fixed my metadata folder permissions problem (which was caused by me merging some old partitions on my server cache drive using a different computer …and prior to moving everything I had used a tool recommend by Otto http://lallouslab.net/2013/08/26/resetting-ntfs-files-permission-in-windows-graphical-utility/ https://forums.plex.tv/t/movies-series-no-longer-matching/607411/16
…which I ran but didn’t solve the issue …then gave up till later I simply moved everything to a freshly formatted SSD …any way this could of caused an issue?
…and if my database is no longer corrupted in that last backup I tried why can I still not update the server? …and if it’s not corrupted what is repairing it going to accomplish?
If you want to try it, follow the instructions here:
However, I can’t see a good reason my moving a problematic Plex data folder to a new drive would cure the issue. But it likely wouldn’t harm anything to try it, as long as you keep your existing Plex data folder for safekeeping.
I have no idea, I’m just reporting what I see in the logs. And I wasn’t suggesting that you perform another repair; rather, I was suggesting a procedure to use if you did want to try it again.
To be perfectly honest, at this point, given the history of the server, it may be advisable to start clean. You could always rename your Plex data folder so that a new one will be automatically created.
I have my old server drive that I had copied to my current server drive (that has backups going back to 6/13 on it) …I wasn’t talking about moving my current drive but restoring my old one instead of just the database …or at least part of it.
…and even when I back up to my oldest database (databases which passes the SQLite integrity test) and update still won’t install …I even deleted update files several times forcing them to redownload …after clicking “install” it just sits their showing me the “retry connection” button …till I click it and then it says something went wrong …rinse and repeat. If database isn’t corrupted then what else could be screwed up that is preventing an update? I have a HUGE library 10,000+ movies/music 30tbs worth …starting “clean” sounds like massive undertaking where I am going to lose all my libraries and user data …last time I did a large movie dump I think it took two days and I really don’t want to have to redo everything including losing all my user data. This doesn’t sound like a viable option for me just because it won’t update.
Can I start with clean install and then move my library layout, database and user data files back over? or is it as simple as pointing the new install to my existing server drive data folder?
I guess I’ll just try, fresh install …and then point it to server drive with uncorrupted database and see what happens. As long as I backup I can’t screw up too badly!? …and if there is still a latent problem maybe the errors will show in the log and can be remedied before corrupting again?
Ok, think I found my problem, was backing up my server drive(155gb) and it disconnected …repeatedly. I noticed the same issue awhile back anytime I tried to move a large amount of data from/to drives plugged into my anker hub. I moved the SDD to one of the usb ports integrated into my book duo plugged into a port on the right side and it transferred without a hitch.
I think my USB3 card/ports on the left side of my laptop are failing.
When I had a rare disconnect before I thought my old external WD passport drives were failing as I had a similar drive for a PS4 die …my crystaldisk info registered those drive failures as an unexpected power cycle …but it did not do the same with my ssd …so I assumed it never disconnected.
Good thing I have a parts laptop for this going to replace the component …and am considering replacing my internal data drive with my plex server SSD …or better yet! (just realized!) I can replace my internal bluray with a sata dock adapter!! (hmm and I just saw they have dual SSD adapters …maybe I’ll try raiding two ssds!)
…and then fall back to my old server SSD drive from early august that was never plugged into the failing port. I will report back here when I get it sorted and I thank you for the help you provided.
Ok… finally after testing some large transfers (seems the hub was the issue not the port) and falling back to old server disk, it was still having a problem updating …and noticed under my task manager that the update service was stuck in a stopped state, from the task manager I turned it back on and the update finally went through!
Everything seems to be good now, here’s the log if you or anyone else feel like wasting more time on my problematic ass to make sure there are no errors/issues that i am not aware of. Plex Media Server Logs_2020-09-06_11-36-48.zip (6.4 MB)
Your logs don’t show any signs of database corruption at this point, so you’re probably good there for now. There are plenty of errors/warnings in the logs, but I think most are expected under certain circumstances, e.g. the SSDP messages and unknown metadata type messages.
I’d monitor the system and make sure it performs how you expect.
I reassigned my library folders to new locations again …just as I had done before when I experience problems and now it’s giving me that “changes can’t be saved” problem again but just for my music folder, which I saved for last. Perhaps I spoke too soon.