There was an unexpected error loading this library category

Server Version#: 1.16.0.1226
Player Version#: 3.95.2
CentOS 7 64 bit Linux 3.10.0-957.10.1.el7.x86_64

I am getting this error “There was an unexpected error loading this library category” in some library all of a sudden. I have done “Optimize Database” , “Clean Bundles”, “Refresh All Metadata” but the problem still persists. Also in the “Status” it says “Unable to load statistics” and in the “Home” it says “There was an unexpected error loading the dashboard”. Please help me.

Plex Media Server Logs_2019-06-29_15-26-25.zip (3.2 MB)

Please disable ‘verbose’ logging. It is the opposite of helpful.

Your database is damaged.

Jun 29, 2019 15:22:27.843 [0x7fdf10f89700] ERROR - SQLITE3:(nil), 11, database corruption at line 79051 of [bf8c1b2b7a]
Jun 29, 2019 15:22:27.843 [0x7fdf10f89700] ERROR - SQLITE3:(nil), 11, statement aborts at 11: [select id from metadata_items where metadata_type=? and library_section_id=? and absolute_index is not null] database disk image is malformed

https://support.plex.tv/articles/201100678-repair-a-corrupt-database/

Thanks a lot for your quick answer. I have followed your instruction but at the end I got an error:

[root@plex Databases]# sqlite3 com.plexapp.plugins.library.db < dump.sql
Error: near line 1647543: PRIMARY KEY must be unique
Error: near line 1647544: PRIMARY KEY must be unique
Error: near line 1647545: PRIMARY KEY must be unique
Error: near line 1647546: PRIMARY KEY must be unique

After that when I tried to start the Plex service it did not start.

[root@plex ~]# systemctl status plexmediaserver
● plexmediaserver.service - Plex Media Server
Loaded: loaded (/usr/lib/systemd/system/plexmediaserver.service; disabled; vendor preset: disabled)
Active: activating (auto-restart) (Result: exit-code) since Sat 2019-06-29 22:16:44 +06; 257ms ago
Process: 6920 ExecStart=/bin/sh -c PLEX_MEDIA_SERVER_INFO_VENDOR="(grep ^NAME= /etc/os-release | awk -F= "{print \$2}" | tr -d \" )" PLEX_MEDIA_SERVER_INFO_DEVICE="PC" PLEX_MEDIA_SERVER_INFO_MODEL="(uname -m)" PLEX_MEDIA_SERVER_INFO_PLATFORM_VERSION="(grep ^VERSION= /etc/os-release | awk -F= "{print \$2}" | tr -d \" )" LD_LIBRARY_PATH=/usr/lib/plexmediaserver/lib "/usr/lib/plexmediaserver/Plex Media Server" (code=exited, status=255) Process: 6917 ExecStartPre=/bin/sh -c /usr/bin/test -d "{PLEX_MEDIA_SERVER_APPLICATION_SUPPORT_DIR}" || /bin/mkdir -p “${PLEX_MEDIA_SERVER_APPLICATION_SUPPORT_DIR}” (code=exited, status=0/SUCCESS)
Main PID: 6920 (code=exited, status=255)

Jun 29 22:16:44 plex.sambd.net systemd[1]: Unit plexmediaserver.service entered failed state.
Jun 29 22:16:44 plex.sambd.net systemd[1]: plexmediaserver.service failed.

Do you know how I can undo it?

Try the repair procedure on one of the database backup copies, then.
They are in the same folder (by default) and have file names like

com.plexapp.plugins.library.db-2014-04-19
com.plexapp.plugins.library.db-2014-04-22
com.plexapp.plugins.library.db-2014-04-25

Thanks a lot. It worked. After following your instructions I had to do one more thing.
chown plex:plex com.plexapp.plugins.library.db

[Solved]

Correct, since you are doing the repair on the command line as a different user. (most likely root)

This helped fix My issue: So glad I ran across this post.

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.