I’m trying every combination of versions and databases I can think of, but even 1.29.0 with my October 1st database gives me the below errors when I start it up, like something is totally busted with all attempts at DB migrations:
Nov 15, 2022 11:21:56.027 [0x7fca2185eb00] DEBUG - HttpServer: Set up a thread pool with 2 threads.
Nov 15, 2022 11:21:56.052 [0x7fca25f671c0] INFO - Running migrations. (EPG 0)
Nov 15, 2022 11:21:56.052 [0x7fca25f671c0] DEBUG - Captured session 0.
Nov 15, 2022 11:21:56.052 [0x7fca25f671c0] DEBUG - Captured session 1.
Nov 15, 2022 11:21:56.052 [0x7fca25f671c0] DEBUG - Captured session 2.
Nov 15, 2022 11:21:56.052 [0x7fca25f671c0] DEBUG - Captured session 3.
Nov 15, 2022 11:21:56.052 [0x7fca25f671c0] DEBUG - Captured session 4.
Nov 15, 2022 11:21:56.052 [0x7fca25f671c0] DEBUG - Captured session 5.
Nov 15, 2022 11:21:56.052 [0x7fca25f671c0] DEBUG - Captured session 6.
Nov 15, 2022 11:21:56.052 [0x7fca25f671c0] DEBUG - Captured session 7.
Nov 15, 2022 11:21:56.052 [0x7fca25f671c0] DEBUG - Captured session 8.
Nov 15, 2022 11:21:56.052 [0x7fca25f671c0] DEBUG - Captured session 9.
Nov 15, 2022 11:21:56.052 [0x7fca25f671c0] DEBUG - Captured session 10.
Nov 15, 2022 11:21:56.052 [0x7fca25f671c0] DEBUG - Captured session 11.
Nov 15, 2022 11:21:56.052 [0x7fca25f671c0] DEBUG - Captured session 12.
Nov 15, 2022 11:21:56.052 [0x7fca25f671c0] DEBUG - Captured session 13.
Nov 15, 2022 11:21:56.052 [0x7fca25f671c0] DEBUG - Captured session 14.
Nov 15, 2022 11:21:56.052 [0x7fca25f671c0] DEBUG - Captured session 15.
Nov 15, 2022 11:21:56.052 [0x7fca25f671c0] DEBUG - Captured session 16.
Nov 15, 2022 11:21:56.052 [0x7fca25f671c0] DEBUG - Captured session 17.
Nov 15, 2022 11:21:56.052 [0x7fca25f671c0] DEBUG - Captured session 18.
Nov 15, 2022 11:21:56.052 [0x7fca25f671c0] DEBUG - Captured session 19.
Nov 15, 2022 11:21:56.054 [0x7fca25f671c0] INFO - Running forward migration 20101001034731.
Nov 15, 2022 11:21:56.054 [0x7fca25f671c0] DEBUG - Captured session 0.
Nov 15, 2022 11:21:56.054 [0x7fca25f671c0] DEBUG - Captured session 1.
Nov 15, 2022 11:21:56.054 [0x7fca25f671c0] DEBUG - Captured session 2.
Nov 15, 2022 11:21:56.054 [0x7fca25f671c0] DEBUG - Captured session 3.
Nov 15, 2022 11:21:56.054 [0x7fca25f671c0] DEBUG - Captured session 4.
Nov 15, 2022 11:21:56.054 [0x7fca25f671c0] DEBUG - Captured session 5.
Nov 15, 2022 11:21:56.054 [0x7fca25f671c0] DEBUG - Captured session 6.
Nov 15, 2022 11:21:56.054 [0x7fca25f671c0] DEBUG - Captured session 7.
Nov 15, 2022 11:21:56.054 [0x7fca25f671c0] DEBUG - Captured session 8.
Nov 15, 2022 11:21:56.054 [0x7fca25f671c0] DEBUG - Captured session 9.
Nov 15, 2022 11:21:56.054 [0x7fca25f671c0] DEBUG - Captured session 10.
Nov 15, 2022 11:21:56.054 [0x7fca25f671c0] DEBUG - Captured session 11.
Nov 15, 2022 11:21:56.054 [0x7fca25f671c0] DEBUG - Captured session 12.
Nov 15, 2022 11:21:56.054 [0x7fca25f671c0] DEBUG - Captured session 13.
Nov 15, 2022 11:21:56.054 [0x7fca25f671c0] DEBUG - Captured session 14.
Nov 15, 2022 11:21:56.054 [0x7fca25f671c0] DEBUG - Captured session 15.
Nov 15, 2022 11:21:56.054 [0x7fca25f671c0] DEBUG - Captured session 16.
Nov 15, 2022 11:21:56.054 [0x7fca25f671c0] DEBUG - Captured session 17.
Nov 15, 2022 11:21:56.054 [0x7fca25f671c0] DEBUG - Captured session 18.
Nov 15, 2022 11:21:56.054 [0x7fca25f671c0] DEBUG - Captured session 19.
Nov 15, 2022 11:21:56.054 [0x7fca25f671c0] ERROR - SQLITE3:0x80000001, 1, table 'library_timeline_entries' already exists in "CREATE TABLE 'library_timeline_entries' ('id' INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, 'library_section_id' integer, 'metadata_item_id' integer, 'state' i
Nov 15, 2022 11:21:56.054 [0x7fca25f671c0] ERROR - Exception inside transaction (inside=1) (/data/jenkins/server/3534295259/Library/DatabaseMigrations.cpp:295): sqlite3_statement_backend::prepare: table 'library_timeline_entries' already exists for SQL: CREATE TABLE 'library_timeline_entries' ('id' INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, 'library_section_id' integer, 'metadata_item_id' integer, 'state' integer, 'updated_at' datetime)
Nov 15, 2022 11:21:56.055 [0x7fca25f671c0] ERROR - Exception thrown during migrations, aborting: sqlite3_statement_backend::prepare: table 'library_timeline_entries' already exists for SQL: CREATE TABLE 'library_timeline_entries' ('id' INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, 'library_section_id' integer, 'metadata_item_id' integer, 'state' integer, 'updated_at' datetime)
Interestingly, when I run Optimize on this DB from 10/01, I don’t get any Errors in the log, but a bunch of (scary looking) INFOs saying the database schema has changed:
Nov 15, 2022 11:30:19.473 [0x7fca1fd09b00] DEBUG - [Req#1f3/Database optimization/com.plexapp.plugins.library.db] Rebuilding full text search tables.
Nov 15, 2022 11:30:19.473 [0x7fca1fd09b00] DEBUG - [Req#1f3/Database optimization/com.plexapp.plugins.library.db] Activity: updated activity 97ea0367-4632-459f-ae92-538364c89237 - completed 40.0% - Optimizing database
Nov 15, 2022 11:30:27.709 [0x7fca1fd09b00] WARN - [Req#1f3/Database optimization/com.plexapp.plugins.library.db] Held transaction for too long (/data/jenkins/server/3534295259/Library/FullTextSearch.cpp:58): 8.240000 seconds
Nov 15, 2022 11:30:32.039 [0x7fca1fd09b00] WARN - [Req#1f3/Database optimization/com.plexapp.plugins.library.db] Held transaction for too long (/data/jenkins/server/3534295259/Library/FullTextSearch.cpp:71): 4.080000 seconds
Nov 15, 2022 11:30:37.477 [0x7fca21b67b00] DEBUG - Using X-Forwarded-For: 64.111.71.131 as remote address
Nov 15, 2022 11:30:37.477 [0x7fca21b67b00] DEBUG - Auth: Refreshing tokens inside the token-based authentication filter.
Nov 15, 2022 11:30:37.477 [0x7fca21b67b00] DEBUG - [HCl#83] HTTP requesting GET https://plex.tv/api/v2/server/access_tokens?auth_token=xxxxxxxxxxxxxxxxxxxx&unknownToken=xxxxxxxxxxxxxxxxxxxx
Nov 15, 2022 11:30:37.547 [0x7fca20115b00] DEBUG - [HttpClient/HCl#83] HTTP/2.0 (0.1s) 200 response from GET https://plex.tv/api/v2/server/access_tokens?auth_token=xxxxxxxxxxxxxxxxxxxx&unknownToken=xxxxxxxxxxxxxxxxxxxx (reused)
Nov 15, 2022 11:30:37.547 [0x7fca21b67b00] DEBUG - MyPlex: updating with 17 access tokens
Nov 15, 2022 11:30:42.266 [0x7fca1fd09b00] WARN - [Req#1f3/Database optimization/com.plexapp.plugins.library.db] Held transaction for too long (/data/jenkins/server/3534295259/Library/FullTextSearch.cpp:81): 10.220000 seconds
Nov 15, 2022 11:30:58.341 [0x7fca1fd09b00] WARN - [Req#1f3/Database optimization/com.plexapp.plugins.library.db] Held transaction for too long (/data/jenkins/server/3534295259/Library/FullTextSearch.cpp:94): 15.960000 seconds
Nov 15, 2022 11:30:58.380 [0x7fca1fd09b00] DEBUG - [Req#1f3/Database optimization/com.plexapp.plugins.library.db] Database optimization: starting.
Nov 15, 2022 11:30:58.380 [0x7fca1fd09b00] DEBUG - [Req#1f3/Database optimization/com.plexapp.plugins.library.db] Activity: updated activity 97ea0367-4632-459f-ae92-538364c89237 - completed 60.0% - Optimizing database
Nov 15, 2022 11:31:13.667 [0x7fca1fd09b00] DEBUG - [Req#1f3/Database optimization/com.plexapp.plugins.library.db] Database optimization: complete.
Nov 15, 2022 11:31:13.669 [0x7fca1fd09b00] INFO - [Req#1f3/Database optimization/com.plexapp.plugins.library.db] SQLITE3:0x80000001, 17, statement aborts at 58: [select * from metadata_items limit 1] database schema has changed
Nov 15, 2022 11:31:13.670 [0x7fca1fd09b00] INFO - [Req#1f3/Database optimization/com.plexapp.plugins.library.db] SQLITE3:0x80000001, 17, statement aborts at 58: [select * from metadata_items limit 1] database schema has changed
Nov 15, 2022 11:31:13.673 [0x7fca1fd09b00] INFO - [Req#1f3/Database optimization/com.plexapp.plugins.library.db] SQLITE3:0x80000001, 17, statement aborts at 58: [select * from metadata_items limit 1] database schema has changed
Nov 15, 2022 11:31:13.675 [0x7fca1fd09b00] INFO - [Req#1f3/Database optimization/com.plexapp.plugins.library.db] SQLITE3:0x80000001, 17, statement aborts at 58: [select * from metadata_items limit 1] database schema has changed
Nov 15, 2022 11:31:13.676 [0x7fca1fd09b00] INFO - [Req#1f3/Database optimization/com.plexapp.plugins.library.db] SQLITE3:0x80000001, 17, statement aborts at 58: [select * from metadata_items limit 1] database schema has changed
Nov 15, 2022 11:31:13.677 [0x7fca1fd09b00] INFO - [Req#1f3/Database optimization/com.plexapp.plugins.library.db] SQLITE3:0x80000001, 17, statement aborts at 58: [select * from metadata_items limit 1] database schema has changed
Nov 15, 2022 11:31:13.678 [0x7fca1fd09b00] INFO - [Req#1f3/Database optimization/com.plexapp.plugins.library.db] SQLITE3:0x80000001, 17, statement aborts at 58: [select * from metadata_items limit 1] database schema has changed
Nov 15, 2022 11:31:13.680 [0x7fca1fd09b00] INFO - [Req#1f3/Database optimization/com.plexapp.plugins.library.db] SQLITE3:0x80000001, 17, statement aborts at 58: [select * from metadata_items limit 1] database schema has changed
Nov 15, 2022 11:31:13.681 [0x7fca1fd09b00] INFO - [Req#1f3/Database optimization/com.plexapp.plugins.library.db] SQLITE3:0x80000001, 17, statement aborts at 58: [select * from metadata_items limit 1] database schema has changed
Nov 15, 2022 11:31:13.682 [0x7fca1fd09b00] INFO - [Req#1f3/Database optimization/com.plexapp.plugins.library.db] SQLITE3:0x80000001, 17, statement aborts at 58: [select * from metadata_items limit 1] database schema has changed
Nov 15, 2022 11:31:13.683 [0x7fca1fd09b00] INFO - [Req#1f3/Database optimization/com.plexapp.plugins.library.db] SQLITE3:0x80000001, 17, statement aborts at 58: [select * from metadata_items limit 1] database schema has changed
Nov 15, 2022 11:31:13.685 [0x7fca1fd09b00] INFO - [Req#1f3/Database optimization/com.plexapp.plugins.library.db] SQLITE3:0x80000001, 17, statement aborts at 58: [select * from metadata_items limit 1] database schema has changed
Nov 15, 2022 11:31:13.686 [0x7fca1fd09b00] INFO - [Req#1f3/Database optimization/com.plexapp.plugins.library.db] SQLITE3:0x80000001, 17, statement aborts at 58: [select * from metadata_items limit 1] database schema has changed
Nov 15, 2022 11:31:13.687 [0x7fca1fd09b00] INFO - [Req#1f3/Database optimization/com.plexapp.plugins.library.db] SQLITE3:0x80000001, 17, statement aborts at 58: [select * from metadata_items limit 1] database schema has changed
Nov 15, 2022 11:31:13.688 [0x7fca1fd09b00] INFO - [Req#1f3/Database optimization/com.plexapp.plugins.library.db] SQLITE3:0x80000001, 17, statement aborts at 58: [select * from metadata_items limit 1] database schema has changed
Nov 15, 2022 11:31:13.690 [0x7fca1fd09b00] INFO - [Req#1f3/Database optimization/com.plexapp.plugins.library.db] SQLITE3:0x80000001, 17, statement aborts at 58: [select * from metadata_items limit 1] database schema has changed
Nov 15, 2022 11:31:13.691 [0x7fca1fd09b00] INFO - [Req#1f3/Database optimization/com.plexapp.plugins.library.db] SQLITE3:0x80000001, 17, statement aborts at 58: [select * from metadata_items limit 1] database schema has changed
Nov 15, 2022 11:31:13.692 [0x7fca1fd09b00] INFO - [Req#1f3/Database optimization/com.plexapp.plugins.library.db] SQLITE3:0x80000001, 17, statement aborts at 58: [select * from metadata_items limit 1] database schema has changed
Nov 15, 2022 11:31:13.693 [0x7fca1fd09b00] INFO - [Req#1f3/Database optimization/com.plexapp.plugins.library.db] SQLITE3:0x80000001, 17, statement aborts at 58: [select * from metadata_items limit 1] database schema has changed
And when I do a scan of this 10/01 library, I get tons of these:
Nov 15, 2022 11:35:20.628 [0x7fca1ac19b00] ERROR - Unknown metadata type:
Nov 15, 2022 11:35:22.480 [0x7fca1a518b00] ERROR - Unknown metadata type:
Nov 15, 2022 11:35:24.812 [0x7fca1ac19b00] ERROR - Unknown metadata type:
Nov 15, 2022 11:35:26.683 [0x7fca1a315b00] ERROR - Unknown metadata type:
Nov 15, 2022 11:35:28.731 [0x7fca1ac19b00] ERROR - Unknown metadata type:
Nov 15, 2022 11:35:30.877 [0x7fca1a315b00] ERROR - Unknown metadata type:
Nov 15, 2022 11:35:32.424 [0x7fca1a518b00] ERROR - Unknown metadata type:
Nov 15, 2022 11:35:38.000 [0x7fca1ac19b00] ERROR - Unknown metadata type:
Just for my own curiosity I tried dropping the library_timeline_entries from blobs and regular DB and restarting, but it seemed to just crash/hang in “Running database migrations” – tried leaving it overnight last night and no dice.
I’ve found backups from 09/31 - 11/12 so can try restoring any of those, but I worry it’ll be pretty much the identical result 
It’s so bizarre though, nothing was visibly broken, everything was running fine – Sonarr, Radarr, etc. until the other day.