# Plex DB Update Statement Issue

**URL:** <https://forums.plex.tv/t/plex-db-update-statement-issue/919647>\
**Category:** Plex Media Server\
**Tags:** server-unraid, metadata\
**Created:** [May 22, 2025, 4:47pm UTC](https://forums.plex.tv/t/plex-db-update-statement-issue/919647 "2025-05-22T16:47:24Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![\_tempest3](https://avatars.discourse-cdn.com/v4/letter/_/f1d935/32.png) [@\_tempest3](https://forums.plex.tv/u/_tempest3)\
**Post date:** [May 22, 2025, 4:47pm UTC](https://forums.plex.tv/t/plex-db-update-statement-issue/919647/1 "2025-05-22T16:47:24Z")

</div>

Server Version#:v1.41.7.9799-5bce000f7 - Docker Docker Container x86\_64 - build: linux-x86\_64 debian  
Player Version#: N/A

Last night I was streaming content from PMS without any issues. The server is on a UPS and did not encounter any power issues. This morning I discovered that I could not access the server via any apps/devices, and that the web client reported “503 Maintenance Plex Media Server is currently running database migrations.” I opened the docker logs and saw constant logs that the server was unable to start. After some investigation, I found the [server logs](https://support.plex.tv/articles/200250417-plex-media-server-log-files/) with the following errors:

```txt
May 22, 2025 09:32:53.997 [22960106175120] ERROR - SQLITE3:0x80000001, 11, database corruption at line 91363 of [a29f994989]
May 22, 2025 09:32:53.997 [22960106175120] ERROR - SQLITE3:0x80000001, 11, statement aborts at 5: [UPDATE activities SET `finished_at`=`started_at` WHERE `finished_at` IS NULL] database disk image is malformed
May 22, 2025 09:32:53.997 [22960106175120] ERROR - Error: Unable to set up server: std::exception (N2DB9ExceptionE)

```

I found the PlexDBRepair tool and attempted to use it, but every time it attempts to use SQLite3 (Plex Sqlite) it just reports “Killed” and moves on (it is thus unable to restore the most recent backup, or to effectuate any repairs).

```bash
Enter command # -or- command name (4 char min) : 2
 
Automatic Check,Repair,Index started.

Checking the PMS databases
Check complete. PMS main database is damaged.
Killed
Check complete. PMS blobs database is damaged.

Exporting current databases using timestamp: 2025-05-22_09.26.22
Exporting Main DB
Killed
Error 137 from Plex SQLite while exporting com.plexapp.plugins.library.db
Could not successfully export the main database to repair it. Please try restoring a backup.
Repair failed. Automatic mode cannot continue. Please repair with individual commands

```

```bash
Enter command # -or- command name (4 char min) : 9
 
Checking the PMS databases
Check complete. PMS main database is damaged.
Killed
Check complete. PMS blobs database is damaged.
Checking for a usable backup.
Database backups available are: 2025-05-21 2025-05-18 2025-05-15 2025-05-12
 
  1) - 2025-05-21
  2) - 2025-05-18
  3) - 2025-05-15
  4) - 2025-05-12
 
Select backup date by number or date name (blank = return to menu) 1
Checking backup candidate 2025-05-21
Killed
Killed
Backup from 2025-05-21 is not usable. Try again

```

What are my options for next-steps?

---

<div class="post-metadata">

**Author:** ![\_tempest3](https://avatars.discourse-cdn.com/v4/letter/_/f1d935/32.png) [@\_tempest3](https://forums.plex.tv/u/_tempest3)\
**Post date:** [May 22, 2025, 9:44pm UTC](https://forums.plex.tv/t/plex-db-update-statement-issue/919647/2 "2025-05-22T21:44:32Z")

</div>

UPDATE:

I was able to restore the most recent backup (from the night this was working) manually. I am still not sure what happened, since I had not updated the docker image or restarted the server in any way. To the best of my knowledge, this went from a fully-functional db to a non-functional db just through processing metadata for recently-added local media. I made a backup/copy of both the “corrupted” db files as well as the backup I was restoring from, so in the event this goes south again I still have the initial “good” backup to reload from and potentially remove any offending media (if that is somehow an issue – I still don’t know what happened).

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/plex/original/3X/2/a/2acb9765406f63293d357b4ec509ec39aa28f2ad.png) [@system](https://forums.plex.tv/u/system)\
**Post date:** [August 20, 2025, 9:44pm UTC](https://forums.plex.tv/t/plex-db-update-statement-issue/919647/3 "2025-08-20T21:44:45Z")

</div>

Closed on August 20, 2025, 9:44pm UTC

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