Plex won't run anymore

Hello,

I’m currently going from Windows 7 to Pop OS 19.10 (Ubuntu) and I’m having some issues. At first Plex was at least running. I ended up killing the service by doing ‘sudo service plexmediaserver stop’. After doing so I started moving over my Windows DB files. The folders that were moved from Windows to Linux were: Media, Metadata and Plug-ins Support. Data in folders ‘Plug-ins Support/Data’ and ‘Plug-ins Support/Caches’ were deleted before moving over to ‘/var/lib/plexmediaserver/Library Application Support/Plex Media Server’.

I had read that I would need to edit my Preferences.xml on Ubuntu to match what I had on my windows machine so that it wouldn’t cause issues. Using my registry backup as reference, I replaced: MachineIdentifier, ProcessedMachineIdentifier, AnonymousMachineIdentifier and CertificateUUID to match what was in my Windows registry. I then started up PMS and tried to go to 127.0.0.1:32400/web and it says it’s unable to connect. Looking at my processes ‘ps -A | grep plex’ I don’t see PMS running. Any help would be greatly appreciated because my only other option would be reinstalling the OS and losing hours of work. Someone please help?

First. In the official sense. Pop OS isn’t supported. If it runs, great. Ubuntu & Debian are supported. Pop is in the same category as Mint and other Debian derivatives.

Now, for the problem, manually grab a tar.gz of the Logs directory and attach it here.

Hi ChuckPa,

Thanks for the help again. I do remember you saying that Pop OS isn’t supported and I understand and appreciate your help.logs.tar.gz (56.2 KB)

Please let me know if there is anything else you may need. =)

The database is corrupt. When you moved from Windows, did you move everything protected in a ZIP or did you do something like copy? Did Linux go PULL the files or did windows PUSH the files? If Windows did the “pushing”, you’ve found the problem.

Mar 07, 2020 21:08:26.695 [0x7faade526b80] DEBUG - FeatureManager: Using cached data for features list
Mar 07, 2020 21:08:26.695 [0x7faade526b80] DEBUG - Opening 20 database sessions to library (com.plexapp.plugins.library), SQLite 3.26.0, threadsafe=1
Mar 07, 2020 21:08:26.695 [0x7faade526b80] INFO - SQLITE3:(nil), 283, recovered 3 frames from WAL file /var/lib/plexmediaserver/Library/Application Support/Plex Media Server/Plug-in Support/Databases/com.plexapp.plugins.library.db-wal
Mar 07, 2020 21:08:26.695 [0x7faade526b80] ERROR - SQLITE3:(nil), 11, database corruption at line 66053 of [bf8c1b2b7a]
Mar 07, 2020 21:08:26.695 [0x7faade526b80] ERROR - SQLITE3:(nil), 11, database disk image is malformed in "PRAGMA cache_size=2000"
Mar 07, 2020 21:08:26.696 [0x7faade526b80] ERROR - Database corruption: sqlite3_statement_backend::prepare: database disk image is malformed for SQL: PRAGMA cache_size=2000
Mar 07, 2020 21:08:26.696 [0x7faade526b80] ERROR - Error: Unable to set up server: sqlite3_statement_backend::prepare: database disk image is malformed for SQL: PRAGMA cache_size=2000 (N4soci10soci_errorE)

Bummer… I copied the folders from windows to an external HDD. I tried to zip it, but after letting winrar sit for over an hour and not do any zipping due to size I stopped it and just copied the folders to the external HDD. In the process of moving the files to linux, I plugged in my external HDD into my linux machine and copied the folders from my external HDD to the correct path in linux.

Is there a way I could possibly login to sqlite3 and fix the corrupt DB?

No. If it’s damaged as it’s trying to read the headers, it is beyond repair.

are there any database backup files (dated) ones in there?

This is not sounding good at all… Does this mean I won’t be able to recover anything and will need to start plex from scratch?

There are quite a few DB files with dates. I’ve included a screen shot of the folder.
SS DB

Will I at least be able to still use plex somehow instead of reinstalling the OS? I wish I knew where things went wrong so I can avoid them in the future.

You have DB backups. There’s a chance.

  1. Manually invoke SQLite3 to perform an integrity check of each file (except the SHM and WAL)
  2. If any of the com.plexapp.plugins.library.db.XXXXX pass, then you stand a chance of copying that (on Linux) and overwrite com.plexapp.plugins.library.db .
  3. Don’t forget to make the db owned by plex:plex

If PMS starts successfully,

For each library section (one section at a time before advancing to the next):

  1. Scan files
  2. Refresh all metadata
  3. Empty Trash
  4. Clean Bundles

When complete, all sections will be in sync (metadata & db)

I went ahead and installed SQLite3, but I’m having troubles figuring out how to perform the integrity check. This is getting painful and time consuming. I’m wondering if it will be quicker to start from scratch. Getting plex to see the external HDD with the media is a whole other issue I have to tackle. =(

As an update. I was able to get plex up and running again. I noticed after uninstalling plex the folder /var/lib/plexmediaserver was still there. I figured it was probably causing issues for whatever I messed up earlier. I deleted that folder and then moved over everything and PMS shows all of my previous stuff from windows. I am now in the process of reading this thread Extremely Frustrated About Permissions and this thread Linux Tips

I’m not master at linux and I’m still learning something new every day. Permissions are not my strong suit and will probably mess this up. From reading it appears that plex won’t be able to access the HDD because once it’s mounted it will be mounted under my username at /media/username/HDD. I’m in the process of figuring out how to unmount it and have it mount somewhere else once it’s plugged in to do sudo chown -R plex:plex /disk/HDD.

If you follow my How-To,

I show in my How-To (at step D)

# See where the disks are currently mounted and unmount
df
umount /run/media/chuck/Media-3
umount /run/media/chuck/Chuck2T

On Ubuntu / Debian, these will be under /media/<username>

simply sudo umount /media/username/diskname
If it complains about being in use, close the File Manager (Nautilus)

Thanks for the reply. After creating the directory with sudo mkdir /disks/Plex and do sudo chown -R user:user /disks/Plex I notice my permissions look different than yours in your example. I wanted to check with you to make sure this is fine before I make the change in /etc/fstab. Even if I do sudo chmod 755 /disks/Plex the permissions for the folder doesn’t change from drwxr-xr-x

This is what I currently see for the permissions for /disks/Plex

user@pop-os:/$ sudo mkdir /disks/Plex
user@pop-os:/$ sudo chown -R user:user /disks/Plex
user@pop-os:/$ ls -la /disks
total 12
drwxr-xr-x  3 user user 4096 Mar  9 00:29 .
drwxr-xr-x 19 root root 4096 Mar  9 00:07 ..
drwxr-xr-x  2 user user 4096 Mar  9 00:29 Plex
user@pop-os:/$ sudo chmod 755 /disks/Plex

that is fine.

Now mount the USB drive by pathname (this tests the entry in /etc/fstab)

If there are errors, we need fix them in /etc/fstab

Looks like everything is working as intended as far as plex reaching the drive contents etc! Thank you so much for your help! There is 1 issue that I noticed (so far) and that deals with the certificate for 127.0.0.1:32400/web

When trying to go to https://127.0.0.1:32400/web I receive a certificate error saying the cert is insecure. I’ve included a screen shot of the issue and was wondering how would I go about making my connection secure? Would I need to somehow regenerate a new certificate for PMS to use?

Plex.direct – that’s the private domain Plex uses.

You have a cert on the box?

Not that I know of. Is there some sort of tutorial on how to add one and have plex use it?

plex.direct is a private domain which Plex overlays on top of any other domain defined for your lan.

The error message you posted implies that the host certificate already installed on the computer (which governs the machine itself) is at odds with the overlay.

FireFox doesn’t know of plex.direct (it doesn’t know about it out-of-the-box)

First, read up on these two support articles.
If these are not within your comfort zone and you fully understand
then I suggest considering adding a Firefox exception for domain plex.direct .

plex.direct is only applicable to the local lan. it’s non-routable on the internet (because your LAN is RFC-1918) … Is your LAN RFC-1918 compliant?

https://support.plex.tv/articles/?s=certificates&search=support_articles

Sorry about that. I thought it was using the cert to access the internet. I didn’t realize the cert was for my internal network. Yes my IP is 192.168.X.X
I’m just going to leave that alone if that’s just internally.

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