Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DB Error: no such collation sequence: naturalsort #17

Closed
samplethief opened this issue Sep 20, 2018 · 7 comments
Closed

DB Error: no such collation sequence: naturalsort #17

samplethief opened this issue Sep 20, 2018 · 7 comments

Comments

@samplethief
Copy link

samplethief commented Sep 20, 2018

Getting the following attempting to import a playlist on Windows 10 x64 using the windows.exe binary source version listed here: https://www.castledragmire.com/Projects/Plex_Playlist_Importer#Comments
My Plex DB is in the standard location: %LOCALAPPDATA%/Plex Media Server/

DB Error: no such collation sequence: naturalsort

@dakusan
Copy link
Owner

dakusan commented Sep 20, 2018

https://forums.plex.tv/t/database-corruption/236013/27 . It seems to be agreed that this is a database corruption problem. The last post in that thread suggests the following:

sqlite3 com.plexapp.plugins.library.db “PRAGMA integrity_check”
reported two corrupt indexes:
wrong # of entries in index sqlite_autoindex_fts4_metadata_titles_segdir_1
wrong # of entries in index index_metadata_items_on_changed_at

Solution (in my case):

Shutdown PMS
run sqlite3 com.plexapp.plugins.library.db
“reindex xxxxxx” on all corrupt indexes.
Exit sqlite3 and start PMS again.
Indexing worked again. :slight_smile:


It could also be an incompatible version of sqlite3. Googling will help more with your problem than i can.

@samplethief
Copy link
Author

Thanks. I rebuilt my db from scratch last night so not sure its corruption. I will keep trying.

@sea3pea0
Copy link

sea3pea0 commented Oct 25, 2018

This is what I did when I experienced this problem:

I followed some of the instructions from Plex Website on repairing a corrupt database
cd $PLEX_HOME/Library/Application\ Support/Plex\ Media\ Server/Plug-in\ Support/Databases/
cp com.plexapp.plugins.library.db com.plexapp.plugins.library.db.original
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 running those commands I created a playlist in Plex with 1 song added to it. Then I ran playlist imported and imported the playlist to the playlist I created in Plex. It worked!!

@samplethief
Copy link
Author

This is what I did when I experienced this problem:

I followed some of the instructions from Plex Website on repairing a corrupt database
cd $PLEX_HOME/Library/Application\ Support/Plex\ Media\ Server/Plug-in\ Support/Databases/
cp com.plexapp.plugins.library.db com.plexapp.plugins.library.db.original
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 running those commands I created a playlist in Plex with 1 song added to it. Then I ran playlist imported and imported the playlist to the playlist I created in Plex. It worked!!

Cheers SeaPea,

I fixed mine by downloading the latest sqlite3.exe and dropping it into 'AppData\Local\Plex Media Server\Plug-in Support\Databases'

@dakusan dakusan closed this as completed Oct 25, 2018
@seanfilidis
Copy link

I started experiencing the "naturalsort" issue. I fixed it the same way you guys did.

Now, however, the script seems to work again (I get the success message, e.g., "55 items imported)", but no playlists changes show up in Plex. It's like issue 14 is showing up again, but this time there is no workaround.

@ashenkin
Copy link

ashenkin commented Dec 6, 2018

Same here. Fixed the naturalsort issue with this:

sqlite3 com.plexapp.plugins.library.db .dump > dump.sql
grep -v "naturalsort" dump.sql > newdump.sql
sqlite3 com.plexapp.plugins.library.db < newdump.sql

I can now seemingly import correctly, but no playlist shows up. Perhaps Plex changed the db schema?

@ghuh
Copy link

ghuh commented Oct 20, 2019

I had the the no playlist showing up issue as well, but the workout around from #14 seems to work. Just create the playlist first in the plex UI and then add to the existing playlist. Important to note that if you first create the playlist using this script and then try the workaround with that same name, it won't work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants