Issue starting Plex after migration to FreeNAS 11.2U3 with failed Plex v1.15 install

Server Version#:FreeNAS 11.2U3 / Plex 1.14.1.5488
Player Version#:N/A

I had my FreeNAS server running v9.10 with Plex v1.14.x, and attempted to install Plex v.1.15.x latest update via the PMS_Updater.sh script, which broke my Plex server and after reading various other posts here and elsewhere I attempted a few suggested fixes, which did not resolve my problem although I could use the PMS_Updater.sh with the Plex 1.14.x package to backout.

Eventually I downloaded the latest version of PMS_Updater.sh that was last updated about a month ago (and overwrote my older version of the script in the process) hoping it would fix the upgrade, but it didnt, and updating the script caused the additional issue of I could no longetr backout the update either, resulting in a broken Plex instance…

I bit the FreeNAS upgrade bullet, upgraded FreeNAS to v11.2U3, created a new iocage jail, used the default pkg install which installed Plex v1.14.1.5488. Test running that clean Plex instance works… I can get to it successfully via a browser. Access is via http only as I have not configured the Plex instance. Note that within the iocage jail, pkg update reports that the current installed plexmediaserver instance is the newest one available (v1.14.1.5488). Also note that the IP configured is exactly the same as the old FreeNAS v9.10 jail was using

I then stopped the Plex service, copied over the plexdata folder from the old v9.10 jail to the new iocage jail… . NOTE - this is the only copy/modification to the iocage jail I’ve done, restarted the Plex service, within the jail, and I cant access it via either http or https… nor is the server accessible via plex.tv or via any clients…

I therefore suspect that the v1.15.x update attempt from my FreeNAS 9.10 jail has modified something within the plexdata structure that my new iocage Plex instance of v1.14.1.5488 doesnt like, and I have not yet managed to identify what that is…

I can comment that the preferences.xml file and the /usr/local/etc/rc.d/plexmediaserver files appear (as far as I can tell) to be pointing at the v1.14 structure, not the v1.15 structure

If anyone can provide me a suggestion of what other files to look at, or what specific folder structures to look it, I’d appreciate it, or if I have to dump most of the contents of the plexdata folder, what are the critical DB files that I need to retain which contain the historic access data, Libraries, user permissions, etc so I dont have to restart from scratch.

To be honest I’m super confused with his post, particularly:

Prefrences.xml simply lives under the “plexdata” dir and doesn’t “point” anywhere… as long as its there, whatever version is installed will simply use it!

You can however use “rc.conf” to change the “plexdata” dir path… perhaps that’s what’s happening?

Can you please post the output of pkg info |grep plex and cat /etc/rc.conf | grep plex inside the new jail?

I’ve tried to manually restore the old plexdata folder from my old 9.10 Jail to my new iocage jail and have managed to work out that I appear to have a corrupted copy of “/Plex Media Server/Plug-in Support/Databases/com.plexapp.plugins.library.db-wal” because this is the only file from the old Plexdata structure that stops Plex from actually running when I copy it over from the old Jail… and I suspect its the one that contains all my actual Library data, because without it my Libraries are not showing up either when I’m using one from the basic install instead.

For reference sake, the old plexapp.plugins.library.db-wal file from the old FN 9.10 Jail has the following properties:
-rw-r–r-- 1 972 972 1496458096 Apr 2 23:47 com.plexapp.plugins.library.db-wal

The file in the iocage jail as the following properties
-rw-r–r-- 1 972 972 1350904 Apr 3 00:51 com.plexapp.plugins.library.db-wal

Note for date/time reference, I’m in Australia, so I’m GMT+11 at the moment.

In relation to

here’s the output from my iocage jail:
root@plexmediaserver:~ # pkg info | grep plex
plexmediaserver-plexpass-1.14.1.5488 Plex Media Server component

root@plexmediaserver:~ # cat /etc/rc.conf | grep plex
hostname=“plexmediaserver”
plexmediaserver_plexpass_enable=“YES”

Because I completely broke the install of Plex in the old 9.10 Jail and attempted reinstaling Plex via pkg install, it reverted to v 1.3.3.3148 (it was originally v1.14.1.5488 before I used the latest version of PMS_Updater.sh to attempt to upgrade to v 1.15.3.385 which broke it, leaving it in an unusable state and no option of backing out back to v1.14.1.5488 either).
The respective rc.conf file is as per below (note that although the Jails are different versions, they are both called the same name):

root@plexmediaserver:~ # cat /etc/rc.conf | grep plex
hostname=“plexmediaserver”
plexmediaserver_enable=YES
plexmedaiserver_plexpass_enable=“YES”

So now you have both plexmediaserver and plexmediaserver_plexpass installed? and running? (which will fail cause when the second attmepts to bind to port 32400 (and others) it would be able to do so, since something else is already listing to it!

I’ll be honest, this is messy :smiley:

But hopefully we can still fix it, provided you still have your “plexdata” dir intact from the old install.

You need to choose if you want to keep the plexmediaserver or plexmediaserver_plexpass port/pkg version, you can actually have both installed, in fact you can even point them to the same plexdata dir but you can not have both running!

In the previous installation do you recall if you were using one or the other?

If its FreeNAS the jail needs to use VNET for transcoding to work.

Check out PMS not sending transcoded files to clients

Mike, aware I can only have one instance running on port 32400, so I intentionally only have one running at a time (the old FN 9.10 Jail vs the FN 11.2 iocage Jail) when needed here to debug the problem, with the intention of eventually deleting the FN 9.10 jail once I can get the iocage jail working as a 100% replacement.

For the state I ended up in, yes I agree… it all started with using the PMS_Updater.sh on the FN 9.10 Jail installing v1.15.x. and ended up with breaking that jail completely

I intent to retain the iocage jail as a plexpass jail (always had plexpass, as I was using the plexpass version of the download tar.bz2’s from Plex’s site and installing using the old PMS_Updater.sh script.) Once I crashed my FN 9.10 instance with the updated PMS_Updater.,sh and the 1.1.15.x package, from memory I then attempted using pkg install to update, which put me back to v1.3.3 where that jail is now…

I’ve built the iocage as Plex Pass install via pkg install plexmediaserver-plexpass

Yup, already have VNET enabled on the iocage jail, but as I dont even have the Plex server up and running with my old Libraries imported yet I’m not worried about transcoding atm.

So about pkg if it put it back to an older version then your’e not using the “latest” repo for pkgng, look in /etc/pkg/repo/FreeBSD.conf make sure its set to latest.

Regardless 1.13.x should just work, 1.15 introduced some changes in the build system, we now also need less deps, we also ship all libs in the same place etc and this needed fixing in the rc.d script, but this was addressed in the port and should be fixed, so if you’re using latest you should get a working install.

I dont have the repo folder at all, only /etc/rc.conf exists (/etc/pkg only contains a FreeBSD.conf file)
If you can provide what the contents of the /etc/pkg/repo/rc.conf file should be I’ll create it.

Hum it might actually be that one, I typed form head so I might be mistaken, apologies, the contents of the file should be obvious though, usually it defaults to quarterly rather then latest you just need to overwrite it.

Mike, I suspect your referring to the FreeBSD.conf file, as the rc.conf I do have doesnt contain anything about updates. The below is the two files in question

/etc/rc.conf

> *hostname="tautulli"*
> *cron_flags="$cron_flags -J 15"*
> 
> *# Disable Sendmail by default*
> *sendmail_enable="NO"*
> *sendmail_submit_enable="NO"*
> *sendmail_outbound_enable="NO"*
> *sendmail_msp_queue_enable="NO"*
> 
> *# Run secure syslog*
> *syslogd_flags="-c -ss"*
> 
> *# Enable IPv6*
> *ipv6_activate_all_interfaces="YES"*
> *tautulli_enable="YES"*
> *tautulli_flags="--datadir /config"*
````Preformatted text`


/etc/pkg/FreeBSD.conf
> *# $FreeBSD: releng/11.2/etc/pkg/FreeBSD.conf 333474 2018-05-10 23:58:33Z gjb $*
> *#*
> *# To disable this repository, instead of modifying or removing this file,*
> *# create a /usr/local/etc/pkg/repos/FreeBSD.conf file:*
> *#*
> *#   mkdir -p /usr/local/etc/pkg/repos*
> *#   echo "FreeBSD: { enabled: no }" > /usr/local/etc/pkg/repos/FreeBSD.conf*
> *#*
> 
> *FreeBSD: {*
> *  url: "pkg+http://pkg.FreeBSD.org/${ABI}/quarterly",*
> *  mirror_type: "srv",*
> *  signature_type: "fingerprints",*
> *  fingerprints: "/usr/share/keys/pkg",*
> *  enabled: yes*

I never said it was the rc.conf, Its was just a typo in the path, instead of /etc/pkg/repo/FreeBSD.conf its /etc/pkg/FreeBSD.conf but the files was always named FreeBSD.conf

replace quarterly for latest there and the run pkg update & pkg upgrade

You should see a newer version

Yup did this and then had the following errors occur

root@plexmediaserver:/etc/pkg # pkg update & pkg upgrade
[1] 82156
Updating FreeBSD repository catalogue…
Updating FreeBSD repository catalogue…
pkg: pkg: Repository FreeBSD has a wrong packagesite, need to re-create databaseRepository FreeBSD has a wrong packagesite, need to re-create database

[plexmediaserver] Fetching meta.txz: 100% 940 B 0.9kB/s 00:01
[plexmediaserver] Fetching meta.txz: 100% 940 B 0.9kB/s 00:01
[plexmediaserver] Fetching packagesite.txz: 100% 6 MiB 1.3MB/s 00:05 gesite.txz: 0%
[plexmediaserver] Fetching packagesite.txz: 100% 6 MiB 1.1MB/s 00:06
Processing entries: 100%Processing entries: 0%
FreeBSD repository update completed. 31960 packages processed.
Processing entries: 96%pkg: sqlite error while executing DROP TABLE repo_update; in file pkgdb.c:2406: attempt to write a readonly database
All repositories are up to date.
Processing entries: 100%
FreeBSD repository update completed. 31960 packages processed.
pkg: sqlite error while executing RELEASE SAVEPOINT REPO in file pkgdb.c:1258: disk I/O error
Unable to update repository FreeBSD
Error updating repositories!
[1] + Done pkg update

Attempted to rerun the command again in case the first one fixed part of the problem, and ended up with the following additional data

root@plexmediaserver:/etc/pkg # pkg update & pkg upgrade
[1] 82168
Updating FreeBSD repository catalogue…
Updating FreeBSD repository catalogue…
pkg: pkg: Repository FreeBSD load error: access repo file(/var/db/pkg/repo-FreeBSD.sqlite) failed: No such file or directoryRepository FreeBSD load error: access repo file(/var/db/pkg/repo-FreeBSD.sqlite) failed: No such file or directory

[plexmediaserver] Fetching meta.txz: 100% 940 B 0.9kB/s 00:01
[plexmediaserver] Fetching meta.txz: 100% 940 B 0.9kB/s 00:01
[plexmediaserver] Fetching packagesite.txz: 100% 6 MiB 1.3MB/s 00:05 gesite.txz: 0%
[plexmediaserver] Fetching packagesite.txz: 100% 6 MiB 1.3MB/s 00:05
pkg: sqlite error while executing CREATE TABLE packages (id INTEGER PRIMARY KEY,origin TEXT,name TEXT NOT NULL,version TEXT NOT NULL,comment TEXT NOT NULL,desc TEXT NOT NULL,osversion TEXT,arch TEXT NOT NULL,maintainer TEXT NOT NULL,www TEXT,prefix TEXT NOT NULL,pkgsize INTEGER NOT NULL,flatsize INTEGER NOT NULL,licenselogic INTEGER NOT NULL,cksum TEXT NOT NULL,path TEXT NOT NULL,pkg_format_version INTEGER,manifestdigest TEXT NULL,olddigest TEXT NULL,dep_formula TEXT NULL,vital INTEGER NOT NULL DEFAULT 0);CREATE TABLE deps (origin TEXT,name TEXT,version TEXT,package_id INTEGER REFERENCES packages(id) ON DELETE CASCADE ON UPDATE CASCADE,UNIQUE(package_id, name));CREATE TABLE categories (id INTEGER PRIMARY KEY, name TEXT NOT NULL UNIQUE );CREATE TABLE pkg_categories (package_id INTEGER REFERENCES packages(id) ON DELETE CASCADE ON UPDATE CASCADE,category_id INTEGER REFERENCES categories(id) ON DELETE RESTRICT ON UPDATE RESTRICT,UNIQUE(package_id, category_id));CREATE TABLE licenses (id INTEGER PRIMARY KEY,name TEXT NOT NULL UNIQUE);CREATE TABLE pkg_licenses (package_id INTEGER REFERENCES packages(id) ON DELETE CASCADE ON UPDATE CASCADE,license_id INTEGER REFERENCES licenses(id) ON DELETE RESTRICT ON UPDATE RESTRICT,UNIQUE(package_id, license_id));CREATE TABLE option (option_id INTEGER PRIMARY KEY,option TEXT NOT NULL UNIQUE);CREATE TABLE option_desc (option_desc_id INTEGER PRIMARY KEY,option_desc TEXT NOT NULL UNIQUE);CREATE TABLE pkg_option (package_id INTEGER NOT NULL REFERENCES packages(id) ON DELETE CASCADE ON UPDATE CASCADE,option_id INTEGER NOT NULL REFERENCES option(option_id) ON DELETE RESTRICT ON UPDATE CASCADE,value TEXT NOT NULL,PRIMARY KEY(package_id, option_id));CREATE TABLE pkg_option_desc (package_id INTEGER NOT NULL REFERENCES packages(id) ON DELETE CASCADE ON UPDATE CASCADE,option_id INTEGER NOT NULL REFERENCES option(option_id) ON DELETE RESTRICT ON UPDATE CASCADE,option_desc_id INTEGER NOT NULL REFERENCES option_desc(option_desc_id) ON DELETE RESTRICT ON UPDATE CASCADE,PRIMARY KEY(package_id, option_id));CREATE TABLE pkg_option_default (package_id INTEGER NOT NULL REFERENCES packages(id) ON DELETE CASCADE ON UPDATE CASCADE,option_id INTEGER NOT NULL REFERENCES option(option_id) ON DELETE RESTRICT ON UPDATE CASCADE,default_value TEXT NOT NULL,PRIMARY KEY(package_id, option_id));CREATE TABLE shlibs (id INTEGER PRIMARY KEY,name TEXT NOT NULL UNIQUE );CREATE TABLE pkg_shlibs_required (package_id INTEGER NOT NULL REFERENCES packages(id) ON DELETE CASCADE ON UPDATE CASCADE,shlib_id INTEGER NOT NULL REFERENCES shlibs(id) ON DELETE RESTRICT ON UPDATE RESTRICT,UNIQUE(package_id, shlib_id));CREATE TABLE pkg_shlibs_provided (package_id INTEGER NOT NULL REFERENCES packages(id) ON DELETE CASCADE ON UPDATE CASCADE,shlib_id INTEGER NOT NULL REFERENCES shlibs(id) ON DELETE RESTRICT ON UPDATE RESTRICT,UNIQUE(package_id, shlib_id));CREATE TABLE annotation (annotation_id INTEGER PRIMARY KEY,annotation TEXT NOT NULL UNIQUE);CREATE TABLE pkg_annotation (package_id INTERGER REFERENCES packages(id) ON DELETE CASCADE ON UPDATE RESTRICT,tag_id INTEGER NOT NULL REFERENCES annotation(annotation_id) ON DELETE CASCADE ON UPDATE RESTRICT,value_id INTEGER NOT NULL REFERENCES annotation(annotation_id) ON DELETE CASCADE ON UPDATE RESTRICT,UNIQUE (package_id, tag_id));CREATE TABLE pkg_conflicts (package_id INTEGER NOT NULL REFERENCES packages(id) ON DELETE CASCADE ON UPDATE CASCADE,conflict_id INTEGER NOT NULL,UNIQUE(package_id, conflict_id));CREATE TABLE provides( id INTEGER PRIMARY KEY, provide TEXT NOT NULL);CREATE TABLE pkg_provides (package_id INTEGER NOT NULL REFERENCES packages(id) ON DELETE CASCADE ON UPDATE CASCADE,provide_id INTEGER NOT NULL REFERENCES provides(id) ON DELETE RESTRICT ON UPDATE RESTRICT,UNIQUE(package_id, provide_id));CREATE TABLE requires( id INTEGER PRIMARY KEY, require TEXT NOT NULL);CREATE TABLE pkg_requires (package_id INTEGER NOT NULL REFERENCES packages(id) ON DELETE CASCADE ON UPDATE CASCADE,require_id INTEGER NOT NULL REFERENCES requires(id) ON DELETE RESTRICT ON UPDATE RESTRICT,UNIQUE(package_id, require_id));PRAGMA user_version=2014; in file pkgdb.c:2406: attempt to write a readonly database
Unable to create repository FreeBSD
pkg: sqlite error while executing CREATE TABLE packages (id INTEGER PRIMARY KEY,origin TEXT,name TEXT NOT NULL,version TEXT NOT NULL,comment TEXT NOT NULL,desc TEXT NOT NULL,osversion TEXT,arch TEXT NOT NULL,maintainer TEXT NOT NULL,www TEXT,prefix TEXT NOT NULL,pkgsize INTEGER NOT NULL,flatsize INTEGER NOT NULL,licenselogic INTEGER NOT NULL,cksum TEXT NOT NULL,path TEXT NOT NULL,pkg_format_version INTEGER,manifestdigest TEXT NULL,olddigest TEXT NULL,dep_formula TEXT NULL,vital INTEGER NOT NULL DEFAULT 0);CREATE TABLE deps (origin TEXT,name TEXT,version TEXT,package_id INTEGER REFERENCES packages(id) ON DELETE CASCADE ON UPDATE CASCADE,UNIQUE(package_id, name));CREATE TABLE categories (id INTEGER PRIMARY KEY, name TEXT NOT NULL UNIQUE );CREATE TABLE pkg_categories (package_id INTEGER REFERENCES packages(id) ON DELETE CASCADE ON UPDATE CASCADE,category_id INTEGER REFERENCES categories(id) ON DELETE RESTRICT ON UPDATE RESTRICT,UNIQUE(package_id, category_id));CREATE TABLE licenses (id INTEGER PRIMARY KEY,name TEXT NOT NULL UNIQUE);CREATE TABLE pkg_licenses (package_id INTEGER REFERENCES packages(id) ON DELETE CASCADE ON UPDATE CASCADE,license_id INTEGER REFERENCES licenses(id) ON DELETE RESTRICT ON UPDATE RESTRICT,UNIQUE(package_id, license_id));CREATE TABLE option (option_id INTEGER PRIMARY KEY,option TEXT NOT NULL UNIQUE);CREATE TABLE option_desc (option_desc_id INTEGER PRIMARY KEY,option_desc TEXT NOT NULL UNIQUE);CREATE TABLE pkg_option (package_id INTEGER NOT NULL REFERENCES packages(id) ON DELETE CASCADE ON UPDATE CASCADE,option_id INTEGER NOT NULL REFERENCES option(option_id) ON DELETE RESTRICT ON UPDATE CASCADE,value TEXT NOT NULL,PRIMARY KEY(package_id, option_id));CREATE TABLE pkg_option_desc (package_id INTEGER NOT NULL REFERENCES packages(id) ON DELETE CASCADE ON UPDATE CASCADE,option_id INTEGER NOT NULL REFERENCES option(option_id) ON DELETE RESTRICT ON UPDATE CASCADE,option_desc_id INTEGER NOT NULL REFERENCES option_desc(option_desc_id) ON DELETE RESTRICT ON UPDATE CASCADE,PRIMARY KEY(package_id, option_id));CREATE TABLE pkg_option_default (package_id INTEGER NOT NULL REFERENCES packages(id) ON DELETE CASCADE ON UPDATE CASCADE,option_id INTEGER NOT NULL REFERENCES option(option_id) ON DELETE RESTRICT ON UPDATE CASCADE,default_value TEXT NOT NULL,PRIMARY KEY(package_id, option_id));CREATE TABLE shlibs (id INTEGER PRIMARY KEY,name TEXT NOT NULL UNIQUE );CREATE TABLE pkg_shlibs_required (package_id INTEGER NOT NULL REFERENCES packages(id) ON DELETE CASCADE ON UPDATE CASCADE,shlib_id INTEGER NOT NULL REFERENCES shlibs(id) ON DELETE RESTRICT ON UPDATE RESTRICT,UNIQUE(package_id, shlib_id));CREATE TABLE pkg_shlibs_provided (package_id INTEGER NOT NULL REFERENCES packages(id) ON DELETE CASCADE ON UPDATE CASCADE,shlib_id INTEGER NOT NULL REFERENCES shlibs(id) ON DELETE RESTRICT ON UPDATE RESTRICT,UNIQUE(package_id, shlib_id));CREATE TABLE annotation (annotation_id INTEGER PRIMARY KEY,annotation TEXT NOT NULL UNIQUE);CREATE TABLE pkg_annotation (package_id INTERGER REFERENCES packages(id) ON DELETE CASCADE ON UPDATE RESTRICT,tag_id INTEGER NOT NULL REFERENCES annotation(annotation_id) ON DELETE CASCADE ON UPDATE RESTRICT,value_id INTEGER NOT NULL REFERENCES annotation(annotation_id) ON DELETE CASCADE ON UPDATE RESTRICT,UNIQUE (package_id, tag_id));CREATE TABLE pkg_conflicts (package_id INTEGER NOT NULL REFERENCES packages(id) ON DELETE CASCADE ON UPDATE CASCADE,conflict_id INTEGER NOT NULL,UNIQUE(package_id, conflict_id));CREATE TABLE provides( id INTEGER PRIMARY KEY, provide TEXT NOT NULL);CREATE TABLE pkg_provides (package_id INTEGER NOT NULL REFERENCES packages(id) ON DELETE CASCADE ON UPDATE CASCADE,provide_id INTEGER NOT NULL REFERENCES provides(id) ON DELETE RESTRICT ON UPDATE RESTRICT,UNIQUE(package_id, provide_id));CREATE TABLE requires( id INTEGER PRIMARY KEY, require TEXT NOT NULL);CREATE TABLE pkg_requires (package_id INTEGER NOT NULL REFERENCES packages(id) ON DELETE CASCADE ON UPDATE CASCADE,require_id INTEGER NOT NULL REFERENCES requires(id) ON DELETE RESTRICT ON UPDATE RESTRICT,UNIQUE(package_id, require_id));PRAGMA user_version=2014; in file pkgdb.c:2406: disk I/O error
Unable to create repository FreeBSD
Unable to update repository FreeBSD
Error updating repositories!
Unable to update repository FreeBSD
Error updating repositories!

The first one looked to be due to pkg already being in use and locking the database… But the other looks more concerning, however it is problem with your env so might find better help in freebsd / freenas forums.

In alternative you could start new jail and update the repo configuration on that one.

I am also currently doing the exact same thing. I found this thread:

I basically installed the new freenas 11.2 then installed plex plugin gave it static ip, vlan enabled, default router (or gateway) put in, and checked allowed raw sockets box. And mounted the media.

Then I followed the first command on there to copy the ‘Plex Media Server’ folder over to the new installation.

Then I noticed there was an update available via the gui and clicking the update didn’t do anything but just show ‘update successful’ but it didn’t actually do anything.

I then proceeded to bork the whole thing following a rabbit hole of googling and trying different things. I’m currently back to square one.

Did you figure out how to do it? And If so is it easily updated through freenas. I like linux but it can be a mess to fool with and I like things to be easy.

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