There’s a Plex error that can occur all over the place: ‘There was an unexpected error loading this library‘.
You can get this error when you’re trying to schedule shows to record, open your libraries, and so on.
How to Fix Error Loading Library on Plex
Run Plex Server as Admin
You may not have the necessary permissions to load the libraries. Try running Plex with admin rights.
- Right-click on the Plex Server icon.
- Then select Run as Administrator.
- Try to load the problematic libraries again. Or repeat the action that initially caused the error.
Clean Up Bundles
Some users suggested that cleaning up the bundles worked for them.
- Go to Libraries.
- Then click on the three dots to open the menu.
- Select Clean bundles from the drop-down menu. Check if the error is gone.
Optimize the Database
- Launch Plex and sign in.
- Go to the left pane menu. Select the action icon.
- Then select Manage Server.
- Next, select Optimize Database.
- Confirm your choice. Wait until the whole process is complete. This should not take more than 10 minutes.
Refresh Your Metadata
Metadata issues may also cause various Plex problems, including library errors. Perform a metadata refresh on the affected section.
- Connect to your Plex account.
- Then go to the left pane, and select the problematic library.
- Select Refresh all metadata.
- Wait until Plex has refreshed the metadata.
- Restart your connection to the server. Check if this method worked.
Disable Security and Privacy Extensions
If you installed security and privacy add-ons on your browser, disable them. They might be interfering with Plex. Maybe Ad Block, uBlock, Ghostery, or other similar extensions are preventing you from loading the libraries.
- Click on your browser menu.
- Go to More tools → Extensions. Or select Add-ons directly (depending on your browser).
- Turn off the extensions.
- Repeat the action that initially triggered the library error.
→ Note: You may want to backup your data before going to the next troubleshooting steps.
Repair Your Plex Database
If the Plex server database itself is corrupted, you can repair it and hopefully fix the library errors. Below you’ll find the steps to follow on Windows 10.
- Install the SQLite3 tools on your machine.
- Shut down the local Plex server.
- Then press the Windows key and the R keys. Launch a new Run window.
- Enter cmd, and right-click on Command Prompt. Launch it with admin rights.
- Next, enter the commands below to repair your Plex server database. Hit Enter after each one.
- To check for corruption issues:
- cd “%LOCALAPPDATA%\Plex Media Server\Plug-in Support\Databases”
- copy 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′”
- sqlite3 com.plexapp.plugins.library.db “PRAGMA integrity_check”
- To repair the issues:
- copy 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′”
- sqlite3 com.plexapp.plugins.library.db .dump > dump.sql
- del com.plexapp.plugins.library.db
- sqlite3 com.plexapp.plugins.library.db < dump.sql
- Additionally, you may also want to delete the following two files:
- com.plexapp.plugins.library.db-shm
- com.plexapp.plugins.library.db-wal
- To check for corruption issues:
- Restart your computer. Check if the Plex library error persists.
If you need to repair your Plex database and you’re using a Mac or Linux computer, go to this Plex support page. You’ll find more information on the commands to use.
Remove Information Related to other Accounts
Some users said they noticed this problem was caused by conflicting user account information. This may happen if you used different accounts to access the server at a given time.
Somehow, the server is signed in to one account, while the web app is signed in to a different account. Removing any information about the old account should help.
First, quit Plex and then follow the steps below.
On Windows 10:
- Open the Registry Editor.
- Then follow this path: HKEY_CURRENT_USER\Software\Plex, Inc.\Plex Media Server
- Delete these entries:
- PlexOnlineHome
- PlexOnlineMail
- PlexOnlineToken
- PlexOnlineUsername
- Restart Plex.
On Mac:
- Launch the Finder.
- Press the Options key and click on the Go menu.
- Then go to ~/Library/Preferences/. The file you’re interested in is this: com.plexapp.plexmediaserver.plist file.
- Next, launch the Terminal and launch these commands:
- defaults delete com.plexapp.plexmediaserver PlexOnlineHome.
- defaults delete com.plexapp.plexmediaserver PlexOnlineMail.
- defaults delete com.plexapp.plexmediaserver PlexOnlineToken.
- defaults delete com.plexapp.plexmediaserver PlexOnlineUsername.
Let us know if you’re still getting any errors when loading your Plex libraries.
Did this help? Let us know!