Hello,
i think i have problems with database corruption on my linum mint 17.
My problem is that PMS every hour becomes unvailable and i have to reboot.
These is my terminal commands and responds
/…/Plug-in Support/Databases # sqlite3 com.plexapp.plugins.library.db “PRAGMA integrity_check”
Error: no such collation sequence: naturalsort
/…/Plug-in Support/Databases # sqlite3 com.plexapp.plugins.library.db .dump > dump.sql
/…/Plug-in Support/Databases # mv com.plexapp.plugins.library.db com.plexapp.plugins.library.db.original
/…/Plug-in Support/Databases # sqlite3 com.plexapp.plugins.library.db < dump.sql
Error: near line 814058: no such collation sequence: naturalsort
Why do you think it is the database? If the database is broken a reboot / Plex restart would do nothing.
Your terminal output just shows, that your local sqlite installation is not compatible to the sqlite version used by Plex.
Please provide the server logs, as usual.
https://support.plex.tv/articles/200250417-plex-media-server-log-files/
I thought “no such collation sequence: naturalsort” was an error about corruption DB.
Do you know how could i campotible sql version?
I’m not able to download Log as if i go in in web app and press download log i have error “500 Internal Server Error”
Any idea how to solve?
Maybe i found out the problem. It seems plex cannot access /tmp dir.
Now i gace permission and can donwload logs.
Let’s see if i still have problems.
Logs may be manually obtained:
sudo tar cfz /tmp/PlexLogs.tar.gz "/var/lib/plexmediaserver/Library/Application Support/Plex Media Server/Logs"
Attach “PlexLogs.tar.gz”
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);
Still the same
Plex uses a very recent splite version. Your sqlite installation does not have support for the “naturalsort” collation. That’s it. Not a sign of any database error.
Or maybe plex use a customised sqlite as I get the error from a build of the tools I downloaded from sqlite.org yesterday, I found a code snippet on the net that shows how to add naturalsort to customised builds of sqlite.
We do not use a customized SQLITE3.
On my Fedora 26 workstation, naturalsort works just fine.
I’m using ver 3.23.1.0 of sqlite.exe, downloaded today from sqlite.org and placed in the databases directory to rebuild using the command lines
sqlite3 com.plexapp.plugins.library.db .dump > dump.sql
rename com.plexapp.plugins.library.db com.plexapp.plugins.library.db.original
sqlite3 com.plexapp.plugins.library.db < dump.sql
There are three references to naturalsort in my dump.sql
INSERT INTO schema_migrations VALUES(‘20180501000000’,‘DROP index ‘‘index_title_sort_naturalsort’’’,1);
INSERT INTO sqlite_stat1 VALUES(‘metadata_items’,‘index_title_sort_naturalsort’,‘25308 2’);
CREATE INDEX ‘index_title_sort_naturalsort’ ON ‘metadata_items’ (‘title_sort’ COLLATE naturalsort);
The inserts are fine as one would expect. The DDL create index statement fails .
I tried grabbing an older version of sqlite.exe from 2017. This fails too. Does sqlite.exe have any dependencies or is it monolithic?
No idea. Not a Windows guy. You’ll need to ask further in the SQLite forums.
I have installed latest version of sqlite:
sqlite3 --version
3.22.0 2018-01-22 18:45:57 0c55d179733b46d8d0ba4d88e01a25e10677046ee3da1d5b1581e86726f2alt1
But i have the same error:
sqlite3 com.plexapp.plugins.library.db “PRAGMA integrity_check”
Error: no such collation sequence: naturalsort
I’m using linux mint 17
I’ve just tried on my second server where i have UBUNTU 16.04.
Same error:
sqlite3 com.plexapp.plugins.library.db “PRAGMA integrity_check”
Error: no such collation sequence: naturalsort
I am still unsure why you would want to access the Plex sqlite database directly, in the first place? What do you want to do?
@uglymagoo said:
I am still unsure why you would want to access the Plex sqlite database directly, in the first place? What do you want to do?
I’m following plex instruction to check database integrity.
If i cannot use sqlite3 i cannot check or repair DB
back down from 3.22. It’s still brand new with no updates. VERY likely has bugs
[chuck@lizum ~.102]$ sqlite3
SQLite version 3.20.1 2017-08-24 16:21:36
Enter ".help" for usage hints.
Connected to a transient in-memory database.
Use ".open FILENAME" to reopen on a persistent database.
sqlite>
@Fabio_Brass said:
I’m following plex instruction to check database integrity.
If i cannot use sqlite3 i cannot check or repair DB
Please tell us about your specific problem and ignore this “Repair your database” article for a moment. I am quite sure you won’t need to access the database yourself. Your best option is also always to just restore a database backup.
https://support.plex.tv/articles/202485658-restore-a-database-backed-up-via-scheduled-tasks/
However, I am able to reproduce your problem to follow this guide with the latest version of Plex and I have reached out to the devs.
This topic is also being discussed here: https://forums.plex.tv/discussion/comment/1670664#Comment_1670664 I’ve commented on sqlite naturalsort there. Best of luck on this annoying issue (yours seems a tad more complicated with your server actually “crashing”)
The devs are aware and actively working on a fix.