dakusan / PlexPlaylistImporter

Import playlists into Plex
Other
80 stars 18 forks source link

DB Error: no such collation sequence: naturalsort #17

Closed samplethief closed 5 years ago

samplethief commented 6 years ago

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 commented 6 years ago

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 commented 6 years ago

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

sea3pea0 commented 5 years ago

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 commented 5 years ago

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'

seanfilidis commented 5 years ago

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 commented 5 years ago

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 commented 4 years ago

I had the the no playlist showing up issue as well, but the workout around from https://github.com/dakusan/PlexPlaylistImporter/issues/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.