Server Version#: plexmediaserver-1.25.5.5492-12f6b8c83.x86_64
Player Version#: web player
Been running plex on a centos 7 server for a few years now, yesterday I found that my libraries cannot be found, checking the service status I’m getting the following error:
Failed to load preferences at /var/lib/plexmediaserver/Library/Application Support/Plex Media Server/Preferences.xml
I usually have the entire plexmediaserver directory symlinked to a raid drive, but now I come to find that my symlink is no longer there (perhaps an update to plex did that? I updated last week and it was working fine) and there is a plexmediaserver there completely populated with my server’s data, well all except for the fact that Preferences.xml is empty.
This file is empty in the plexmediaserver directory as well as the symlink target directory.
How can I restore/rebuild Preferences.xml to have the entries needed to find my libraries again?
Ran find . -type f -name '*Preferences.xml*' and found no other preference files in the two directories I have (lib and mnt), no tmp files.
The link was ln -s /mnt/raid6tb/plexmediaserver /var/lib/plexmediaserver which was just to have the metadata systems running on a secondary HDD instead of the OS’s SSD.
I’m running systemd, the default for centos 7.
Just weird that I haven’t updated/altered plex at all in at least week and it was working yesterday with no issues.
I set this all up years ago. The symlink wasn’t there when I first noticed the issue, I think a plex update may have overwritten it at some point in the past.
Regardless, I’ve tried both with and without the symlink. The Preferences file is empty in both directories.
There are no results from running echo $PLEX_MEDIA_SERVER_APPLICATION_SUPPORT_DIR and printenv has nothing related to plex.
Do you think creating this environment variable will actually do anything since I have the same issue with and without the symlink?
It’s all local to the centos7 system; I have the OS on a nvme drive and two sata HDDs in raid1. That raid drive is configured with samba for my local network. Plex runs on the same centos7 system that the raid/samba run off of.
I can access the files through the network drive on other PCs in my local network (samba) so I know the data integrity is there, but the plex software ain’t able to find the files for the metadata it’s built up over the years it seems. I’m just assuming it’s because that preferences file is blank. I’m not that much of an expert in the plex software, but I know some linux.
I’ve got a plan to modernize much of my home lab to containerization and a new OS (eventually) but I gotta wait on that for the next few months. I’m looking for an easier solution in the meantime.
I mean, I could just try a new install on this system (all the content seems fine), but this is my home production server and I hate having to reconfigure crap I worked on forever ago. Lots of libraries to remake and tons of friends [I think] I’d have to re-invite.
It’s been a while since I’ve had to clean install plex, but do you think that is a quicker, more immediate solution (maybe under two dozen libraries/friends)?
I’ll make more of my own rolling backup scripts next time (I bet there’s a more modern solution than running rysncs with cron now too lol).
Do you have a backup of “Preferences.xml” ? If so, we can use that to save the UUID/claimed status.
Let’s give this a spin. Worst case scenario is you need to reclaim it and share it again (if you’re sharing outside your home).
stop plex
mv Preferences.xml Preferences.xml.broken
sudo chown -R plex:plex /var/lib/plexmediaserver (edit this appropriately if you have customized username or location)
start plex
cat Preferences,xml – make sure it’s partially populated,
— OPTIONAL —
6a. stop plex
6b. copy the backup ‘Preferences.xml’ into position to overwrite the unclaimed one,
6c. verify owned by plex:plex
6d. start plex
fingers crossed, it’ll come back.
Please advise of your progress.
My backups are pretty straight forward;
Stop Plex
cd /var/lib/plexmediaserver
sudo tar cf /path/to/save/to/plex-backup-$(date).tar ./Library
be advised, you’ll want to get the date string formatting correct. What I show here is example but not exact.
Sadly, no backups of prefs on this current install.
Moving prefs and restarting the service recreated prefs with partially populated data (version, identifiers, metrics). The libraries are still not available though.
make certain the plex runtime username (plex) has permission (rx) at each directory level (/mnt, /mnt/raid6tb) as well as owns /mnt/raid6tb/plexmediaserver)
So something has emptied the Preferences file twice since I got this working again. I’m not sure what exactly did this but restoring the file from backup brought the service back up.
I had a cron job to restart plex once a day which I have since removed. I haven’t noticed the prefs file be cleared since, but I cannot confirm this is the cause as restarting the service shouldn’t clear the file.