Plex service will not start

Server Version#: 1.18.3.2156-349e9837e_amd64
Player Version#:

https://pastebin.com/jMgeNkSq
https://pastebin.com/1dU7CWMm
https://pastebin.com/7jSMAmqj

Rebooted system, changed ownership of /var/lib/plexmediaserver recursively to plex:plex, reinstalling the latest release, and an old release. The install seems to stop prematurely but does not give any output as to why.tmtoreylogs.zip (4.3 MB)

ZIP the Logs directory and attach here please.

tmtoreylogs.zip (4.3 MB)

Hi Chuck,

I’ve uploaded the logs as requested. There may be some different errors now. I have since tried: ā€œsudo apt-get purge --auto-remove plexmediaserverā€ and then reinstalling the latest release. It would then start the service but with a new server awaiting to be setup. I tried restoring a backup of my ā€œ/var/lib/plexmediaserverā€ but as soon as I do that it fails to boot again. Appreciate the assistance as I’ve been tinkering for a couple hours now and haven’t got anywhere with it.

Thanks for the log.

What has been done here please?

The current log is Linux, All the rollover logs are from 2016 and Windows.

Mar 25, 2016 23:38:43:950 [2152] INFO - Plex Media Server v0.9.15.6.1714-7be11e1 - Microsoft PC  - build: windows-i386 english
Mar 25, 2016 23:38:43:951 [2152] INFO - Windows version: 6.3 (Build 9600), language en-US

vs

Dec 25, 2019 18:52:46.367 [0x7fb3a7cbc700] INFO - Plex Media Server v1.16.5.1554-1e5ff713d - Ubuntu PC x86_64 - build: linux-x86_64 debian - GMT -07:00
Dec 25, 2019 18:52:46.367 [0x7fb3a7cbc700] INFO - Linux version: 18.04.3 LTS (Bionic Beaver), language: en-US
Dec 25, 2019 18:52:46.367 [0x7fb3a7cbc700] INFO - Processor Intel(R) Xeon(R) CPU E3-1231 v3 @ 3.40GHz

I was a bit confused by that as well. Back in 2016 I copied my Plex folder from Windows to Linux, and have since gone through distro upgrades, but it has been working flawlessly from that point up until today when I tried updating to the new version while it was still running. Is there another location that would have the linux only logs?

Did you move the Plex metadata directory to somewhere other than /var/lib/plexmediaserver/Library/Application Support ?

My concerns are:

ā€œsudo apt-get purge --auto-remove plexmediaserverā€

If this is done with the new package (build 2175) then any pre-existing metadata will indeed be gone. ā€˜purge’ now functions as it should which means it removed Plex’s home directory ( /var/lib/plexmediaserver ). Previously, full purge was dependent on Debian/Ubuntu version.

I did not move the Metadata to my knowledge. I can still see the directory in the /var/lib/plexmediaserver location. It doesn’t appear to be complete as it has folders 0-f listed but nothing else. The odd thing is that I moved it to an alternate location before doing the purge/removal so it should not have been touched. After the purge/remove and re-install it worked fine, but then broke as soon as I moved my old plex folder in place of the new /var/lib/plexmediaserver.

If you really did move your Windows backup into it, which is what the 2016 dated logs appear to be, then I regret to inform you that backups from 0.9.15.x are too old to jump forward. The database will be missing so much data it won’t be functional.

At this point, I recommend starting fresh but keeping the old backups. We might be able to bring some of the Watch history (if you still have that same media in your new Library)

I’m confused, anything to do with windows was done in 2016. I backed up my ā€œ/var/lib/plexmediaserverā€ today to a separate directory. Then moved it back in place after I did the uninstall/reinstall. I’m not sure why the logs are so messed up but the plexmediaserver directory was all working fine until a few hours ago.

Was it working before or after you did the ā€œapt-get purgeā€ ?

If before, did you backup anything before purging?

The history of working state was:
Working basically forever.
Forgot to stop the plex service then installed latest release. Stopped service and it would not start again. So not working.
Tinkered couldn’t get it to work.
Moved my /var/lib/plexmediaserver to a new directory and then did a purge, installed latest release again and it worked.
I then did a /var/lib/plexmediaserver.new.bak and moved my old plexmediaserver back in place. Stopped working again.

I can verify it’s my old version of the directory since it’s 21GB.
After the purge my /usr/lib/plexmediaserver directory seems untouched if that makes any sense.

Perhaps the one thing we’re both overlooking?

UID/GID of the new /var/lib/plexmediaserver directory?
(ls -la)

Did the UID/GID of plex:plex change?
With a ā€œpurgeā€, the username is deleted. When added back, it can get a new UID/GID pair.

It looks like they stayed the same.

[torey][toreyserver] $ ls -n | grep plex
56:drwxr-xr-x 4 122 129 4096 Dec 25 20:24 plexmediaserver
57:drwxr-xr-x 3 122 129 4096 Dec 25 19:32 plex.new.old

check inside. ls -la … verify the name comes up correctly because it’s launched by name, not numeric UID.

The owner and group recursively are all plex.

[torey][toreyserver] $ ls -la | grep plex
58:drwxr-xr-x 4 plex plex 4096 Dec 25 20:24 plexmediaserver
59:drwxr-xr-x 3 plex plex 4096 Dec 25 19:32 plex.new.old

I don’t know what you did.

With it moved back (this now the current – pre failure ). Please grab a tar.gz of that Logs directory. It will contain previous and the startup attempts.

Here are the latest Logs.zip (4.3 MB)

Thanks… now it shows. Database is corrupt.

Dec 25, 2019 22:07:47.705 [0x7fe61de5eb80] ERROR - SQLITE3:(nil), 11, database corruption at line 65066 of [bf8c1b2b7a]
Dec 25, 2019 22:07:47.705 [0x7fe61de5eb80] ERROR - SQLITE3:(nil), 11, statement aborts at 10: [select max(max(metadata_items.changed_at),max(metadata_items.resources_changed_at)) from metadata_items] database disk image is malformed
Dec 25, 2019 22:07:47.706 [0x7fe61de5eb80] ERROR - Database corruption: sqlite3_statement_backend::loadOne: database disk image is malformed
Dec 25, 2019 22:07:47.706 [0x7fe61de5eb80] ERROR - Error: Unable to set up server: sqlite3_statement_backend::loadOne: database disk image is malformed (N4soci10soci_errorE)

Copy the most recent backup com.plexapp.plugins.library.db-backup.-xxxxxx
to be com.plexapp.plugins.library.db

make certain to set ownership to plex:plex

1 Like

Awesome! All I had to do was rename it like you said and then update the permissions to 775 and it started right up. I find it odd that the latest backups were something like 11/1, 11/4, 11/7, 11/10, then it stopped. Nothing from 11/10 to 12/25.

I greatly appreciate your help though. I saw that most of the cases I was looking for when trying to solve my issue you were the one helping them out as well.