503 Maintenance "Plex Media Server is currently running database migrations"

Help restarting Plex server

Plex had playback issues on a users Iphone, so stopped the docker running plex server on unraid and then restarted the docker. Since then had the error 503 Maintenance “Plex Media Server is currently running database migrations”

Have waited 24 hours as per other suggestions but still nothing.

Logs from docker (on constant repeat)

Error: Unable to set up server: std::exception (N2DB9ExceptionE)
Stopping Plex Media Server.
Starting Plex Media Server.
Error: Unable to set up server: std::exception (N2DB9ExceptionE)
Stopping Plex Media Server.

Have tried spaceinvander one on how to fix a corrupt dasebase. Docker log now reads

Starting Plex Media Server.
Error: Unable to set up server: sqlite3_statement_backend::prepare: no such table: schema_migrations for SQL: select version from schema_migrations order by version (N4soci10soci_errorE)
Stopping Plex Media Server.
kill: usage: kill [-s sigspec | -n signum | -sigspec] pid | jobspec … or kill -l [sigspec]

  1. Stop Plex
  2. Get into the Databases directory
  3. DELETE the WAL and SHM files
  4. COPY the previous backup DB for com.plexapp.plugis.library.db to use as the new main (overwrite existing com.plexapp.plugins.library.db)
  5. Confirm UID:GID and perms are correct
  6. Confirm no other Plex processes running
  7. Start the container
  8. run top (not htop) and monitor the Plex Media Server process.
  9. It should be running at/near 100% while upgrading the schema & tables
    (which can take a lot of time if you have a lot of media)
  10. When idle / quiescent, open the web browser and check status.
  11. If not functional ..
    — STOP PMS
    — Create tar.gz of Logs directory
    — Attach here

I no longer have that first error, but instead a different one. How do you delete and overwrite a plex back up?

updating the share access I got in via mapped network drive. Deleted the original datebase file and renamed a backup to the original files name. Docker now starts. Had to remap the librarys and rescan everything. But happy to back running. Will have Metadata to correct up again going this pathway

Did you use Windows to perform the task?

You should have done it from the container’s Console.

Here you can see a ‘cd’ to the Databases directory.
Next is the rm followed by cp command to copy the backup (

# cd /config/Li*/App*/Ple*/Plu*/Datab*
# pwd
/config/Library/Application Support/Plex Media Server/Plug-in Support/Databases
# ls -la
total 842596
drwxr-xr-x 1 plex users      4096 Sep  6 02:04 .
drwxr-xr-x 1 plex users        96 Jun  5 20:24 ..
-rw-r--r-- 1 root root       4663 Sep  4 21:16 DBRepair.log
-rwxr-xr-x 1 root root      71684 Sep  4 21:09 DBRepair.sh
-rw-r--r-- 1 plex users   1089536 Sep  4 21:03 com.plexapp.plugins.library.blobs.db
-rw-r--r-- 1 plex users   1089536 Aug 28 02:03 com.plexapp.plugins.library.blobs.db-2025-08-28
-rw-r--r-- 1 plex users   1089536 Aug 31 02:03 com.plexapp.plugins.library.blobs.db-2025-08-31
-rw-r--r-- 1 plex users   1089536 Sep  3 02:03 com.plexapp.plugins.library.blobs.db-2025-09-03
-rw-r--r-- 1 plex users   1089536 Sep  6 02:04 com.plexapp.plugins.library.blobs.db-2025-09-06
-rw-r--r-- 1 plex users     32768 Sep  4 21:04 com.plexapp.plugins.library.blobs.db-shm
-rw-r--r-- 1 plex users         0 Sep  4 21:04 com.plexapp.plugins.library.blobs.db-wal
-rw-r--r-- 1 plex users 169472000 Sep  7 02:05 com.plexapp.plugins.library.db
-rw-r--r-- 1 plex users 171425792 Aug 28 02:03 com.plexapp.plugins.library.db-2025-08-28
-rw-r--r-- 1 plex users 171114496 Aug 31 02:03 com.plexapp.plugins.library.db-2025-08-31
-rw-r--r-- 1 plex users 171556864 Sep  3 02:03 com.plexapp.plugins.library.db-2025-09-03
-rw-r--r-- 1 plex users 169472000 Sep  6 02:04 com.plexapp.plugins.library.db-2025-09-06
-rw-r--r-- 1 plex users     32768 Sep  7 02:06 com.plexapp.plugins.library.db-shm
-rw-r--r-- 1 plex users   4165352 Sep  7 02:06 com.plexapp.plugins.library.db-wal
drwxrwxrwx 1 root root          6 Sep  4 21:16 dbtmp
-rwxr-xr-x 1 root root        502 Jun 12 10:41 do-deflate
# whoami
root
# 

Next are the commands to copy the backup and use it as the new main DB
(Use whichever backup date is most recent)

# rm com.plexapp.plugins.library.db
# rm -f com.plexapp.plugins.library.db-shm
# rm -f com.plexapp.plugins.library.db-wal
# cp com.plexapp.plugins.library.db-2025-08-28 com.plexapp.plugins.library.db

Exit from console
Start Plex

Hi ChuckPa

First of all thanks for all your help so far..

Yes I used windows to perform the task.

I now have a new problem where I can not share the new libraires I created to respectively replace the ones that no longer existed. I see the error “you don’t have any connected servers”

I have seen elsewhere perhaps logging out and logging back in.

Is this safe and easy to do on the ‘unraid docker gui’ without interfering with the server itself? Or is there another solution?

.

dealing with PMS in Docker on Unraid – you use the Console for best results.

Windows will frequently “muck it up”

By using a backup as I showed above, none of what you’re now experiencing will happen (which is why we do it this way)

Above, you show what seems to be an unclaimed server situation.

Preferences.xml contains the account/login information.

I’m starting to suspect you got a zero-length Preferences.xml
as a result of the last actions/shutdown (not sure what caused it) which PMS then resets and makes an unclaimed server. (why you needed to make new sections again)
-or-
The entire container storage area (/config) was erased.

One of the two caused what you’re seeing.


I always use the Unraid Docker GUI - Plex → “Console” to open a command line window.

In there you can do things like run DBRepair which would allow you to select older DBs and let it do the work for you.

What would you reccomend and the fix going forward?

Use an earlier back up again via the above method through the console? Or is there an alternative fix?

I would put DBRepair.sh in the unraid container and run it from there.

With DBRepair, you can select from the list of available backups.
It will then check them to confirm both Main and Blobs are viable.

(Instructions and examples in the README.md)

When completed, Start PMS again and let it perform its Maintenance upgrade (Database schema migrations with this new PMS version).

Once this is complete, you can exit the tool.

Since I don’t know whether the container is claimed to your account at this point, it would do no harm (re) claiming it.

Here is what my tool tools like in the Unraid “Console” window

# uname -a
Linux Gerbil 6.6.78-Unraid #2 SMP PREEMPT_DYNAMIC Thu Feb 20 13:33:15 PST 2025 x86_64 x86_64 x86_64 GNU/Linux
# ./DBR.sh
 
 
 
      Database Repair Utility for Plex Media Server  (Docker)
                       Version v1.11.08
 

Select

  1 - 'stop'      - Stop PMS.
  2 - 'automatic' - Check, Repair/Optimize, and Reindex Database in one step.
  3 - 'check'     - Perform integrity check of database.
  4 - 'vacuum'    - Remove empty space from database without optimizing.
  5 - 'repair'    - Repair/Optimize databases.
  6 - 'reindex'   - Rebuild database indexes.
  7 - 'start'     - Start PMS

  8 - 'import'    - Import watch history from another database independent of Plex. (risky).
  9 - 'replace'   - Replace current databases with newest usable backup copy (interactive).
 10 - 'show'      - Show logfile.
 11 - 'status'    - Report status of PMS (run-state and databases).
 12 - 'undo'      - Undo last successful command.

 21 - 'prune'     - Remove old image files (jpeg,jpg,png) from PhotoTranscoder cache & all temp files left by PMS.
 42 - 'ignore'    - Ignore duplicate/constraint errors.

 88 - 'update'    - Check for updates.
 98 - 'quit'      - Quit immediately.  Keep all temporary files.
 99 - 'exit'      - Exit with cleanup options.

Enter command # -or- command name (4 char min) : 

You will want the REPLACE (9) option.

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