Plex Service Crashes on Start-Up after Update

Server Version#: 1.26.0.5715
Player Version#:

As with many other users, after an update, the plex service crashes after being (re-)started. DB appears to be corrupted and I’ve attempted to repair it [ LINK ] (see below), but it still crashes after restart. Note that you can access it locally (for about 3 seconds before it stops responding and refreshing the page (x.x.x.x:32400/web/index.html#!) results in Connection Refused.

What would my next attempt be? Am I in a wipe Plex/re-install territory now?

Apr 22, 2022 20:56:44.633 [0x7fe569dedb38] INFO - /usr/lib/plexmediaserver/Plex Media Server
Apr 22, 2022 20:56:44.635 [0x7fe56d44e0c8] INFO - SQLITE3:0x80000001, 283, recovered 927 frames from WAL file /var/lib/plex/Plex Media Server/Plug-in Support/Databases/com.plexapp.plugins.library.db-wal
Apr 22, 2022 20:56:46.964 [0x7fe56d44e0c8] ERROR - SQLITE3:0x80000001, 779, index corruption at line 91877 of [1b256d97b5]
Apr 22, 2022 20:56:46.964 [0x7fe56d44e0c8] ERROR - SQLITE3:0x80000001, 779, statement aborts at 247: [update metadata_items set originally_available_at = iif(typeof(originally_available_at) in ('integer', 'real'), originally_ava>
Apr 22, 2022 20:56:46.997 [0x7fe56d44e0c8] ERROR - Exception inside transaction (inside=1) (/data/jenkins/server/3529576666/Library/DatabaseMigrations.cpp:237): sqlite3_statement_backend::loadOne: database disk image is malformed
Apr 22, 2022 20:56:47.005 [0x7fe56d44e0c8] ERROR - Exception thrown during migrations, aborting: sqlite3_statement_backend::loadOne: database disk image is malformed
Apr 22, 2022 20:56:48.608 [0x7fe56d44e0c8] INFO - SQLITE3:0x80000001, 283, recovered 1552758 frames from WAL file /var/lib/plex/Plex Media Server/Plug-in Support/Databases/com.plexapp.plugins.library.blobs.db-wal
Apr 22, 2022 20:56:48.620 [0x7fe56d44e0c8] INFO - [CERT/OCSP] Successfully retrieved response from cache.

Next step is to try the Repair a Database link mentioned above…

  1. Stop Plex Service
sudo systemctl stop plexmediaserver
  1. Back Up DB
cd "/var/lib/plex/Plex Media Server/Plug-in Support/Databases"
cp com.plexapp.plugins.library.db com.plexapp.plugins.library.db.original
  1. Check for Corruption
 -- "/usr/lib/plexmediaserver/Plex SQLite" com.plexapp.plugins.library.db "PRAGMA integrity_check"

This resulted in a page of Row X missing from index and wrong # of entries in index etc…

  1. Attempt to repair DB
"/usr/lib/plexmediaserver/Plex SQLite" com.plexapp.plugins.library.db ".output recover.out" ".recover"

This takes all of 15 seconds, for a large file full of DB (Re-)Creation Syntax.

Restart Service and check x.x.x.x:32400/web/index.html#!/. It loads, but with no library. I try to refresh the page 30 seconds later and it returns to Connection Refused and the service has crashed.

Apr 22 21:39:12 SERVER01 systemd[1]: Started Plex Media Server.
Apr 22 21:39:16 SERVER01 plexmediaserver[21859]: libc++abi: terminating with uncaught exception of type std::bad_cast: std::bad_cast
Apr 22 21:39:16 SERVER01 plexmediaserver[21859]: ****** PLEX MEDIA SERVER CRASHED, CRASH REPORT WRITTEN: /var/lib/plex/Plex Media Server/Crash Reports/1.26.0.5715-8cf78dab3/PLEX MEDIA SERVER/8eeee57b-347b-46bd-834894a1-96f10461.d>
Apr 22 21:39:16 SERVER01 systemd[1]: plexmediaserver.service: Main process exited, code=dumped, status=6/ABRT

There are no files in the mentioned crash location…

Try the Manually Repair the Database process as well.

No need to completely remove/re-install.

If repair or restore from backup fail, then delete the database.

From the repair document: Note : You can also simply delete the com.plexapp.plugins.library.db database file while the Plex Media Server is not running. Restarting the server will then restore your server to a nearly-fresh install state. (i.e. You will lose your existing libraries and need to recreate them , but you won’t be affecting your content itself.).

1 Like

Thanks. I was getting ready to write the DBs obituary, when I realised the new DB was owned by root. We’re all up and running now (for now).

4: Attempt to manually repair DB

cd "/var/lib/plex/Plex Media Server/Plug-in Support/Databases"
"/usr/lib/plexmediaserver/Plex SQLite" com.plexapp.plugins.library.db ".output dump.sql" ".dump"

sudo rm com.plexapp.plugins.library.db

"/usr/lib/plexmediaserver/Plex SQLite" com.plexapp.plugins.library.db ".read dump.sql"

FAILED - Plex Service won’t even start

Apr 23 09:14:53 SERVER01 systemd[1]: plexmediaserver.service: Start request repeated too quickly.
Apr 23 09:14:53 SERVER01 systemd[1]: plexmediaserver.service: Failed with result 'exit-code'.
Apr 23 09:14:53 SERVER01 systemd[1]: Failed to start Plex Media Server.

Reset DB’s Permissions

sudo chown -Rf plex:plex com.plexapp.plugins.library.db

Hey presto…

 sudo systemctl status plexmediaserver
● plexmediaserver.service - Plex Media Server
     Loaded: loaded (/usr/lib/systemd/system/plexmediaserver.service; enabled; vendor preset: disabled)
     Active: active (running) since Sat 2022-04-23 09:22:21 BST; 1min 42s ago
   Main PID: 188723 (Plex Media Serv)
      Tasks: 89 (limit: 38334)
     Memory: 865.9M
        CPU: 26.018s
     CGroup: /system.slice/plexmediaserver.service
             ├─188723 "/usr/lib/plexmediaserver/Plex Media Server"
             ├─188846 "Plex Plug-in [com.plexapp.system]" /usr/lib/plexmediaserver/Resources/Plug-ins-8cf78dab3/Framework.bundle/Contents/Resources/Versions/2/Python/bootstrap.py --server-version 1.26.0.5715-8cf78dab3 /usr/lib/p>
             ├─188890 "/usr/lib/plexmediaserver/Plex Tuner Service" /usr/lib/plexmediaserver/Resources/Tuner/Private /usr/lib/plexmediaserver/Resources/Tuner/Shared 1.26.0.5715-8cf78dab3 32600
             ├─188933 "Plex Plug-in [com.plexapp.plugins.trakttv]" /usr/lib/plexmediaserver/Resources/Plug-ins-8cf78dab3/Framework.bundle/Contents/Resources/Versions/2/Python/bootstrap.py --server-version 1.26.0.5715-8cf78dab3 ">
             ├─188935 "Plex Plug-in [com.plexapp.plugins.WebTools]" /usr/lib/plexmediaserver/Resources/Plug-ins-8cf78dab3/Framework.bundle/Contents/Resources/Versions/2/Python/bootstrap.py --server-version 1.26.0.5715-8cf78dab3 >
             └─189005 "Plex Plug-in [com.plexapp.agents.imdb]" /usr/lib/plexmediaserver/Resources/Plug-ins-8cf78dab3/Framework.bundle/Contents/Resources/Versions/2/Python/bootstrap.py --server-version 1.26.0.5715-8cf78dab3 /usr/>

Apr 23 09:22:21 msc001y systemd[1]: Started Plex Media Server.

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