G-d dammit, I wish Plex wouldn’t screw with what already worked just fine. Updated my server (unRAID, Docker) and now in the web interface I get some stupid “There was an unexpected error loading this library” issue. What the H-E-double hockeysticks is this crap???
(P.S. If the app says come to the forums but doesn’t say where, then I’m posting a new thread. I don’t even want to be here; I want to be watching media from the same interface I had yesterday.)
Wait until all library scan, or -update activity has died down.
Then tell Plex to optimize its database. (Settings - Server - Troubleshooting)
Then reload the web interface in the browser (F5)
This should take care of 95% of all such occurences.
I have the same problem…I had Plex on a windows machine and I’d get this “There was an unexpected error loading this library/dashboard” once in a while but just refresh the page and it’s fine. I change over to unraid and I get it every other day and refresh doesn’t help… maybe some people over at plex should figure out what the issue is…
Optimizing didn’t work for me, either. What did was to restore one of the library backups. Plex makes a backup every few days, and keeps maybe the three or four most recent ones. So if your problems just started, restore a backup from a few days ago, and let Plex re-index the newest stuff.
If I may add: if you had to restore a database backup, you should also perform at least the database check procedure. Just to rule out that some damage is already growing in the older backup.
I ran into the same issue and optimizing the database did not fix it. I tried creating a new library and seeing if that might be a semi-quick fix. However, after it was done adding the movies and metadata to the new library, I went to access it and it showed correctly for a brief second and then the same error occurred once more.
I decided it was time to try checking/repairing the database. After running a check on the database, it came back with this error:
*** in database main ***
Page 98114: bTreeInitPage() returns error code 11
Page 98115: bTreeInitPage() returns error code 11
Page 98116: bTreeInitPage() returns error code 11
Error: database disk image is malformed
I followed the repair instructions to repair a corrupt database but it did not work. For some reason when trying to move the dump.sql file into com.plexapp.plugins.library.db, it created a 0 byte file and Plex errored out on startup stating it couldn’t access the media database.
I ended up replacing the corrupt database with a backup I had after checking to make sure the backup database had no errors. That did the trick and fixed the issue finally. Hopefully, this will help others who are running into the same problem.
Increvateur, even though I’ve (probably) solved my own database problem by doing most of what you did, I want to thank you for posting a full and detailed solution to help others.
I can’t count the number of times I’ve gone to some forum to find a solution to an arcane problem I’ve had, and although the problem is exactly the same as mine, there’s no solution ultimately posted. Sometimes it’s “figured it out!” and sometimes it’s just silence. Both are frustrating.
Every now and then, I have a problem and find the perfect thread: same problem as mine, short, and ending with the same sort of exhaustive solution as yours. The world would be a better place if more people did what you’ve done!
I’m right there with you and that’s a big reason why I posted. It’s great when someone finds an answer that works and posts it as it helps everyone out including the people supporting Plex. It allows them to move on to other posts, reference back to this one, or send that info off to the devs.
I definitely appreciate the positive feedback! Cheers!