500 Internal Server Error after update

Server Version#: 1.15.2.793-782228f99
Player Version#: n/a

is anyone else seeing this issue? after doing an update to the server, I am unable to connect to it from the web, and plex.tv is also unable to connect. I tried a reboot, and I tried downloading the latest (plexpass) version and writing over the application. Now I’m here.

http://127.0.0.1:32400/web/index.html gives me 500 Internal Server Error.

I’m attaching the Plex Media Server.log (84.3 KB)

1 Like

From which version did you update to the current one?

It appears Plex tries to update the database but cannot find certain fields that seem to have been added quite some time ago.

Edit:

As an alternative you might want to look into manually checking the database for corruption and test if it can be fixed.
https://support.plex.tv/articles/201100678-repair-a-corrupt-database/

Previous version was v1.15.1.791-8bec0f76c

I’ll take a look at that db repair instructions, thanks!

I went through the db repair instructions, and rebuilt from a dump, but now the server doesn’t start. Here’s the new Plex Media Server.log (630 Bytes)

Mar 16, 2019 09:22:17.355 [0x70000290a000] ERROR - SQLITE3:0x110b0f118, 1, no such table: schema_migrations in “select version from schema_migrations order by version”

Hi!

We have added a migration recently which creates additional fields in the database. It appears that your database is corrupt, which results in the 500s you are seeing.

I see you attempted a database repair, but that doesn’t appear to have worked. Could you PM me a copy of your database before & after the repair?

I’d recommend re-trying the repair or restoring from an earlier backup.

I’ve DMed you my db. Let me know if you have any ideas!

I’ve tried the database corruption instructions multiple times, but after making a dump file of the old db, I can’t create a new db from it; it’s always zero kb.

I’m hoping I don’t have to start from scratch! if anyone has an idea for how to get my old db working again, let me know!

I went ahead and deleted com.plexapp.plugins.library.db which created a new database for me. A moment of silence for my played/unplayed marks, but everything else is working normally again. Thanks for you help!

1 Like

same here. (Update: read als my 2 next posts)
My Plex Server (OSX) was running without a problem on 1.15.1.791 and after an update to 1.15.3.876 I got an 500 Internal Server Error everywhere.

After going back to 1.15.1.791 everything is working again. I tried it 2 times.
Looks like a migration problem between this 2 versions in my case.

Can please any developer analyse this?
Attached is the log of Version 1.15.3.876. Plex Media Server.2.log (175.3 KB)

Back on 1.15.1.791 here is the content of the migration table from this cmd
sqlite3 com.plexapp.plugins.library.db "select * from schema_migrations" >migration_table.log migration_table.log (2.2 KB)

I can provide any other logs or select’s if needed… (Update: read als my 2 next posts)

After having a deeper look to the 1.15.1.791 log file I noticed already there an error :frowning:
Can anyone help to fix it without losing metadata and played status ?

Apr 13, 2019 17:32:23.501 [0x70000e279000] INFO - Plex Media Server v1.15.1.791-8bec0f76c - Apple Mac x86_64 - build: darwin-x86_64 macos - GMT 02:00
Apr 13, 2019 17:32:23.502 [0x70000e279000] INFO - MacOSX version: 10.14.3, language: de-DE
Apr 13, 2019 17:32:23.502 [0x70000e279000] INFO - Processor Intel(R) Core™ i5-3210M CPU @ 2.50GHz
Apr 13, 2019 17:32:23.502 [0x70000e279000] INFO - /Applications/Plex Media Server.app/Contents/MacOS/Plex Media Server -psn_0_901340
Apr 13, 2019 17:32:23.714 [0x70000e58b000] DEBUG - BPQ: [Idle] → [Starting]
Apr 13, 2019 17:32:23.719 [0x70000e58b000] DEBUG - FeatureManager: Using cached data for features list
Apr 13, 2019 17:32:23.721 [0x70000e58b000] DEBUG - Opening 20 database sessions to library (com.plexapp.plugins.library), SQLite 3.26.0, threadsafe=1
Apr 13, 2019 17:32:23.728 [0x70000e58b000] INFO - SQLITE3:0x103912040, 283, recovered 46 frames from WAL file /Users/michael/Library/Application Support/Plex Media Server/Plug-in Support/Databases/com.plexapp.plugins.library.db-wal
Apr 13, 2019 17:32:23.781 [0x70000e58b000] DEBUG - Running migrations. (EPG 0)
Apr 13, 2019 17:32:23.786 [0x70000e58b000] DEBUG - Running forward migration 20181210190600.
Apr 13, 2019 17:32:23.786 [0x70000e58b000] DEBUG - Captured session 0.
Apr 13, 2019 17:32:23.786 [0x70000e58b000] DEBUG - Captured session 1.
Apr 13, 2019 17:32:23.787 [0x70000e58b000] DEBUG - Captured session 2.
Apr 13, 2019 17:32:23.787 [0x70000e58b000] DEBUG - Captured session 3.
Apr 13, 2019 17:32:23.787 [0x70000e58b000] DEBUG - Captured session 4.
Apr 13, 2019 17:32:23.787 [0x70000e58b000] DEBUG - Captured session 5.
Apr 13, 2019 17:32:23.787 [0x70000e58b000] DEBUG - Captured session 6.
Apr 13, 2019 17:32:23.787 [0x70000e58b000] DEBUG - Captured session 7.
Apr 13, 2019 17:32:23.787 [0x70000e58b000] DEBUG - Captured session 8.
Apr 13, 2019 17:32:23.787 [0x70000e58b000] DEBUG - Captured session 9.
Apr 13, 2019 17:32:23.787 [0x70000e58b000] DEBUG - Captured session 10.
Apr 13, 2019 17:32:23.787 [0x70000e58b000] DEBUG - Captured session 11.
Apr 13, 2019 17:32:23.787 [0x70000e58b000] DEBUG - Captured session 12.
Apr 13, 2019 17:32:23.787 [0x70000e58b000] DEBUG - Captured session 13.
Apr 13, 2019 17:32:23.787 [0x70000e58b000] DEBUG - Captured session 14.
Apr 13, 2019 17:32:23.787 [0x70000e58b000] DEBUG - Captured session 15.
Apr 13, 2019 17:32:23.787 [0x70000e58b000] DEBUG - Captured session 16.
Apr 13, 2019 17:32:23.787 [0x70000e58b000] DEBUG - Captured session 17.
Apr 13, 2019 17:32:23.787 [0x70000e58b000] DEBUG - Captured session 18.
Apr 13, 2019 17:32:23.787 [0x70000e58b000] DEBUG - Captured session 19.
> Apr 13, 2019 17:32:23.792 [0x70000e58b000] ERROR - SQLITE3:0x103912040, 11, database corruption at line 64757 of [bf8c1b2b7a]
> Apr 13, 2019 17:32:23.793 [0x70000e58b000] ERROR - SQLITE3:0x103912040, 11, database corruption at line 64798 of [bf8c1b2b7a]
> Apr 13, 2019 17:32:23.793 [0x70000e58b000] ERROR - SQLITE3:0x103912040, 11, statement aborts at 23: [update statistics_bandwidth set timespan=(-1 - timespan)] database disk image is malformed
Apr 13, 2019 17:32:23.793 [0x70000e58b000] ERROR - Exception inside transaction (inside=1) (…/Library/DatabaseMigrations.cpp:204): sqlite3_statement_backend::loadOne: database disk image is malformed
Apr 13, 2019 17:32:23.800 [0x70000e58b000] ERROR - Exception thrown during migrations, aborting: sqlite3_statement_backend::loadOne: database disk image is malformed
Apr 13, 2019 17:32:23.999 [0x70000e58b000] DEBUG - ChangestampAllocator: initialized to 1626642
Apr 13, 2019 17:32:24.000 [0x70000e58b000] DEBUG - Opening 2 database sessions to library (com.plexapp.plugins.library.blobs), SQLite 3.26.0, threadsafe=1
Apr 13, 2019 17:32:24.008 [0x70000e58b000] DEBUG - Running migrations. (EPG 0)
Apr 13, 2019 17:32:24.009 [0x70000e714000] DEBUG - Codecs: Downloading current version of aac decoder
Apr 13, 2019 17:32:24.009 [0x70000e714000] INFO - CodecManager: obtaining decoder ‘aac’
Apr 13, 2019 17:32:24.011 [0x70000e714000] DEBUG - Relay: read 8 cached entries from hosts file

After an complete backup of my databases directory I did repair my database successfully with this description:
Repair a Corrupt Database
So my problem is solved and I did not lose any data (Metadata or watched stats) :slight_smile:

It looks like I have had some errors in the database since some month.
Some migrations from last version(s) were not performed. and version 1.15.3.876 was not running because of the missing migrations.
I hope this information helps if you have similar problems…

Same thing happened here, my Mac Mini w/Plex Media Server stopped working after upgrade to 1.15.4.

Tried the repair database link from @misc2000 and everything is working fine again :confetti_ball:

Thank you!

Just got the same after upgrading to 1.15.5.994. Really don’t fancy having to start messing about with command lines to resolve this. Plex should really provide a fix or add the corruption fixing utilities to the main application.

Restored back to 1.15.1.707 which fixed the issue. Workaround only I guess.

Hi all,
I just updated my PMS from 1.14.1.5488 to 1.15.6.1079 on my Mac, and now I, too, am receiving a 500 error when I try to browse to http://127.0.0.1:32400/web/index.html. I attempted the database repair as outlined in the links above, but each time, the restore of the database from the “dump.sql” file results in a 0 kb com.plexapp.plugins.library.db, and Plex won’t start up. I REALLY don’t want to have to dump my database and start over. Can anyone advise? I was going to try to just downgrade back to 1.14.1.5488 (I’ve downgraded in the past due to upgrade issues), but I can’t seem to find instructions anywhere on how to do that, and it’s been too long since I last downgraded for me to remember how.

Not sure if this is needed, but here’s what I see in the PMS log when the server starts:

Jun 08, 2019 12:49:58.351 [0x700009727000] INFO - Plex Media Server v1.15.6.1079-78232c603 - Apple Mac x86_64 - build: darwin-x86_64 macos - GMT -05:00
Jun 08, 2019 12:49:58.352 [0x700009727000] INFO - MacOSX version: 10.13.6, language: en-US
Jun 08, 2019 12:49:58.352 [0x700009727000] INFO - Processor Intel® Core™ i5-2520M CPU @ 2.50GHz
Jun 08, 2019 12:49:58.352 [0x700009727000] INFO - /Applications/Plex Media Server.app/Contents/MacOS/Plex Media Server
Jun 08, 2019 12:49:58.534 [0x7000099b6000] DEBUG - BPQ: [Idle] -> [Starting]
Jun 08, 2019 12:49:58.535 [0x7000099b6000] DEBUG - FeatureManager: Using cached data for features list
Jun 08, 2019 12:49:58.536 [0x7000099b6000] DEBUG - Opening 20 database sessions to library (com.plexapp.plugins.library), SQLite 3.26.0, threadsafe=1
Jun 08, 2019 12:49:58.537 [0x7000099b6000] INFO - SQLITE3:0x101, 283, recovered 107 frames from WAL file /Users/chris/Library/Application Support/Plex Media Server/Plug-in Support/Databases/com.plexapp.plugins.library.db-wal
Jun 08, 2019 12:49:58.696 [0x7000099b6000] DEBUG - Running migrations. (EPG 0)
Jun 08, 2019 12:49:58.699 [0x7000099b6000] DEBUG - Running forward migration 20181210190600.
Jun 08, 2019 12:49:58.699 [0x7000099b6000] DEBUG - Captured session 0.
Jun 08, 2019 12:49:58.699 [0x7000099b6000] DEBUG - Captured session 1.
Jun 08, 2019 12:49:58.699 [0x7000099b6000] DEBUG - Captured session 2.
Jun 08, 2019 12:49:58.699 [0x7000099b6000] DEBUG - Captured session 3.
Jun 08, 2019 12:49:58.699 [0x7000099b6000] DEBUG - Captured session 4.
Jun 08, 2019 12:49:58.699 [0x7000099b6000] DEBUG - Captured session 5.
Jun 08, 2019 12:49:58.700 [0x7000099b6000] DEBUG - Captured session 6.
Jun 08, 2019 12:49:58.700 [0x7000099b6000] DEBUG - Captured session 7.
Jun 08, 2019 12:49:58.700 [0x7000099b6000] DEBUG - Captured session 8.
Jun 08, 2019 12:49:58.700 [0x7000099b6000] DEBUG - Captured session 9.
Jun 08, 2019 12:49:58.700 [0x7000099b6000] DEBUG - Captured session 10.
Jun 08, 2019 12:49:58.700 [0x7000099b6000] DEBUG - Captured session 11.
Jun 08, 2019 12:49:58.700 [0x7000099b6000] DEBUG - Captured session 12.
Jun 08, 2019 12:49:58.700 [0x7000099b6000] DEBUG - Captured session 13.
Jun 08, 2019 12:49:58.700 [0x7000099b6000] DEBUG - Captured session 14.
Jun 08, 2019 12:49:58.700 [0x7000099b6000] DEBUG - Captured session 15.
Jun 08, 2019 12:49:58.700 [0x7000099b6000] DEBUG - Captured session 16.
Jun 08, 2019 12:49:58.700 [0x7000099b6000] DEBUG - Captured session 17.
Jun 08, 2019 12:49:58.700 [0x7000099b6000] DEBUG - Captured session 18.
Jun 08, 2019 12:49:58.700 [0x7000099b6000] DEBUG - Captured session 19.
Jun 08, 2019 12:49:58.823 [0x7000099b6000] ERROR - SQLITE3:0x101, 11, database corruption at line 64757 of [bf8c1b2b7a]
Jun 08, 2019 12:49:58.823 [0x7000099b6000] ERROR - SQLITE3:0x101, 11, database corruption at line 64798 of [bf8c1b2b7a]
Jun 08, 2019 12:49:58.823 [0x7000099b6000] ERROR - SQLITE3:0x101, 11, statement aborts at 27: [update statistics_bandwidth set timespan=(-1 - timespan)] database disk image is malformed
Jun 08, 2019 12:49:58.824 [0x7000099b6000] ERROR - Exception inside transaction (inside=1) (…/Library/DatabaseMigrations.cpp:206): sqlite3_statement_backend::loadOne: database disk image is malformed
Jun 08, 2019 12:49:58.856 [0x7000099b6000] ERROR - Exception thrown during migrations, aborting: sqlite3_statement_backend::loadOne: database disk image is malformed

and then eventually start getting logs like this:

Jun 08, 2019 12:50:16.782 [0x70000aa99000] ERROR - SQLITE3:0x101, 1, no such column: devices.platform in "select devices.id as ‘devices_id’, devices.identifier as ‘devices_identifier’, devices.name as ‘devices_name’, devices.created_at as ‘devices_created_at’, devices.updated_a
Jun 08, 2019 12:50:16.782 [0x70000aa99000] ERROR - Soci Exception handled: sqlite3_statement_backend::prepare: no such column: devices.platform for SQL: select devices.id as ‘devices_id’, devices.identifier as ‘devices_identifier’, devices.name as ‘devices_name’, devices.created_at as ‘devices_created_at’, devices.updated_at as ‘devices_updated_at’, devices.platform as ‘devices_platform’ from devices where identifier=?
Jun 08, 2019 12:50:16.782 [0x70000aa16000] ERROR - SQLITE3:0x101, 1, no such column: devices.platform in "select devices.id as ‘devices_id’, devices.identifier as ‘devices_identifier’, devices.name as ‘devices_name’, devices.created_at as ‘devices_created_at’, devices.updated_a
Jun 08, 2019 12:50:16.782 [0x70000aa16000] ERROR - Soci Exception handled: sqlite3_statement_backend::prepare: no such column: devices.platform for SQL: select devices.id as ‘devices_id’, devices.identifier as ‘devices_identifier’, devices.name as ‘devices_name’, devices.created_at as ‘devices_created_at’, devices.updated_at as ‘devices_updated_at’, devices.platform as ‘devices_platform’ from devices where identifier=?
Jun 08, 2019 12:50:16.782 [0x70000ab9f000] ERROR - SQLITE3:0x101, 1, no such column: devices.platform in "select devices.id as ‘devices_id’, devices.identifier as ‘devices_identifier’, devices.name as ‘devices_name’, devices.created_at as ‘devices_created_at’, devices.updated_a

Any help would be much appreciated. It’s cold and rainy today, and the kids are getting restless…

An update: I used the “-echo” flag while attempting to create the new database from the dump.sql file, and at the very end, saw “ROLLBACK;”. So I checked the contents of the dump.sql file, and sure enough, the last line is “ROLLBACK; – due to errors”. So I’m thinking I’m SOL with this database. I made a copy of the database directory, deleted all the files within, and started fresh. I’m a sad man, but at least Plex is running again on the latest version.

If anyone has any other thoughts on how to repair the DB, I’d still be interested.

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