So I recently updated my freenas box to 1.15.2.793_1 and i now cant get to the server setup page

@mikec_pt

Mine is not a new install, I updated from 1.14 using ‘PMS_Updater.sh’ - maybe it has something to do with this script if that is the same thing others have been doing.

here is the contents of my /usr/local/etc/rc.d/plexmediaserver

#!/bin/sh                                                                       
# Created by: KalleDK <plexmaintainer@k-moeller.dk>                             
#                                                                               
# $FreeBSD: head/multimedia/plexmediaserver/files/plexmediaserver.in 409168 2016-02-19 11:41:13Z feld $                                                         
#                                                                               
# PROVIDE: plexmediaserver                                                      
# REQUIRE: LOGIN                                                                
# KEYWORD: shutdown                                                             
#                                                                               
# Add the following lines to /etc/rc.conf to enable the Plex Media Server:      
#                                                                               
# plexmediaserver_enable="YES"                                                  
#                                                                               
# plexmediaserver_support_path="/usr/pbi/plexmediaserver-amd64/plexdata" # Plex data: logs, media metadata, settings, etc                                       
#                                                                               
# plexmediaserver_tmp="/var/tmp/plex" # configure tmp directory used for the transcoding process if desired                                                     
#                                                                               
# plexmediaserver_maxplugins="6" # Maximum number of background plugin procs. May have to raise in rare cases.    
#                                                                               
                                                                                 
. /etc/rc.subr                                                                  
                                                                                
name=plexmediaserver                                                            
rcvar=plexmediaserver_enable                                                    
load_rc_config $name                                                            
                                                                                
: ${plexmediaserver_enable:=NO}                                                 
: ${plexmediaserver_support_path="/usr/pbi/plexmediaserver-amd64/plexdata"}     
: ${plexmediaserver_user="media"}                                               
: ${plexmediaserver_group="wheel"}                                              
: ${plexmediaserver_maxplugins=6}                                               
                                                                                
command=/usr/sbin/daemon                                                        
procname="/usr/pbi/plexmediaserver-amd64/share/plexmediaserver/Plex_Media_Server"                                                                               
command_args="-f ${procname}"                                                   
pidfile=/var/run/plex/plex.pid                                                  
start_precmd=plex_precmd                                                        
stop_precmd=plex_stop_precmd                                                    
stop_postcmd=plex_stop_postcmd  
                                                                                
plex_precmd()                                                                   
{                                                                               
        export TMPDIR="/tmp"                                                    
        export SUPPORT_PATH="${plexmediaserver_support_path}"                   
        export HOME="${plexmediaserver_support_path}/Plex Media Server"         
        export PYTHONHOME="/usr/pbi/plexmediaserver-amd64/share/plexmediaserver/Resources/Python"                                                               
        export SCRIPTPATH="/usr/pbi/plexmediaserver-amd64/share/plexmediaserver"
        export LD_LIBRARY_PATH="/usr/pbi/plexmediaserver-amd64/lib/compat:${SCRIPTPATH}"                                                                        
        export PLEX_MEDIA_SERVER_HOME="${SCRIPTPATH}"                           
        export PLEX_MEDIA_SERVER_MAX_PLUGIN_PROCS=${plexmediaserver_maxplugins} 
        export PLEX_MEDIA_SERVER_APPLICATION_SUPPORT_DIR=${plexmediaserver_support_path}                                                                        
        export PLEX_MEDIA_SERVER_PIDFILE=${pidfile}                             
        export PLEX_MEDIA_SERVER_LOG_DIR="${plexmediaserver_support_path}/Plex Media Server/Logs"                                                               
        export PATH="${SCRIPTPATH}/Resources/Python/bin:${PATH}"                
        export LC_ALL="en_US.UTF-8"                                             
        export LANG="en_US.UTF-8" 
        ulimit -s 3000                                                          
                                                                                
        if [ ! -d ${pidfile%/*} ]; then                                         
                install -d -o ${plexmediaserver_user} ${pidfile%/*};            
        fi                                                                      
                                                                                
        if [ ! -d "${plexmediaserver_support_path}/Plex Media Server" ]; then   
                install -d -g ${plexmediaserver_group} -o ${plexmediaserver_user
} "${plexmediaserver_support_path}/Plex Media Server";                          
        fi                                                                      
                                                                                
        if [ ${plexmediaserver_tmp} ]; then                                     
                export TMPDIR=${plexmediaserver_tmp};                           
                install -d -g ${plexmediaserver_group} -o ${plexmediaserver_user
} "${plexmediaserver_tmp}";                                                     
        fi                                                                      
}                                                                               
                                                                                
plex_stop_precmd()                                                              
{                                                                               
        if [ -r ${pidfile} ]; then    
                export _PLEXPID=$(check_pidfile ${pidfile} ${procname})         
        fi                                                                      
}                                                                               
                                                                                
plex_stop_postcmd()                                                             
{                                                                               
        _PLEX_CHILDREN=$(pgrep -g ${_PLEXPID})                                  
        echo "Cleaning up leftover child processes."                            
        kill $sig_stop ${_PLEX_CHILDREN}                                        
        wait_for_pids ${_PLEX_CHILDREN}                                         
}                                                                               
                                                                                
run_rc_command "$1"

i did a fresh reinstall after updating broke it also. i will upload the rc.d script when i get home. i should be done work soon

1 Like

There’s a couple other post about the updater script here, you can search “Updater.sh and LD_LIBRARY_PATH” and you’ll sure run into those and the solutions, but the tl;dr is that you need to change this line in the rc.d script :

        export LD_LIBRARY_PATH="/usr/pbi/plexmediaserver-amd64/lib/compat:${SCRIPTPATH}"

TO

        export LD_LIBRARY_PATH="${SCRIPTPATH}/lib"

All libs are under the lib sub dir since the first 1.15.x and we no longer depend on compat10x.

See my last post, if moving/copying the libs to the “root” install di works this is the problem for sure!

Just to be clear did you create a new “IOCAGE” plugin jail, or old style warden one?

AFAIK the iocage way simply installs the pkg which was built form ports, so the rc.d script should be ok.

So I just tested this and its broken alright:

root@plex:/ # cat /usr/local/etc/rc.d/plexmediaserver_plexpass | grep LD_LI
        export LD_LIBRARY_PATH="${SCRIPTPATH}"

This needs fixing on the FreeNAS plugin side, since the port it self looks fine.

Thanks for your help today @mikec_pt

Can I run the PMS_Updater.sh script after I make the adjustment you mentioned above to solve the problem or is it too late now that I’ve already run it before making the correction?

Also, I run freenas 11.1 so I believe I’m on the old plugin, not iocage (I’m not sure what iocage is so I dont think I’m using it)

So the plugins should install from ports, and freenas builds their own for stability but, this looks ok:

I went back a few versions and it also looks ok, so my best guess is that the pkg was built from a broken version.

That said, the only way to fix this is waiting for an update of the plugin or fixed the rc.d sript locally :frowning:

@mikec_pt

Just to clarify, when you said above to change from:
export LD_LIBRARY_PATH="/usr/pbi/plexmediaserver-amd64/lib/compat:${SCRIPTPATH}"

to:
export LD_LIBRARY_PATH="${SCRIPTPATH}/lib"

Is this in PMS_Updater.sh or is this in the rc.d script?

Also, as I stated above, both of these paths below do not exist in my plex jail, is that going to still be a problem?
/usr/local/share/plexmediaserver/lib/
/usr/local/share/plexmediaserver-plexpass/

You’re still running a old (Legacy) style jail, we can see that by looking at you’re rc.d script… see the path to the binaries and libs is: /usr/pbi/plexmediaserver-amd64/share/plexmediaserver/ (but also in the UI, under jails, you would see “pluginsv2” in the listed plex jails.

This is why you don’t see the other files/dirs.

Still updating the rc.d script should fix it for you… but I can’t guarantee you won’t run into issues in future yet again!

It also seems that the FreeNAS plugin it self for the newer system is installing a broken script anyway so the best option for now might just be to update that line and restart PMS.

An alternative is of course to use a standard jail (you need to mount media there and copy over the contents of plexdatadir) but this is the best way to stay updated anyway.

Enter the jail shell:

  1. edit /etc/pkg/FreeBSD.conf

  2. update this line: url: "pkg+http://pkg.FreeBSD.org/${ABI}/quarterly", quarterly should be latest

  3. pkg install plexmediaserver or plexmediaserver-plexpass

Then you can use pkg upgrade to keep things updated or even automate that via cron.

It will always use the latest FreeBSD pkg rather than depend on the plugin or the Updater Script.

As I said in other posts we are also considering solutions to make this easier, perhaps even by shipping a ready “txz” package! But we also don’t want to break things for people that still depend on the tarball! So this needs caution, but the recent issues in reported in the forums clearly indicate this is currently messy for users anyway :frowning:

Could somebody please describe the “proper” fix?

I upgraded 11.2 to 11.2 and deleted my old plugins/jails from the legacy UI.
I then entered the new UI and installed plexpass only to be greeted by this very same error everyone complains about " A problem has been detected with a core component of Plex Media Server."

Since this is a brand-new plugin / jail installation, what should be done to fix it?

It’s for the rc.d script yes.

As stated before the Updater script or whatever custom scripts you might use are not supported so I can comment if that might need fixing to. Possibly not.

Hey there, this is my rc.conf. What should I add in here to make Plex work? I have a fresh install on FreeNAS in an iocage. If this is not what you mean by rc.d @mikec_pt, what do you mean, and how do I fix it?

I understand why copying everything from lib isn’t sustainable, can you please provide a workaround on iocage? I’d like to leverage new jails vs old ones.

Thanks!!

root@plex:/etc # vi rc.conf
ifconfig_epair0b="DHCP"
hostname="plex"
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"
plexmediaserver_plexpass_enable="YES"
plexmediaserver_plexpass_support_path="/"

Although this is FreeNAS 11.2 specific, a simple guide to fixing it is:

  1. Login to FreeNAS
  2. Go to Jails on the left hand side
  3. Find your plex jail. If you installed it from the plugins it should be called “plex”
  4. Click the three dots on the end of the line, then “Shell”
  5. You should see something that looks like this:
  6. Type “ee /usr/local/etc/rc.d/plexmediaserver” without the quotes
  7. Something that looks like a text editor should show up
  8. Scroll down by pressing the down key until you see the line export LD_LIBRARY_PATH="${SCRIPTPATH}"
  9. Change the line to be export LD_LIBRARY_PATH="${SCRIPTPATH}/lib"
  10. Press Escape, then Enter to “a) leave editor”, then Enter to “a) save changes”
  11. Go back to Jails on the left hand side
  12. Restart your jail by clicking the three dots on the end of the jail’s line, then “Restart”

Hope this fixes people’s problem

2 Likes

You’re plex “data dir” is setup to “/” (root) ? this doesn’t look correct but wouldn’t break things as long as you have permissions for it.

The solution for the main issue anyway is updating LD_LIBRARY_PATH, I’ve posted here how, and @wgilmour_hotmail_co_uk posted above (So I recently updated my freenas box to 1.15.2.793_1 and i now cant get to the server setup page - #55 by wgilmour_hotmail_co_uk) an even more detailed guide to how to fix it!

The only different for some people is that the rc.d file name would include _plexpass if that’s the version you installed.

So I am also having the same issue but I cannot fix it. I was using the plex server on a legacy install of freenas and updating it manually. I got an error on my tv today when I tried to watch something that it needed a new server so I ran that PMS script to update it manually which did work, however the freenas plex plugin WILL NOT start now no matter what I do. I tried to install it from the new interface so it would be a v2 plugin which I did. I ran into the same issues as above and changing the rc.d to lib worked seemingly. However when I try to update the library I get an error and after a few seconds it crashes my plugin apparently as I can’t access it from the web interface anymore unless I restart it. I also get an error that I can’t access server settings, and I also can’t update the metadata. What’s going on and how can I fix it? I’m lost without my plex server!!!

Hey folks,

So I was able to dig into this a bit more today, with acess to a FreeNAS server in our QA lab.

The plugin does indeed mess up the rc.d file somehow, I’m tryin to reach to FreeNAS folks se if we can get that fixed, but in the mean time I checked the txz since the port looked fine!

And surprise the TXZ is ok too, so its somehow the plugin config that overrides the rc.d file to sometime old and broken.

EASIER SOLUTION for folks using the iocage type jails:
1 - Open a Jail Shell in the jail this is running
2 - Execute: pkg update
3 - Execute: pkg install -f plexmediaserver or pkg install -f plexmediaserver-plexpass
4 - Restart PMS

This basically overwrites the installed files (meaning the binaries/libs and rc.d script) it DOES NOT touch any metadata.

For those still using legacy “warden” jails and or the UPDATER script its probably easier to just update the rc.d file as explained here.

EDIT: I’m going to close this and mark this post as the solution!

4 Likes

I applied the update as described, and did mv of all my .so files back to lib, performed a restart, and so-far-so-good. Thanks, Mike.