There was an unexpected error loading this library

server-windows

#1

When I try and open my photos library on my plex server it shows up with this message (There was an unexpected error loading this library) is there anything that I can provide from my plex server to see why this is happening?


#2

I get this error to when trying to load photos:
Ubuntu Virtual Machine via ESXi
Plex Server Version 1.11.3.4803
Reading from Drobo directory over the network

Anything video related works just fine with the same setup. Why?


#3

same issue, newest version on windows 10. tried reinstalling pms several times. deleting and re creating several times. maybe itll work itself out w/ the next version. If not ill post up some logs.

fortunately photos are the leastimportant part of plex for me. That being said, i dont like it when things dont work as intended :stuck_out_tongue:


#4

Plex Web App logging to be enabled - see https://support.plex.tv/articles/201611836-plex-web-app-logs/

Server Debug Logging to be enabled (this is default)
https://support.plex.tv/articles/201643703-reporting-issues-with-plex-media-server/

when error displayed, take screenshot - do not crop it (need to see time and url)

Collect logs
Plex Web App Log - see https://support.plex.tv/articles/201611836-plex-web-app-logs/
(view log, select all, copy to text file)
and server logs zip
https://support.plex.tv/articles/200250417-plex-media-server-log-files/

and attach with time of error (crucial)


#5

May I ask is where your library is located?

Usually this is because Plex is having a hard time scanning and extracting information from that library. This could include slow connections to that library…
Example: “The library I’m trying to access is on my friends computer who has a 56k connection to the internet”

This could mean:

  • Database Corruption
  • Permissions Failure
  • Hard Drive Failure
  • Disconnected or Slow External Hard Drive or other Media
  • Faulty or Slow Data Cabling to a LAN or WAN Library

Also, if you could produce some logs from your Plex Media Server, that would be helpful.


#6

I am also having the same issue with one of my libraries.

Windows Server 2008 R2 SP1

Error occurred at 9:13 PM Arizona time (GMT-7)

Uncropped error screen snip:

I have attached the Plex Web and Server logs.


#7

Same issue here.


#8

Yep. Same issue


#9

Chiming in to say I’m having the same issue with one of my libraries after upgrading to server version 1.13.0.5023. Error present on all clients.


#10

@josurr said:
I am also having the same issue with one of my libraries.

Windows Server 2008 R2 SP1

Error occurred at 9:13 PM Arizona time (GMT-7)

Uncropped error screen snip:

I have attached the Plex Web and Server logs.

It is a database corruption.

May 16, 2018 21:13:30.120 [2824] DEBUG - Request: [127.0.0.1:60760 (Loopback)] GET /library/sections/4/all?type=1&includeCollections=1 (21 live) TLS Page 0-49 GZIP Signed-in Token (josurr)
May 16, 2018 21:13:30.121 [2824] DEBUG - Setting container serialization range to [0, 49] (total=-1)
May 16, 2018 21:13:30.125 [2824] ERROR - SQLITE3:0x2bb2636a, 11, database corruption at line 72951 of [fc49f556e4]
May 16, 2018 21:13:30.125 [2824] ERROR - SQLITE3:0x2bb2636a, 11, statement aborts at 7: [select distinct metadata_items.id from metadata_items  left join media_items on media_items.metadata_item_id=metadata_items.id  left join media_parts on media_parts.media_item_id=media_
May 16, 2018 21:13:30.125 [2824] ERROR - Soci Exception handled: sqlite3_statement_backend::loadRS: database disk image is malformed
May 16, 2018 21:13:30.127 [4784] DEBUG - Completed: [127.0.0.1:60760] 500 GET /library/sections/4/all?type=1&includeCollections=1 (19 live) TLS GZIP Page 0-49 6ms 405 bytes (pipelined: 4)

Pre-existing database issues do show up after upgrades when the upgrade includes a schema update. This is because the action may access all database records

Please go through the following steps to attempt a database repair. The steps outlined on this support article Repair a Corrupt Database need a small adjustment and i will give that below

Download the Sqlite3-tools binaries zip from http://www.sqlite.org/download.html
Section Precompiled Binaries for Windows and unzip - you will use sqlite3.exe for the following steps

For your configuration, the database file path is
D:\AppData\Local\Plex Media Server\Plug-in Support\Databases\com.plexapp.plugins.library.db

Shut down Plex Media Server (exit from system tray plex icon pop-up)

Part 1
The following sequence gives details of the corruption

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'"
sqlite3 com.plexapp.plugins.library.db "PRAGMA integrity_check"

Part 2
The following steps attempt the repair saving existing db file to filename with .original extension

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

If you did not bother with Part 1 , the repair sequence would need to be

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'"
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

Now launch Plex Media Server

The above extra steps are needed for databases on versions 1.13.1.5063 onwards


#11

@“studiozepp@gmail.com” said:
Same issue here.

@derfinatrix said:
Yep. Same issue

@blocker85 said:
Chiming in to say I’m having the same issue with one of my libraries after upgrading to server version 1.13.0.5023. Error present on all clients.

As explained above, it may be pre-existing db corruptions that showed up in this way after upgrading.

Please provide logs and screenshot of the error and time of error

See
https://support.plex.tv/articles/201643703-reporting-issues-with-plex-media-server/
https://support.plex.tv/articles/200250417-plex-media-server-log-files/


#12

Please provide logs and screenshot of the error and time of error

Here are my screenshot and logs.

Thanks for any assistance.


#13

@blocker85 said:

Please provide logs and screenshot of the error and time of error

Here are my screenshot and logs.

Thanks for any assistance.

It is a database corruption

Jun 05, 2018 14:25:19.697 [0x14744edfa700] ERROR - SQLITE3:0x10, 11, database corruption at line 72951 of [fc49f556e4]

Jun 05, 2018 14:25:19.697 [0x14744edfa700] ERROR - SQLITE3:0x10, 11, statement aborts at 11: [select parents.parent_id,count(*) from metadata_items as parents join metadata_items as leaves on leaves.parent_id=parents.id where parents.metadata_type = 3 group by parents.parent_id

Jun 05, 2018 14:25:19.698 [0x14744edfa700] ERROR - Soci Exception handled: sqlite3_statement_backend::loadRS: database disk image is malformed

Jun 05, 2018 14:25:19.699 [0x1474673ff700] DEBUG - Completed: [67.128.11.162:64581] 500 GET /library/sections/2/all?type=2&unwatchedLeaves=1&includeCollections=1 (13 live) TLS GZIP Page 0-49 38ms 478 bytes (pipelined: 8)

As you are on version 1.13.0.5023 the standard instructions for repair should apply
See
https://support.plex.tv/articles/201100678-repair-a-corrupt-database/


#14

@sa2000 said:

It is a database corruption

Thanks! Will follow the instructions to fix.


#15

@sa2000 said:
It is a database corruption

So, I followed the instructions over at: https://support.plex.tv/articles/201100678-repair-a-corrupt-database/

and upon restarting my server, my logs filled with:

Starting Plex Media Server.
Starting Plex Media Server.
Starting Plex Media Server.
Starting Plex Media Server.
Starting Plex Media Server.
Starting Plex Media Server.
Starting Plex Media Server.
Starting Plex Media Server.
Starting Plex Media Server.
Starting Plex Media Server.
Starting Plex Media Server.
Starting Plex Media Server.
Starting Plex Media Server.
Starting Plex Media Server.
Starting Plex Media Server.
Starting Plex Media Server.

continuously until I stop the server. The servers shows offline from all clients. When I place the old database files back, everything operates normally again (except for the corrupted TV library).

Thoughts?


#16

@blocker85 said:

@sa2000 said:
It is a database corruption

So, I followed the instructions over at: https://support.plex.tv/articles/201100678-repair-a-corrupt-database/

and upon restarting my server, my logs filled with:

Starting Plex Media Server.
Starting Plex Media Server.
Starting Plex Media Server.
Starting Plex Media Server.
Starting Plex Media Server.
Starting Plex Media Server.
Starting Plex Media Server.
Starting Plex Media Server.
Starting Plex Media Server.
Starting Plex Media Server.
Starting Plex Media Server.
Starting Plex Media Server.
Starting Plex Media Server.
Starting Plex Media Server.
Starting Plex Media Server.
Starting Plex Media Server.

continuously until I stop the server. The servers shows offline from all clients. When I place the old database files back, everything operates normally again (except for the corrupted TV library).

Thoughts?

I can see repeated crashes on startup due to the database being corrupt with a table missing

Jun 07, 2018 20:37:50.230 [0x14e4b5b4e800] ERROR - SQLITE3:0x10, 1, no such table: schema_migrations
Jun 07, 2018 20:37:50.230 [0x14e4b5b4e800] ERROR - Database corruption: sqlite3_statement_backend::prepare: no such table: schema_migrations for SQL: select version from schema_migrations order by version

This continued until

Jun 07, 2018 20:37:54.236 [0x154558708800] DEBUG - Running migrations.
Jun 07, 2018 20:37:54.236 [0x154558708800] ERROR - SQLITE3:0x10, 1, no such table: schema_migrations

but the startup after this at Jun 07, 2018 20:41:28 was ok.
So did you attempt the repair between 20:38 and 20:41 ?
Did you bring back an older database ?

The database download zip is empty which indicates that the database still had some corruptions at 20:45 when the database download was attempted

I can have a look at the database if you send me a zip of it by private message and also some info on what was done between 20:38 and 20:41

The files to zip are

/config/Library/Application Support/Plex Media Server/Plug-in Support/Databases/com.plexapp.plugins.library.db
/config/Library/Application Support/Plex Media Server/Plug-in Support/Databases/com.plexapp.plugins.library.db-wal
/config/Library/Application Support/Plex Media Server/Plug-in Support/Databases/com.plexapp.plugins.library.db-shm

If too big to attach in a message as zip, please upload to dropbox or similar service and send me a link to the zip


#17

Sounds great, will do. Thanks.


#18

I have looked at the database files and there are corruptions still

Could you go through the following repair steps

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'" 

sqlite3 com.plexapp.plugins.library.db .dump > dump.sql
mv com.plexapp.plugins.library.db com.plexapp.plugins.library.db.original
sqlite3 com.plexapp.plugins.library.db < dump.sql

and delete

com.plexapp.plugins.library.db-shm
com.plexapp.plugins.library.db-wal

and then restart the server

If you continue to have issues with the database then look for backup - the folder zip you sent me shows last successful backup was dated 25 April


#19

This appears to have resolved the database corruption! Thanks much!