Database keeps corrupting

Server Version#:1.40.3.8555
Player Version#:

Hello-

I am having a repeated issue with my Plex database getting corrupted at a rate of almost 12 hrs. I believe it was caused by a forced restart on my Mac (OS 10.14.6 Mojave) while the server was running.

When I try to access my playlists (on the web and desktop player only; I can access them fine on mobile) I get the error message “There was an unexpected error loading this item.” Further more I cannot add any new media to my library.

I’ve tried loading a backup of the Database but this only works for a short while. Unfortunately I have no backup from before the forced restart.

I’ve run the PlexDBrepair utility and that works sometimes; I can repair the database and then backup the db and blobs files, and it works for a short time, but a day later it’s corrupted again.

Any advice on how to fix this would be very much appreciated

You did the right things trying to fix this, but it sounds beyond complete repair. Maybe Apple First Aide might help, and maybe Chuck has an idea. Good luck!

Is there a 3rd-party anti virus app in use?

Is the Plex data on an external drive, or even network file share?

No and no to both. The library file is in the “standard” location on the main Mac HD (Library/Application Support/Plex Media Server/Plug-In Support/Databases). BTW do you have any idea which log files I should post (if any)? I’ve downloaded the logs folder but I’m not sure what to upload? Would that help? Thanks!

For most problems, databases ones included, 98% of relevant logging goes in one spot after you power cycle the Mac (due to the way log files are designed and rotated).

Power cycle every piece of hardware from computer to ISP router.
Start PMS for Mac. Let it run 3 min.
Settings → Troubleshooting → Download Logs

The main log file that holds what we need is called
Plex Media Server.log

Zip and upload that if you want. You can search inside it yourself while waiting for a reply, for keywords like ERROR or CRITICAL or SQLITE.

When Otto asked about your library being local or external, he meant your media library full of movies and TV shows, not the database that you correctly located. Are your movies and shows on the internal HD? Some external drives go to sleep, for example, and network shares like NFS can causes difficulties.

Good luck!

Sorry I misunderstood your original question; yes, all Plex library data are on external drives

OK, so I’m including the zipped log file here. Thanks again for the assistance!

Plex Media Server.log.zip (60.6 KB)

Hi, is your Mac intermittently shutting down? I was having an issue similar before I upgraded to Apple Silicon, problem disappeared. Then again I did a clean install of PMS. :thinking:

No it is not; I’m able to recover a functioning database for a short time and then it gets corrupted. The initial corruption was caused (I think) by a forced shutdown becuase of a major system crash

ok, I would be considering a clean install, if you do you must follow a proper uninstall.

https://support.plex.tv/articles/201941078-uninstall-plex-media-server/

You could try a dump of PMS Cache, remember to shut down PMS and empty Trash before a restart of Mac

I’m beginning to conclude what SE56 suggested, that a complete uninstall and clean install of PMS on your MacMini is the best option.

Looking at the log you uploaded, PMS does not start up normally. There are two major errors listed, one I’ve never seen.

  1. This is error is repeated. I’ve not seen it before. So I don’t know how critical it is, but it’s listed as an ERROR which is generally reserved for very bad things. Try to remove all the special characters and rename it to MacMini for the future (usually in System Settings → Sharing → Local hostname)
Jul 21, 2024 15:25:20.790 [0x700006686000] ERROR - [HttpHeader] invalid 'X-Plex-Device-Name' header value (CHRIS’s Mac mini (2))

.
.

  1. Next is the big issue you’ve previously identified, that your PMS database is corrupt. If Plex DBRepair can’t fix it 100%, whatever was unfixed keeps cropping up and making it worse.
Jul 21, 2024 15:25:20.898 [0x700005bc7000] ERROR - [DatabaseFixups] SQLITE3:(nil), 267, statement aborts at 169: [update metadata_items set extra_data=? where metadata_type=? and library_section_id=? and id=?] database disk image is malformed

FWIW, I wrote a script to quickly and completely uninstall PMS from an Apple because I do that a lot for testing. Search the forums for delpms if you want to see everything in one spot.

Removing the apostrophe will clear the error.

I do not know if that error causes other problems with Plex, but agree it is a good idea to clean it up.

The issue has been solved-I was not aware that I had the automatic database backup feature scheduled and that there were earlier backups in the Database folder. I simply renamed the .db and blobs files and rescanned my library-problem solved. Thanks for the suggestions!

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