Optimize error

hi

when i Optimize db i recive this error… any suggestion?

Jun 01, 2016 22:06:20 [0x7f7af03f2700] WARN - Held transaction for too long (…/Library/FullTextSearch.cpp:16): 1.470000 seconds
Jun 01, 2016 22:06:22 [0x7f7af03f2700] WARN - Held transaction for too long (…/Library/FullTextSearch.cpp:26): 0.960000 seconds
Jun 01, 2016 22:06:24 [0x7f7af03f2700] WARN - Held transaction for too long (…/Library/FullTextSearch.cpp:35): 2.360000 seconds
Jun 01, 2016 22:06:25 [0x7f7af03f2700] WARN - Held transaction for too long (…/Library/FullTextSearch.cpp:45): 1.290000 seconds
Jun 01, 2016 22:06:33 [0x7f7af03f2700] INFO - SQLITE3:0x10, 17, statement aborts at 58: [select * from metadata_items limit 1] database schema has changed
Jun 01, 2016 22:06:33 [0x7f7af03f2700] INFO - SQLITE3:0x10, 17, statement aborts at 58: [select * from metadata_items limit 1] database schema has changed
Jun 01, 2016 22:06:33 [0x7f7af03f2700] INFO - SQLITE3:0x10, 17, statement aborts at 58: [select * from metadata_items limit 1] database schema has changed
Jun 01, 2016 22:06:33 [0x7f7af03f2700] INFO - SQLITE3:0x10, 17, statement aborts at 58: [select * from metadata_items limit 1] database schema has changed
Jun 01, 2016 22:06:33 [0x7f7af03f2700] INFO - SQLITE3:0x10, 17, statement aborts at 58: [select * from metadata_items limit 1] database schema has changed
Jun 01, 2016 22:06:33 [0x7f7af03f2700] INFO - SQLITE3:0x10, 17, statement aborts at 58: [select * from metadata_items limit 1] database schema has changed
Jun 01, 2016 22:06:33 [0x7f7af03f2700] INFO - SQLITE3:0x10, 17, statement aborts at 58: [select * from metadata_items limit 1] database schema has changed
Jun 01, 2016 22:06:33 [0x7f7af03f2700] INFO - SQLITE3:0x10, 17, statement aborts at 58: [select * from metadata_items limit 1] database schema has changed
Jun 01, 2016 22:06:33 [0x7f7af03f2700] INFO - SQLITE3:0x10, 17, statement aborts at 58: [select * from metadata_items limit 1] database schema has changed
Jun 01, 2016 22:06:33 [0x7f7af03f2700] INFO - SQLITE3:0x10, 17, statement aborts at 58: [select * from metadata_items limit 1] database schema has changed
Jun 01, 2016 22:06:33 [0x7f7af03f2700] INFO - SQLITE3:0x10, 17, statement aborts at 58: [select * from metadata_items limit 1] database schema has changed
Jun 01, 2016 22:06:33 [0x7f7af03f2700] INFO - SQLITE3:0x10, 17, statement aborts at 58: [select * from metadata_items limit 1] database schema has changed
Jun 01, 2016 22:06:33 [0x7f7af03f2700] INFO - SQLITE3:0x10, 17, statement aborts at 58: [select * from metadata_items limit 1] database schema has changed
Jun 01, 2016 22:06:33 [0x7f7af03f2700] INFO - SQLITE3:0x10, 17, statement aborts at 58: [select * from metadata_items limit 1] database schema has changed
Jun 01, 2016 22:06:33 [0x7f7af03f2700] INFO - SQLITE3:0x10, 17, statement aborts at 58: [select * from metadata_items limit 1] database schema has changed
Jun 01, 2016 22:06:33 [0x7f7af03f2700] INFO - SQLITE3:0x10, 17, statement aborts at 58: [select * from metadata_items limit 1] database schema has changed
Jun 01, 2016 22:06:33 [0x7f7af03f2700] INFO - SQLITE3:0x10, 17, statement aborts at 58: [select * from metadata_items limit 1] database schema has changed
Jun 01, 2016 22:06:33 [0x7f7af03f2700] INFO - SQLITE3:0x10, 17, statement aborts at 58: [select * from metadata_items limit 1] database schema has changed
Jun 01, 2016 22:06:33 [0x7f7af03f2700] INFO - SQLITE3:0x10, 17, statement aborts at 58: [select * from metadata_items limit 1] database schema has changed
Jun 01, 2016 22:06:33 [0x7f7af03f2700] WARN - Held transaction for too long (…/Library/DatabaseFixups.cpp:157): 0.280000 seconds
Jun 01, 2016 22:06:33 [0x7f7af8bfe700] WARN - Took too long (0.260000 seconds) to start a transaction on …/Statistics/StatisticsManager.h:185
Jun 01, 2016 22:06:33 [0x7f7af8bfe700] WARN - Transaction that was running was started on …/Library/DatabaseFixups.cpp:146

This log snippets actually doesn’t show the database optimization operation but the start of the server after a server update.Only try an optimization after the server has been started up for quite a while.

It must also not be busy e.g. doing library updates or other operations which would cause changes to the database.

I’m sure this log is generated only when I press the button " optimizes db ".
I tried to press it three times and three times he has virtually created the same log .

I also tried to restart the service and verify that not doing other activities but the problem persists .

I tried to remove and reinstall the package ( I did not use the purge option ) but it did not work , at this point I doubt that an upgrade from a previous version has not fuzionato properly …

Debug:

Jun 01, 2016 23:10:28 [0x7f6f9a7ff700] DEBUG - Request: [xx.xx.xx.xx:53888] PUT /library/optimize (3 live) TLS GZIP
Jun 01, 2016 23:10:28 [0x7f6f9a7ff700] DEBUG - Auth: We found auth token (xxxxxxxxxxxxxxxxxxxx), enabling token-based authentication.
Jun 01, 2016 23:10:28 [0x7f6f9a7ff700] DEBUG - Auth: Came in with a super-token, authorization succeeded.
Jun 01, 2016 23:10:28 [0x7f6f9a7ff700] DEBUG - Database optimization: Optimizing database. Starting by capturing all sessions.
Jun 01, 2016 23:10:28 [0x7f6f9a7ff700] DEBUG - Captured session 0.
Jun 01, 2016 23:10:28 [0x7f6f9a7ff700] DEBUG - Captured session 1.
Jun 01, 2016 23:10:28 [0x7f6f9a7ff700] DEBUG - Captured session 2.
Jun 01, 2016 23:10:28 [0x7f6f9a7ff700] DEBUG - Captured session 3.
Jun 01, 2016 23:10:28 [0x7f6f9a7ff700] DEBUG - Captured session 4.
Jun 01, 2016 23:10:28 [0x7f6f9a7ff700] DEBUG - Captured session 5.
Jun 01, 2016 23:10:28 [0x7f6f9a7ff700] DEBUG - Captured session 6.
Jun 01, 2016 23:10:28 [0x7f6f9a7ff700] DEBUG - Captured session 7.
Jun 01, 2016 23:10:28 [0x7f6f9a7ff700] DEBUG - Captured session 8.
Jun 01, 2016 23:10:28 [0x7f6f9a7ff700] DEBUG - Captured session 9.
Jun 01, 2016 23:10:28 [0x7f6f9a7ff700] DEBUG - Captured session 10.
Jun 01, 2016 23:10:28 [0x7f6f9a7ff700] DEBUG - Captured session 11.
Jun 01, 2016 23:10:28 [0x7f6f9a7ff700] DEBUG - Captured session 12.
Jun 01, 2016 23:10:28 [0x7f6f9a7ff700] DEBUG - Captured session 13.
Jun 01, 2016 23:10:28 [0x7f6f9a7ff700] DEBUG - Captured session 14.
Jun 01, 2016 23:10:28 [0x7f6f9a7ff700] DEBUG - Captured session 15.
Jun 01, 2016 23:10:28 [0x7f6f9a7ff700] DEBUG - Captured session 16.
Jun 01, 2016 23:10:28 [0x7f6f9a7ff700] DEBUG - Captured session 17.
Jun 01, 2016 23:10:28 [0x7f6f9a7ff700] DEBUG - Captured session 18.
Jun 01, 2016 23:10:28 [0x7f6f9a7ff700] DEBUG - Captured session 19.
Jun 01, 2016 23:10:28 [0x7f6f9a7ff700] DEBUG - Database optimization: Rebuilding full text search tables.
Jun 01, 2016 23:10:29 [0x7f6f9a7ff700] WARN - Held transaction for too long (…/Library/FullTextSearch.cpp:16): 1.420000 seconds
Jun 01, 2016 23:10:30 [0x7f6f9a7ff700] WARN - Held transaction for too long (…/Library/FullTextSearch.cpp:26): 0.910000 seconds
Jun 01, 2016 23:10:33 [0x7f6f9a7ff700] WARN - Held transaction for too long (…/Library/FullTextSearch.cpp:35): 2.260000 seconds
Jun 01, 2016 23:10:34 [0x7f6f9a7ff700] WARN - Held transaction for too long (…/Library/FullTextSearch.cpp:45): 1.220000 seconds
Jun 01, 2016 23:10:34 [0x7f6f9a7ff700] DEBUG - Database optimization: starting.
Jun 01, 2016 23:10:42 [0x7f6f9a7ff700] DEBUG - Database optimization: complete.
Jun 01, 2016 23:10:42 [0x7f6f9a7ff700] INFO - SQLITE3:0x10, 17, statement aborts at 58: [select * from metadata_items limit 1] database schema has changed
Jun 01, 2016 23:10:42 [0x7f6f9a7ff700] INFO - SQLITE3:0x10, 17, statement aborts at 58: [select * from metadata_items limit 1] database schema has changed
Jun 01, 2016 23:10:42 [0x7f6f9a7ff700] INFO - SQLITE3:0x10, 17, statement aborts at 58: [select * from metadata_items limit 1] database schema has changed
Jun 01, 2016 23:10:42 [0x7f6f9a7ff700] INFO - SQLITE3:0x10, 17, statement aborts at 58: [select * from metadata_items limit 1] database schema has changed
Jun 01, 2016 23:10:42 [0x7f6f9a7ff700] INFO - SQLITE3:0x10, 17, statement aborts at 58: [select * from metadata_items limit 1] database schema has changed
Jun 01, 2016 23:10:42 [0x7f6f9a7ff700] INFO - SQLITE3:0x10, 17, statement aborts at 58: [select * from metadata_items limit 1] database schema has changed
Jun 01, 2016 23:10:42 [0x7f6f9a7ff700] INFO - SQLITE3:0x10, 17, statement aborts at 58: [select * from metadata_items limit 1] database schema has changed
Jun 01, 2016 23:10:42 [0x7f6f9a7ff700] INFO - SQLITE3:0x10, 17, statement aborts at 58: [select * from metadata_items limit 1] database schema has changed
Jun 01, 2016 23:10:42 [0x7f6f9a7ff700] INFO - SQLITE3:0x10, 17, statement aborts at 58: [select * from metadata_items limit 1] database schema has changed
Jun 01, 2016 23:10:42 [0x7f6f9a7ff700] INFO - SQLITE3:0x10, 17, statement aborts at 58: [select * from metadata_items limit 1] database schema has changed
Jun 01, 2016 23:10:42 [0x7f6f9a7ff700] INFO - SQLITE3:0x10, 17, statement aborts at 58: [select * from metadata_items limit 1] database schema has changed
Jun 01, 2016 23:10:42 [0x7f6f9a7ff700] INFO - SQLITE3:0x10, 17, statement aborts at 58: [select * from metadata_items limit 1] database schema has changed
Jun 01, 2016 23:10:42 [0x7f6f9a7ff700] INFO - SQLITE3:0x10, 17, statement aborts at 58: [select * from metadata_items limit 1] database schema has changed
Jun 01, 2016 23:10:42 [0x7f6f9a7ff700] INFO - SQLITE3:0x10, 17, statement aborts at 58: [select * from metadata_items limit 1] database schema has changed
Jun 01, 2016 23:10:42 [0x7f6f9a7ff700] INFO - SQLITE3:0x10, 17, statement aborts at 58: [select * from metadata_items limit 1] database schema has changed
Jun 01, 2016 23:10:42 [0x7f6f9a7ff700] INFO - SQLITE3:0x10, 17, statement aborts at 58: [select * from metadata_items limit 1] database schema has changed
Jun 01, 2016 23:10:42 [0x7f6f9a7ff700] INFO - SQLITE3:0x10, 17, statement aborts at 58: [select * from metadata_items limit 1] database schema has changed
Jun 01, 2016 23:10:42 [0x7f6f9a7ff700] INFO - SQLITE3:0x10, 17, statement aborts at 58: [select * from metadata_items limit 1] database schema has changed
Jun 01, 2016 23:10:42 [0x7f6f9a7ff700] INFO - SQLITE3:0x10, 17, statement aborts at 58: [select * from metadata_items limit 1] database schema has changed
Jun 01, 2016 23:10:42 [0x7f6f9a7ff700] DEBUG - Running database fix-ups.
Jun 01, 2016 23:10:42 [0x7f6f9a7ff700] WARN - Held transaction for too long (…/Library/DatabaseFixups.cpp:157): 0.240000 seconds
Jun 01, 2016 23:10:42 [0x7f6f9a7ff700] DEBUG - Running database fix-ups completed in 0.2 seconds.
Jun 01, 2016 23:10:42 [0x7f6fa17fe700] DEBUG - Completed: [xx.xx.xx.xx:53888] PUT /library/optimize (3 live) TLS GZIP 14124ms 231 bytes 200
Jun 01, 2016 23:10:42 [0x7f6f9f7ff700] VERBOSE - Statistics: (Plex Web (Chrome)) Reporting 231 bytes for account 1 on LAN: 0

Once again, it looks like database optimization overlapped with the database schema changes after a Plex server update.
Which leads me to believe that your database is corrupt.
https://support.plex.tv/hc/en-us/articles/201100678