PMS Won't Open, It flashes really quick trying to open but it desappears really quick. Please help

MACOS MONTEREY v12.6
Server Version#:1.28.2.6151-914
Player Version#: Version 4.91.2

Everything has been working great but my Mac had an unexpected reboot and now i cannot open PMS. Can someone please help me out. Can someone please look at my logs attached.

PlexMediaServer-1.28.2.6151-914ddd2b3-universal Logs.zip (1.3 MB)

Sep 24, 2022 12:09:47.474 [0x7000069d8000] ERROR - Database corruption: sqlite3_statement_backend::prepare: database disk image is malformed for SQL: PRAGMA cache_size=2000 Looks like you have database corruption, please see https://support.plex.tv/articles/repair-a-corrupted-database/ or revert to a database backup.

1 Like

Thank you for taking the time to look at the logs. I now have sqlite tool open but how to i open the database in the sqlite tool ?

You need to use the Plex sql tool, plex uses a customized version of sqllite. See the link for instructions on how to repair it

Yes i am using plex sqlite tool i just don’t know exactly how to open the database from the tool to run a repair command. Is there a video tutorial somewhere that show how to do it?

I am in a mac i am trying to repair the database i typed this command “Plex SQLite” “/Users/Pro/Library/Application\ Support/Plex\ Media\ Server/Plug-in\ Support/Databases/com.plexapp.plugins.library.db” “PRAGMA integrity_check;” but i don’t see anything happening do you know if i am typing something wrong? or how should i type the command in a mac?

The directions in that article could be a bit better. You’ll be working in a Terminal window. Your PMS should not be running. You should Quit out of it if it’s running.

First thing to note, the Plex SQLite app is located at this path:

"/Applications/Plex Media Server.app/Contents/MacOS/Plex SQLite"

When directed to use that app, you’re expected to type that exactly as shown including the quotation marks.

So your workflow after quitting out of PMS would be something like

cd “/Users/Pro/Library/Application Support/Plex Media Server/Plug-in Support/Databases"
cp com.plexapp.plugins.library.db com.plexapp.plugins.library.db.original
"/Applications/Plex Media Server.app/Contents/MacOS/Plex SQLite" com.plexapp.plugins.library.db

If this works correctly, the app runs and drops you into an SQLITE shell where you will see

sqlite> 

The rest of the directions should be clear from the repair a corrupt database article, but ask questions if you want.

Thank you nibbles for helping out. I am new to the plex server world but i am now in the shell with the sqlite> can you guide me on what should i type first to repair the database? example should type it like this below?
sqlite>“Plex SQLite” /Users/Pro/Library/Application Support/Plex Media Server/Plug-in Support/Databases/com.plexapp.plugins.library.db ```
PRAGMA integrity_check;

does that looks correct to you?

can i send a copy of my database to support and maybe can can fix the corruption?

I haven’t been able to figure out what to type once i am in the sqlite> command prompt to fix the database. Is there a tutorial somewhere on how to do this on a MAC?

Sorry I went to get a booster shot :slight_smile:

When you are at the sqlite> prompt all you need to type is the stuff in the article that’s in the boxes… well most of the boxes. You just don’t type the word sqlite>, that’s just a prompt.

sqlite> PRAGMA integrity_check;
sqlite> VACUUM;
sqlite> REINDEX;
sqlite> .output db-recover.sqlite
sqlite> .recover
sqlite> .quit

You should be back at a regular prompt. The article then tells you to move your corrupted db aside and start the sqlite shell again with the same command (to make an empty one with that name)

mv com.plexapp.plugins.library.db /Users/Pro/
"/Applications/Plex Media Server.app/Contents/MacOS/Plex SQLite" com.plexapp.plugins.library.db

The article then says you’ll be back at an sqlite> prompt where you type
.read db-recover.sqlite at the prompt, e.g.

sqlite> .read db-recover.sqlite
sqlite> .quit

chown admin:administrators com.plexapp.plugins.library.db
chmod 664 com.plexapp.plugins.library.db

I think that’s all there is to it :slight_smile:

Great! Thank you for you patience as i am a noob on this stuff but with your help i was able to fix the database and i am now back up and running. Thank you so much for your help.

1 Like

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