iocage and moving plex issues

mrgtstr

Dabbler
Joined
Jun 15, 2016
Messages
25
I have been trying to move my plex server from one freenas box to another and getting to the point to where I need to walk away and have a fresh set of eyes on what I am missing. I am able to get my plex server moved successfully and running until I restart the plex service. Once I restart the service I am able to select my user but then it starts the setup wizard and is unable to find my plex server. The media user has full permissions to the mount points and I am on 11.3-U3.2 and the iocage jail is 11.3. Below are the jail settings that I used from Pentaflake.

Code:
echo '{"pkgs":["git","nano","wget","plexmediaserver-plexpass","ca_root_nss"]}' > /tmp/pkg.json
iocage create -n "plex" -p /tmp/pkg.json -r 11.3-RELEASE ip4_addr="vnet0|172.31.1.90/24" defaultrouter="172.31.1.1" vnet="on" allow_raw_sockets="1" boot="on"
rm /tmp/pkg.json

iocage exec plex "mkdir -p /mnt/media"
iocage exec plex "mkdir -p /mnt/config/plex"

iocage fstab -a plex "/mnt/cargo/media  /mnt/media  nullfs  rw  0  0"
iocage fstab -a plex "/mnt/cargo/apps/plex  /mnt/config/plex  nullfs  rw  0  0"

iocage exec plex "mkdir -p /usr/local/etc/pkg/repos"
iocage exec plex "nano /usr/local/etc/pkg/repos/FreeBSD.conf"
###################################################################################################
FreeBSD: {
  url: "pkg+http://pkg.FreeBSD.org/${ABI}/latest",
  mirror_type: "srv",
  signature_type: "fingerprints",
  fingerprints: "/usr/share/keys/pkg",
  enabled: yes
}
###################################################################################################

iocage exec plex "pkg update && pkg upgrade -y"

iocage exec plex "pw useradd -n media -u 816 -d /nonexistent -s /usr/bin/nologin"

iocage exec plex sysrc plexmediaserver_plexpass_enable="YES"
iocage exec plex sysrc plexmediaserver_plexpass_user="media"
iocage exec plex sysrc plexmediaserver_plexpass_support_path="/mnt/config/plex/plexdata-plexpass"

iocage exec plex service plexmediaserver_plexpass start
 

mrgtstr

Dabbler
Joined
Jun 15, 2016
Messages
25
I just found some errors related to permissions and have fixed them but some of the items in the cache folder reset themselves after I change them....

/usr/local/share/plexmediaserver-plexpass/Plex_Media_Server
Jun 21, 2020 18:09:23.786 [0x80ba18000] ERROR - Error reading file ["/mnt/config/plex/plexdata-plexpass/Plex Media Server/Preferences.xml"].
Jun 21, 2020 18:09:23.792 [0x80ba18000] DEBUG - BPQ: [Idle] -> [Starting]
Jun 21, 2020 18:09:23.793 [0x80ba18000] DEBUG - FeatureManager: Using cached data for features list
Jun 21, 2020 18:09:23.793 [0x80ba18000] ERROR - Error reading file ["/mnt/config/plex/plexdata-plexpass/Plex Media Server/Cache/Flags.dat"].
Jun 21, 2020 18:09:23.793 [0x80ba18000] ERROR - Error parsing content.
Jun 21, 2020 18:09:23.793 [0x80ba18000] ERROR - Error parsing XML: Error parsing file.
 

Samuel Tai

Never underestimate your own stupidity
Moderator
Joined
Apr 24, 2020
Messages
5,398
Did you create the media user outside the jail, and set the appropriate permissions for the out-of-jail media user to access the config directory?
 

Samuel Tai

Never underestimate your own stupidity
Moderator
Joined
Apr 24, 2020
Messages
5,398
Does the media user have the correct uid/gid?
 

mrgtstr

Dabbler
Joined
Jun 15, 2016
Messages
25
Yes...I have plex running as the media user and using 816 for the uid/gid. The mount points have the same uid/gid.
 

Spiceman

Dabbler
Joined
Oct 4, 2017
Messages
24
From the little knowledge I have I see you created your config folder:
Code:
iocage exec plex "mkdir -p /mnt/config/plex"


Then you mounted it with:
Code:
iocage fstab -a plex "/mnt/cargo/apps/plex  /mnt/config/plex  nullfs  rw  0  0"


Then you tell it to use a different support path:
Code:
iocage exec plex sysrc plexmediaserver_plexpass_support_path="/mnt/config/plex/plexdata-plexpass"


Should that path not have been?:
Code:
iocage exec plex sysrc plexmediaserver_plexpass_support_path="/mnt/config/plex”
 

mrgtstr

Dabbler
Joined
Jun 15, 2016
Messages
25
From the little knowledge I have I see you created your config folder:
Code:
iocage exec plex "mkdir -p /mnt/config/plex"


Then you mounted it with:
Code:
iocage fstab -a plex "/mnt/cargo/apps/plex  /mnt/config/plex  nullfs  rw  0  0"


Then you tell it to use a different support path:
Code:
iocage exec plex sysrc plexmediaserver_plexpass_support_path="/mnt/config/plex/plexdata-plexpass"


Should that path not have been?:
Code:
iocage exec plex sysrc plexmediaserver_plexpass_support_path="/mnt/config/plex”


My thought process (not sure if its right) is the /mnt/config/plex is the "root" folder. So anything within that folder is viewable. The support path is where the actual plex data is. I can make adjustments to see, but I believe I will get the same results.
 

hertzsae

Contributor
Joined
Sep 23, 2014
Messages
118
I mount to /config and have /config set as my support path. When I do an "ls" on /config, I have two directories. Plex which is empty and "Plex Media Server" which has the following subdirectories:
Cache Logs Plug-ins Thumbnails
Codecs Media Preferences.xml
Diagnostics Metadata Preferences.xml.backup
Library Plug-in Support Scanners

Mounting at any directory below where your support path seems silly to me, but that shouldn't cause issues. With your current settings, I would just make sure that your "/mnt/config/plex/plexdata-plexpass" directory has a subfolder called "Plex Media Server" that has some of the same subdirectories as mine.
 

mrgtstr

Dabbler
Joined
Jun 15, 2016
Messages
25
Here is my directory list....For a peace of mind, I will set the mount path and the support path the same and see what happens but have my suspicions.

root@plex:~ # ls /mnt/config/plex/plexdata-plexpass/
Plex Plex Media Server
 

mrgtstr

Dabbler
Joined
Jun 15, 2016
Messages
25
I made the mount point and the support directory the same and still getting the same result...
 

mrgtstr

Dabbler
Joined
Jun 15, 2016
Messages
25
I decided to get rid of the support directory and use the default location and still getting the same result. Here are my log files in case anyone is interested. I haven't found anything obvious.
 

Attachments

  • Logs.zip
    1.9 MB · Views: 243

mrgtstr

Dabbler
Joined
Jun 15, 2016
Messages
25
I am still having issues on moving my plex server from on freenas box to another. I can get it moved and working until I either restart the plex service or the iocage jail. Its seems like the permissions get change when the service restarts as well. Any help would be appreciated.
 
Top