# Plex server crash on Mac OS (SQLite migration)

**URL:** <https://forums.plex.tv/t/plex-server-crash-on-mac-os-sqlite-migration/797730>\
**Category:** Plex Media Server\
**Tags:** server-mac\
**Created:** [June 19, 2022, 7:57pm UTC](https://forums.plex.tv/t/plex-server-crash-on-mac-os-sqlite-migration/797730 "2022-06-19T19:57:53Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![m1c0s](https://avatars.discourse-cdn.com/v4/letter/m/ecae2f/32.png) [@m1c0s](https://forums.plex.tv/u/m1c0s)\
**Post date:** [June 19, 2022, 7:57pm UTC](https://forums.plex.tv/t/plex-server-crash-on-mac-os-sqlite-migration/797730/1 "2022-06-19T19:57:53Z")

</div>

Server Version#: 1.23.4.4805 and higher

Platform: Mac OS 12.1 (Monterey)  
Application: Plex server app  
1.23.3.4707 - works  
1.23.4.4805 - not works, crashing with logs below

Looks like some improvements in db migration performance by up to 70% cause a crash (#13541)

Crash logs:

Jun 19, 2022 21:37:08.387 [0x70000dd8f000] INFO - Plex Media Server v1.23.4.4805-186bae04e - Apple Mac x86\_64 - build: darwin-x86\_64 macos - GMT 03:00

Jun 19, 2022 21:37:08.387 [0x70000dd8f000] INFO - MacOSX version: 12.1, language: en-US

Jun 19, 2022 21:37:08.387 [0x70000dd8f000] INFO - Processor Intel(R) Core™ i3-10105F CPU @ 3.70GHz

Jun 19, 2022 21:37:08.387 [0x70000dd8f000] INFO - Compiler is - Clang 11.0.1 ([https://plex.tv](https://plex.tv) e0c29d5827bc4eaaa2ceb882cbeed224b0960173)

Jun 19, 2022 21:37:08.387 [0x70000dd8f000] INFO - /Applications/Plex Media Server.app/Contents/MacOS/Plex Media Server

Jun 19, 2022 21:37:08.483 [0x70000df18000] DEBUG - BPQ: [Idle] → [Starting]

Jun 19, 2022 21:37:08.483 [0x70000df18000] DEBUG - FeatureManager: Using cached data for features list

Jun 19, 2022 21:37:08.485 [0x70000df18000] DEBUG - Opening 20 database sessions to library (com.plexapp.plugins.library), SQLite 3.35.5, threadsafe=1

Jun 19, 2022 21:37:08.508 [0x70000df18000] DEBUG - Running migrations. (EPG 0)

Jun 19, 2022 21:37:08.508 [0x70000df18000] DEBUG - Running forward migration 20201103130000.

Jun 19, 2022 21:37:08.508 [0x70000df18000] DEBUG - Captured session 0.

Jun 19, 2022 21:37:08.508 [0x70000df18000] DEBUG - Captured session 1.

Jun 19, 2022 21:37:08.508 [0x70000df18000] DEBUG - Captured session 2.

Jun 19, 2022 21:37:08.508 [0x70000df18000] DEBUG - Captured session 3.

Jun 19, 2022 21:37:08.508 [0x70000df18000] DEBUG - Captured session 4.

Jun 19, 2022 21:37:08.509 [0x70000df18000] DEBUG - Captured session 5.

Jun 19, 2022 21:37:08.509 [0x70000df18000] DEBUG - Captured session 6.

Jun 19, 2022 21:37:08.509 [0x70000df18000] DEBUG - Captured session 7.

Jun 19, 2022 21:37:08.509 [0x70000df18000] DEBUG - Captured session 8.

Jun 19, 2022 21:37:08.509 [0x70000df18000] DEBUG - Captured session 9.

Jun 19, 2022 21:37:08.509 [0x70000df18000] DEBUG - Captured session 10.

Jun 19, 2022 21:37:08.509 [0x70000df18000] DEBUG - Captured session 11.

Jun 19, 2022 21:37:08.509 [0x70000df18000] DEBUG - Captured session 12.

Jun 19, 2022 21:37:08.509 [0x70000df18000] DEBUG - Captured session 13.

Jun 19, 2022 21:37:08.509 [0x70000df18000] DEBUG - Captured session 14.

Jun 19, 2022 21:37:08.509 [0x70000df18000] DEBUG - Captured session 15.

Jun 19, 2022 21:37:08.509 [0x70000df18000] DEBUG - Captured session 16.

Jun 19, 2022 21:37:08.509 [0x70000df18000] DEBUG - Captured session 17.

Jun 19, 2022 21:37:08.509 [0x70000df18000] DEBUG - Captured session 18.

Jun 19, 2022 21:37:08.509 [0x70000df18000] DEBUG - Captured session 19.

Jun 19, 2022 21:37:08.961 [0x70000df18000] ERROR - SQLITE3:0x10f317458, 11, database corruption at line 81887 of [1b256d97b5]

Jun 19, 2022 21:37:08.961 [0x70000df18000] ERROR - SQLITE3:0x10f317458, 11, statement aborts at 11: [SELECT media\_item\_id, media\_streams.extra\_data FROM media\_streams join media\_items on media\_items.id=media\_streams.media\_item\_id where media\_streams.extra\_data like ‘%colorTrc%’ and me

Jun 19, 2022 21:37:08.961 [0x70000df18000] ERROR - Exception inside transaction (inside=1) (/data/jenkins/server/1788679104/Library/DatabaseMigrations.cpp:235): sqlite3\_statement\_backend::loadRS: database disk image is malformed

Jun 19, 2022 21:37:08.962 [0x70000df18000] ERROR - Exception thrown during migrations, aborting: sqlite3\_statement\_backend::loadRS: database disk image is malformed

Jun 19, 2022 21:37:09.022 [0x70000df18000] DEBUG - ChangestampAllocator: initialized to 2018079650626901721

Jun 19, 2022 21:37:09.022 [0x70000df18000] ERROR - SQLITE3:0x10f317458, 1, no such table: activities in “update activities set finished\_at=started\_at where finished\_at is null”

Jun 19, 2022 21:37:09.022 [0x70000df18000] ERROR - Database corruption: sqlite3\_statement\_backend::prepare: no such table: activities for SQL: update activities set finished\_at=started\_at where finished\_at is null

---

<div class="post-metadata">

**Author:** ![FordGuy61](https://avatars.discourse-cdn.com/v4/letter/f/22d042/32.png) [@FordGuy61](https://forums.plex.tv/u/FordGuy61)\
**Post date:** [June 19, 2022, 8:47pm UTC](https://forums.plex.tv/t/plex-server-crash-on-mac-os-sqlite-migration/797730/2 "2022-06-19T20:47:39Z")

</div>

> [@m1c0s](#):
>
> Jun 19, 2022 21:37:08.961 [0x70000df18000] ERROR - SQLITE3:0x10f317458, 11, database corruption at line 81887 of [1b256d97b5]

The Plex Media Server database is corrupt.

You’ve three options:

1. Repair
2. Restore from backup.
3. Delete & start over.

The repair process is covered in [Repair a Corrupted Database](https://support.plex.tv/articles/repair-a-corrupted-database/).

To restore from a backup, see [Restore a Database Backed Up via ‘Scheduled Tasks’](https://support.plex.tv/articles/202485658-restore-a-database-backed-up-via-scheduled-tasks/).

It is not possible to tell when the corruption occurred. The backup copies of the database may also be corrupt. After loading a backup and restarting Plex, check the Plex Media Server.log file for SQLITE3 errors (any log entry with `ERROR - SQLITE3`).

If repairing or restoring does not work, the last option is to delete the database and start over. This will not touch your media files. You will have to re-create your libraries, re-share them with any other users, etc.

From the [Repair a Corrupted Database](https://support.plex.tv/articles/repair-a-corrupted-database/) support article:  
**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.)

---

<div class="post-metadata">

**Author:** ![FordGuy61](https://avatars.discourse-cdn.com/v4/letter/f/22d042/32.png) [@FordGuy61](https://forums.plex.tv/u/FordGuy61)\
**Post date:** [June 19, 2022, 11:05pm UTC](https://forums.plex.tv/t/plex-server-crash-on-mac-os-sqlite-migration/797730/3 "2022-06-19T23:05:52Z")

</div>

Typo fixed.

~~FYI, there is a typo on the Repair a Corrupted Database document.~~

~~`PRAGMA integrity_check` should be `PRAGMA integrity_check;`  
 `VACUUM` should be `VACUUM;`  
 `REINDEX` should be `REINDEX;`~~

~~The commands won’t execute without the semicolon at the end.~~

~~The typo has been mentioned to Plex. Updating the thread in case you run the commands before the support document is updated.  
 ~~

---

<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:** [September 17, 2022, 11:06pm UTC](https://forums.plex.tv/t/plex-server-crash-on-mac-os-sqlite-migration/797730/4 "2022-09-17T23:06:18Z")

</div>

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