There was an unexpected error loading this library

server-windows

#1

Hi

"There was an unexpected error loading this library
Please visit our forums if you continue to experience problems"

I get the above error when I try to access either movies or TV series. Music is fine. If I set the view to folder then its fine, but I don't want that as I will have to go into each of the various folders as I have got films and TV series spread across multiple drives. I have restarted my PC, the server software. It is the same on my android phone as well, although I can go to discover on there and it will bring up the various lists, recently watched etc... but it wont list the movies under the browse tab it says there is no items to display.

I am running server Version 1.12.3.4973, everything was fine just over a week ago.

Any assistance would be appreciated. I am sure it is something simple and I have to say this is the first error I have had that has got me stumped.

Let me know if there are any logs i need to post.

Regards
Johnathan


#2

I’ve just realised that if I change the filter from by Title to year or anything else then it loads the library fine. Annoying as I only want to see them by Title.


#3

Same for me. I’m running 1.13.1.5063 on Windows 10. This affects all my ‘movie’ libraries, but not TV. I even created a new Movie library, added some media, and the same error appears when I list by Title. Changing to any other option (release, date added, etc.) all work fine.

This problem is relatively new for me, but I can’t say exactly when it started of what version started it (I track the Plex Pass betas automatically).

This problem is NOT present in 1.13.1.5063 on MacOS.


#4

I tracked this down to a sqlite error, “Error: no such collation sequence: naturalsort” and I fixed it a repair using the command-line sqlite client.


#5

Hello, can you elaborate on the method you used to repair this error? I tried rebuilding the db from a dump but the error showed up then. Do I need to manually change the collation for that index? I apologize but I’m not familiar with sqlite. Thanks.


#6

I just had this problem with 1.13.1.5063 on MacOS. I seem to have fixed it by switching the sort order in each affected library to By Year, and then back again to By Title. No database fiddling necessary.


#7

Hmm, for me it seems to occur infrequently (my server is pretty active). It seemed to start when I added my classical music library (about 800 artists across 50k files). Some have suggested keeping libraries like that (which don’t change often) to separate plex servers with only manual updates, but this seems silly when I hear of people with 12k+ movies on 45TB NAS on a single server going by without issue (mine is 20TB so far but the classical is only 500gb).

I will say though that I did what you suggested and those libraries suddenly started moving snappier, but I think there’s a more permanent solution out there.


#8

@christophermn said:
I tracked this down to a sqlite error, “Error: no such collation sequence: naturalsort” and I fixed it a repair using the command-line sqlite client.

@“chrustalew@gmail.com” , can you please tell us the steps/commands you used to repair the corruption? Seems like quite few people are having this isssue.


#9

I just tried to repair my database(on windows) and got the unknown collation error. My plex install goes back a long way.

dump.sql contains:

CREATE INDEX ‘index_title_sort_naturalsort’ ON ‘metadata_items’ (‘title_sort’ COLLATE naturalsort);


#10

same issue here - I tried the sorting change as described above to no avail…it just made everything disappear and I had to switch it over to the plex cloud server and then back to my local server for the libraries to appear again. and this still gives the same error:
cmd: sqlite3 com.plexapp.plugins.library.db “PRAGMA integrity_check”
Yields:
Error: no such collation sequence: naturalsort


#11

I wonder if this is the package improbability.net/#sqlitenatural. I’ve found this missing on several different sqlite installs (mac,windows,ubuntu) so I assume it’s an optional package. Will perform some testing later today if possible.

I’d also like to comment that I recreated my plex database (as I wanted to separate my music from tv/movie collections as the former doesn’t require regular updates like tv/movie would) and the issue is (not surprisingly) found on the two fresh installs (mac,win).


#12

Not sure if this has been fixed, but now when running the cmd: ‘sqlite3 com.plexapp.plugins.library.db “PRAGMA integrity_check”’ I get OK, instead of the error about naturalsort. I did just download and install the latest plex package, so maybe this has been fixed. I also don’t seem to be getting the error in the front-end anymore either. I am curious about mshockle’s finding about not finding the sqlitenatural not being part of the ubuntu package. Where would I find this out?


#13

I’m still getting it, but I’m not on windows I’m on MacOS but weirdly when running the command not from the db folder I still get OK maybe you’re not running the command from the folder where the db resides.


#14

There is a problem with running the PRAGMA integrity_check and the following steps should allow you to run it and repair any corruptions

sqlite3 com.plexapp.plugins.library.db "DROP index 'index_title_sort_naturalsort'"
sqlite3 com.plexapp.plugins.library.db "DELETE from schema_migrations where version='20180501000000'"

After these changes, you should be able to run the integrity check and go through the process of repair if there is corruption

sqlite3 com.plexapp.plugins.library.db "PRAGMA integrity_check"

Note: by deleting the schema_migrations entry, the update for naturalsort would get applied again on launch of Plex Media Server and the database schema update would be re-applied


#15

—edited: disregard this post


#16

looks like some bad QA testing here…thinking someone should have caught this on an overnight test. i restored an older db yesterday and it seemed to fix the problem. this morning i woke up to find its back again ( https://forums.plex.tv/discussion/comment/1677862#Comment_1677862 ).

The plex db should be BULLETPROOF! Rebuilding a db from scratch when you have a lot of content is a PAINFUL experience that takes forever. I’m a huge plex supporter but honestly issues like this could put a blemish on the product.


#17

@sa2000 said:
There is a problem with running the PRAGMA integrity_check and the following steps should allow you to run it and repair any corruptions

sqlite3 com.plexapp.plugins.library.db "DROP index 'index_title_sort_naturalsort'"
sqlite3 com.plexapp.plugins.library.db "DELETE from schema_migrations where version='20180501000000'"

After these changes, you should be able to run the integrity check and go through the process of repair if there is corruption

sqlite3 com.plexapp.plugins.library.db "PRAGMA integrity_check"

** Note: by deleting the schema_migrations entry, the update for naturalsort would get applied again on launch of Plex Media Server and the database schema update would be re-applied**


Note: by deleting the schema_migrations entry, the update for naturalsort would get applied again on launch of Plex Media Server and the database schema update would be re-applied

does this mean after you execute the above DROP/DELETE commands the problem will resurface as soon as you relaunch plex ?


#18

@maccrory said:

@sa2000 said:
There is a problem with running the PRAGMA integrity_check and the following steps should allow you to run it and repair any corruptions

sqlite3 com.plexapp.plugins.library.db "DROP index 'index_title_sort_naturalsort'"
sqlite3 com.plexapp.plugins.library.db "DELETE from schema_migrations where version='20180501000000'"

After these changes, you should be able to run the integrity check and go through the process of repair if there is corruption

sqlite3 com.plexapp.plugins.library.db "PRAGMA integrity_check"

** Note: by deleting the schema_migrations entry, the update for naturalsort would get applied again on launch of Plex Media Server and the database schema update would be re-applied**


Note: by deleting the schema_migrations entry, the update for naturalsort would get applied again on launch of Plex Media Server and the database schema update would be re-applied

does this mean after you execute the above DROP/DELETE commands the problem will resurface as soon as you relaunch plex ?

Depends on which problem you are referring to.

There is no bug that causes database corruption stopping the library from loading - however there is an issue affecting the running of the PRAGMA integrity_check

Linking to the other forum thread where you have posted http://forums.plex.tv/discussion/comment/1678450/#Comment_1678450


#19

An update to 1.13.2.5102 has fixed mine for me :slight_smile:


#20

i have 1.13.2.5102 and still see this error
if i refresh my meta data i can browse the library but this is only a temp fix
have i hit some sort of max records limit?

providing an error is 1 thing, what is better is saying “here is an error and how to fix it”
i have been seeing this error for a while…