Repair Database on Nvidia Shield Pro

I had to fix a bunch of movie titles in my library. I copied them out to my computer, did changes, then deleted the originals in Plex and copied the fixed files over. Somehow that process messed up my library.

When I’m in the Library I get a black screen with:

“Something Went Wrong. An Unexpected Error Occurred.”

The other tabs like, Recommend, Collections, Playlists don’t have this issue. My other libraries (TV) are also fine. It’s just the Movies one. I’ve tried scanning. Restarting the server. Deleting the newly added titles. Clearing cache, and nothing helps. My Backups folder was empty, even though it’s set up in the dashboard (don’t know what went wrong there)

I was going to try and follow the Repair a Corrupted Database article (it’s for desktop plex libraries, not Shield). I copied the database files to my computer and would move them back after the repair, but the article isn’t specific on how to open the database with SQLite.

My media is in a hard drive enclosure connected to the Nvidia Shield Pro via USB. I can access the drives from my computer via ethernet.

What further info would anyone need for me to post, to help with this? Logs?

Thanks in advance

Server Version#:1.43.0.10467
Player Version#:10.30.8.4222
<If providing server logs please do NOT turn on verbose logging, only debug logging should be enabled>

I would try DBRepair first.

I ran DBRepair (at least it look like it ran). The modified dates on the DB files didn’t change. I copied them over to the Shield’s database location. Deleted cache, rebooted, and still no change. I even tried deleting a folder in the Add Folders to Your Library, and when I saved I got the message “your changes could not be saved” and the folder was still there. This is very frustrating.

did you change the filenames ?

There are a couple of things I would try.

Rename the folders that the files reside in, if they are in the following format:

movies\Ghostbusters\Ghostbusters.mkv

try renaming it to

movies\Ghostbusters (1984)\Ghostbusters.mkv

then rescan your library.

If that does not work, move the folders that the files reside in to another drive, then carry out a scan of your films.

Go to settings > Manage > Libraries then within the 3 dot menu next to the library select the option to Empty Trash.

The go to Manage > Troubleshooting and Optimise Database and also go for Clean Bundles.

Then place the folders back in to the original directory and carry out a rescan.

These are the steps I would personally try to resolve the issue first.

I moved all the movies into a Movies folder (they had been loose in the NVIDIA_SHIELD folder and rescanned: No change

Moving to another drive is a problem as there are 6TB of media and there’s no drive to move them to.

I tried to Empty Trash and got a: There was a problem emptying the trash

Tried Clean Bundles, but still no effect.

I was able to Empty Trash on my other libraries, but Movies is the one with the issue.

Do you know how I can repair databases on an Nvidia Shield Pro Plex Media Server?

When you moved the movies did you remember to update the path of where the movies had been moved to for the library?

I am not too sure how to repair the database, you may need to restore a backup of the database, these are normally taken automatically and stored on the shields storage.

I do not recall ever having to do this but you can use this reference:
https://support.plex.tv/articles/202485658-restore-a-database-backed-up-via-scheduled-tasks/

Stop Plex Server: Go to Settings > Apps > See all apps > Plex Media Server > Force Stop.

Access Shield Files: Use a computer on the same network to access the Shield files. Navigate to \SHIELD\internal\Android\data\com.plexapp.mediaserver.smb\Plex Media Server\Plug-in Support\Databases.

Locate Backup: Go to the Database Backups folder located within the Plex Media Server directory.

Restore Backup: Find the most recent, non-corrupt database files (files ending in .db-YYYY-MM-DD). Copy these files into the Databases folder.

Rename Files: Rename the newly copied files by removing the date extension so they become com.plexapp.plugins.library.db and com.plexapp.plugins.library.blobs.db.

Delete .wal and .shm files: If they exist, delete files named com.plexapp.plugins.library.db-wal, …library.db-shm, …blobs.db-wal, or …blobs.db-shm.

Restart Plex: Turn the Plex Media Server back on, either by starting the app or rebooting the Shield.

I would ensure that you take a full backup of the entire Plex Media Server\Plug-in Support\Databases just to be on the safe side (if it is not too large).

The backup folder was empty, which doesn’t make sense, since its location is setup in the settings. But that aside, the library won’t update and looks like this. My other libraries are fine.

I had made a Playlist of the titles I was fixing (about 44 titles). I copied them all to desktop so I could make the changes. When that was done, I then deletes the Plex files from inside the playlist, by clicking the 3 dots next to the title and deleted them. It was after this process, that the issue started. Those titles aren’t currently in the media folder, but if I go to the Home button, the titles still appear in the Recently Added in Movies. You can’t play them, and if you try to delete from there I get a message “There was a problem deleting this item.”

This is a new one to me.

I think the logs are needed for this. is there anything of great interest in the logs/console output when this happens?

I don’t know how to read the logs or even which one to check. I just downloaded a zip and there’re several types (Plex Crash Uploader, Scanner Chapter Thumbnails, Scanner Credits, Scanner Deep Analysis, etc).

Which one would help if I posed it here?

At a guess possibly the latest plex media server.log file?

It is just a case of recreating the error and reading the events around the time it happens.

Looking at the log, it seems to see all the movies. I did find a couple errors that I’ve highlighted below. A database corruption and a database disk image is malformed:

Mar 15, 2026 13:51:05.563 [202014076096] DEBUG - PlayQueue: Converted ‘server://eDcJHrrHSgvFpsYxqb6g97uaQTd2kE31rPUeDZTeDsjVq/com.plexapp.plugins.library/library/sections/1/all?type=1&sort=addedAt%3Adesc&originallyAvailableAt%3C%3C=1969-12-31&and=1&country=307&and=1&genre=21’ to ‘library://x/directory/%2Flibrary%2Fsections%2F1%2Fall%3Ftype%3D1%26sort%3DaddedAt%253Adesc%26originallyAvailableAt%253C%253C%3D1969-12-31%26and%3D1%26country%3D307%26and%3D1%26genre%3D21’
Mar 15, 2026 13:51:05.564 [202014076096] DEBUG - Setting container serialization range to [0, 0] (total=-1)
Mar 15, 2026 13:51:05.605 [202014076096] DEBUG - PlayQueue: Converted ‘server://eDcJHrrHSgvFpsYxqb6g97uaQTd2kE31rPUeDZTeDsjVq/com.plexapp.plugins.library/library/sections/1/all?type=1&sort=originallyAvailableAt%3Adesc&country=307&and=1&resolution=480’ to ‘library://x/directory/%2Flibrary%2Fsections%2F1%2Fall%3Ftype%3D1%26sort%3DoriginallyAvailableAt%253Adesc%26country%3D307%26and%3D1%26resolution%3D480’
Mar 15, 2026 13:51:05.606 [202014076096] DEBUG - Setting container serialization range to [0, 0] (total=-1)
Mar 15, 2026 13:51:05.613 [202014076096] ERROR - SQLITE3:0x1, 11, database corruption at line 84326 of [a29f994989]
Mar 15, 2026 13:51:05.613 [202014076096] ERROR - SQLITE3:0x1, 11, statement aborts at 36: [select count(*) from (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_items.id where metadata_items.library_section_id in (1) and (metadata_items.id in (select taggings.metadata_item_id from taggings join tags on tags.id=taggings.tag_id where tags.id=307) and ((media_items.width>=848 or media_items.height>=464) and media_items.width<1008 and media_items.height<560) and metadata_items.metadata_type=1) )] database disk image is malformed
Mar 15, 2026 13:51:05.614 [202014076096] WARN - Caught exception while scanning Movies: sqlite3_statement_backend::loadOne: database disk image is malformed
Mar 15, 2026 13:51:05.614 [202014076096] DEBUG - Activity: updated activity 751fa660-16ac-4ef1-8c5c-5f73c1a1b070 - completed 100.0% - Scanning Movies

In order to attempt to resolve this I would say you are going to have to grab a copy of the database and copy it across to your computer.

(I am copying bits of code from here: https://support.plex.tv/articles/repair-a-corrupted-database/)

I would approach this by creating a folder on the C: Drive called PlexRepair (so the path is C:\PlexRepair) and copy the corrupted com.plexapp.plugins.library.db from the Shield into this folder.

Make a backup/copy of it before you attempt any of this, just in case you need to put it back.

Download Plex server and install it on to your computer, let it finish the installation. If the installer asks to launch the server or open a browser to sign in, just close it

Open CMD as Administrator.

Go to your repair folder: cd C:\PlexRepair

Launch the tool and “enter” the database:
“C:\Program Files\Plex\Plex Media Server\Plex SQLite.exe” com.plexapp.plugins.library.db

You should now see a prompt that looks like sqlite>. You are now “inside” the database.

Try the “Easy” Fixes (In this order)
Type these commands into the sqlite> prompt:

Check the damage:
PRAGMA integrity_check;
(If it says “ok”, the corruption might be minor. If it lists errors, proceed.)

Attempt a structural rebuild:
VACUUM;

Rebuild the search indexes:
REINDEX;

Check again:
PRAGMA integrity_check;

If it now says “ok”, stop! You’re done. Type .quit, and move the file back to the Shield. If it did not return “ok,” stay inside the sqlite> prompt and run these:

Set the output file:
.output recovery.sql

Extract everything salvageable:
.recover

Exit the tool:
.quit

Reassemble the Database
Now you are back in the normal Windows CMD prompt (C:\PlexRepair>).

Move the broken file out of the way:
ren com.plexapp.plugins.library.db com.plexapp.plugins.library.db.old

Create a brand new database from the recovery file:
“C:\Program Files\Plex\Plex Media Server\Plex SQLite.exe” com.plexapp.plugins.library.db < recovery.sql

As said make sure you have a backup of the original file, that way you can place it back if that does not go to plan.

I have not needed to do the above before, I am pretty much pasting together bits from that KB article.

The other option could be to delete the movie library and start a fresh ?

EDIT: Step One: Enable Sync Watch State & Ratings for your account. Have anyone you share with enable it on theirs as well. If the db cannot be repaired and you have to start over, you’ll still be able to restore watched state & ratings.


It might be easier to use DBRepair for Plex Media Server.

Note that DBRepair runs from the command line. If on Windows, do not double click the bat file. Use a command prompt, ex: c:\DBRepair.bat. You’ll see the output in the command window.

  1. On a PC, install Plex Media Server. Claim the server. Do not make any libraries (no need).
  2. In Settings → Library, disable Scan My Library Automatically and Empty Trash Automatically
  3. Stop Plex Media Server
  4. Navigate to the Plex Data Folder on the PC. Then into the /Plug-in Support/Databases subdirectory.
  5. Delete everything in the directory.
  6. Copy the database files from the Nvidia Shield to the Databases Directory. Copy both com.plexapp.plugins.library.db and com.plexapp.plugins.library.blobs.db.
  7. Run DBRepair from the command line (c:\ prompt if Windows). It will check and attempt to repair the database files.
  8. If successful, copy the repaired database files back to the Nvidia Shield.

This is what I get after running DBRepair:

NOTE: This script is being replaced with the PowerShell script DBRepair-Windows.ps1,
which aims to better emulate DBRepair.sh (more options, interactive mode, etc).
Consider moving over to the new script.

22:43:31.14 – ====== Session begins. (Sun 03/15/2026) ======
22:43:31.57 – Performing DB cleanup tasks
22:43:31.67 – Exporting Main DB
22:43:52.30 – Exporting Blobs DB
22:44:02.88 – Exporting Complete.
22:44:02.88 – Creating Main DB
Runtime error near line 27352: UNIQUE constraint failed: media_parts.id (19)
Runtime error near line 27353: UNIQUE constraint failed: media_parts.id (19)
Runtime error near line 640718: UNIQUE constraint failed: media_items.id (19)
Runtime error near line 640719: UNIQUE constraint failed: media_items.id (19)
Runtime error near line 640720: UNIQUE constraint failed: media_items.id (19)
Runtime error near line 640721: UNIQUE constraint failed: media_items.id (19)
Runtime error near line 640722: UNIQUE constraint failed: media_items.id (19)
Runtime error near line 640723: UNIQUE constraint failed: media_items.id (19)
Runtime error near line 640724: UNIQUE constraint failed: media_items.id (19)
Runtime error near line 640725: UNIQUE constraint failed: media_items.id (19)
Runtime error near line 640726: UNIQUE constraint failed: media_items.id (19)
22:44:10.05 – ERROR: Cannot create Main DB. Aborting.

C:\Users\Erik\Downloads\DBRepair-master\Windows>

You’ll need to run the PowerShell version. It (and the Linux version) has an option to ignore constraint problems.

Running PowerShell scripts is blocked by default on Windows. You’ll have to jump through some extra hoops to enable the capability. See the ReadMe file for the Windows version: https://github.com/ChuckPa/DBRepair/blob/master/Windows/README-Windows.md.

The PowerShell version has a menu similar to the Linux version. When you run it, choose STOP, IGNORE, AUTO, EXIT. You’ll see output that says if it worked or not.

If it cannot fix the db, then it is too damaged. You’ll basically need to delete it and start over re-creating your libraries, etc.

I tried it, and I guess it’s too damaged. Plex won’t even let me delete that Movies Library. I’d hate to have to start fresh and lose my other libraries which are unaffected. Plus I’d lose my play history and Date Added information. Is there some way to save that kind of stuff, and add it to a fresh install?

Two options for play history. I do not know of a way to save date added info.

Sync Watch State & Ratings. Enable it for your account. Have anyone you share with enable it on theirs as well.

It syncs when PMS starts and every 30 minutes afterwards. ViewSyncState entries are logged in Plex Media Server.log (and rollovers .1.log to .5.log) when it runs.

There is also Move Viewstate/Ratings from One Install to Another. If you use this option, use Plex SQLite, the customized version that is part of Plex Media Server. For its location, see Plex SQLite.


Sync Watch State is easy, since it is just an account setting (link).

I used “Move Viewstate” when migrating to a new server a few years ago. It worked as described in the support article. That written, my database was not damaged, so unsure if it will work for your systems.

Sync Watch State & Ratings. Is that set up with users you have on your account, or is that when you grant Library access to other Plex account users?

It is an account, not server, setting.

Each person must enable it on their own account.

Other than enabling it on your own account, you do not need to do anything.

Looks like I’ve gotta start from scratch with a new database.. Bummer. But I appreciated all your help.

Thank you.