Shared Libraries not found when installing a port in a jail

Status
Not open for further replies.

Sirach Matthews

Dabbler
Joined
Sep 23, 2014
Messages
20
I am running build FreeNAS-9.3-STABLE-201506292130, and was attempting to install the most recent PLEX Media server port in a jail. I ran the following:
Code:
portsnap fetch update
cd /usr/ports/multimedia/plexmediaserver
make install clean

It begins the installation process, but is soon interrupted with the following message:
Code:
===>  Installing for plexmediaserver-0.9.12.4.1192
===>  Checking if plexmediaserver is already installed
===>   plexmediaserver-0.9.11.#### is already installed
      You may wish to ``make deinstall'' and install this port again
      by ``make reinstall'' to upgrade it properly.
      If you really wish to overwrite the old port of plexmediaserver
      without deleting it first, set the variable "FORCE_PKG_REGISTER"
      in your environment or the "make install" command line.
*** [check-already installed] Error code 1

Following the suggestion, I entered the following:
Code:
make deinstall
make reinstall

The installation begins as normal, but then the following is returened:
Code:
===>  Registering installation for plexmediaserver-0.9.12.4.1192
(plexmediaserver-0.9.12.4.1192) /usr/ports/multimedia/plexmediaserver/work/stage//usr/local/share/plexmediaserver/Plex DLNA Server - required shared library libthr.so.3 not found
(plexmediaserver-0.9.12.4.1192) /usr/ports/multimedia/plexmediaserver/work/stage//usr/local/share/plexmediaserver/Plex DLNA Server - required shared library librt.so.1 not found
(plexmediaserver-0.9.12.4.1192) /usr/ports/multimedia/plexmediaserver/work/stage//usr/local/share/plexmediaserver/Plex DLNA Server - required shared library libstdc++.so.6 not found
(plexmediaserver-0.9.12.4.1192) /usr/ports/multimedia/plexmediaserver/work/stage//usr/local/share/plexmediaserver/Plex DLNA Server - required shared library libm.so.5 not found
(plexmediaserver-0.9.12.4.1192) /usr/ports/multimedia/plexmediaserver/work/stage//usr/local/share/plexmediaserver/Plex DLNA Server - required shared library libgcc_s.so.1 not found
(plexmediaserver-0.9.12.4.1192) /usr/ports/multimedia/plexmediaserver/work/stage//usr/local/share/plexmediaserver/Plex DLNA Server - required shared library libc.so.7 not found
(plexmediaserver-0.9.12.4.1192) /usr/ports/multimedia/plexmediaserver/work/stage//usr/local/share/plexmediaserver/Plex Media Scanner - required shared library libthr.so.3 not found
(plexmediaserver-0.9.12.4.1192) /usr/ports/multimedia/plexmediaserver/work/stage//usr/local/share/plexmediaserver/Plex Media Scanner - required shared library librt.so.1 not found
(plexmediaserver-0.9.12.4.1192) /usr/ports/multimedia/plexmediaserver/work/stage//usr/local/share/plexmediaserver/Plex Media Scanner - required shared library libstdc++.so.6 not found
(plexmediaserver-0.9.12.4.1192) /usr/ports/multimedia/plexmediaserver/work/stage//usr/local/share/plexmediaserver/Plex Media Scanner - required shared library libm.so.5 not found
(plexmediaserver-0.9.12.4.1192) /usr/ports/multimedia/plexmediaserver/work/stage//usr/local/share/plexmediaserver/Plex Media Scanner - required shared library libgcc_s.so.1 not found
(plexmediaserver-0.9.12.4.1192) /usr/ports/multimedia/plexmediaserver/work/stage//usr/local/share/plexmediaserver/Plex Media Scanner - required shared library libc.so.7 not found
(plexmediaserver-0.9.12.4.1192) /usr/ports/multimedia/plexmediaserver/work/stage//usr/local/share/plexmediaserver/Plex Media Server - required shared library libthr.so.3 not found
(plexmediaserver-0.9.12.4.1192) /usr/ports/multimedia/plexmediaserver/work/stage//usr/local/share/plexmediaserver/Plex Media Server - required shared library librt.so.1 not found
(plexmediaserver-0.9.12.4.1192) /usr/ports/multimedia/plexmediaserver/work/stage//usr/local/share/plexmediaserver/Plex Media Server - required shared library libstdc++.so.6 not found
(plexmediaserver-0.9.12.4.1192) /usr/ports/multimedia/plexmediaserver/work/stage//usr/local/share/plexmediaserver/Plex Media Server - required shared library libm.so.5 not found
(plexmediaserver-0.9.12.4.1192) /usr/ports/multimedia/plexmediaserver/work/stage//usr/local/share/plexmediaserver/Plex Media Server - required shared library libgcc_s.so.1 not found
(plexmediaserver-0.9.12.4.1192) /usr/ports/multimedia/plexmediaserver/work/stage//usr/local/share/plexmediaserver/Plex Media Server - required shared library libc.so.7 not found
(plexmediaserver-0.9.12.4.1192) /usr/ports/multimedia/plexmediaserver/work/stage//usr/local/share/plexmediaserver/Resources/Plex New Transcoder - required shared library libthr.so.3 not found
etc
etc


Despite all those missing shared libraries, the installation completes and the plexmediaserver service appears after applying
Code:
service -e
However, the service does not respond via the PLEX web interface. When I try running
Code:
service plexmediaserver stop
the following is returned:
Code:
plexmediaserver not running? (check /var/run/plex/plex.pid).


When I check /var/run/plex/, there is no plex.pid listed.

I imagine all the trouble I am having is related to those missing shared library files. Is there a way to re-build the shared libraries?
 

cyberjock

Inactive Account
Joined
Mar 25, 2012
Messages
19,526
Why would you compile plex yourself!?

# pkg install plexmediaserver
 

Sirach Matthews

Dabbler
Joined
Sep 23, 2014
Messages
20
I am not trying to compile it myself. I was attempting to install it using the ports method.

If I try as you suggest:
Code:
# pkg install plexmediaserver
Updating FreeBSD repository catalogue...
FreeBSD repository is up-to-date.
All repositories are up-to-date.
Updating database digests format: 100%
Checking integrity... done (0 conflicting)
The most recent version of packages are already installed


So, first I ran
Code:
make deinstall

Then did as you suggested:
Code:
# pkg install plexmediaserver
Updating FreeBSD repository catalogue...
FreeBSD repository is up-to-date.
All repositories are up-to-date.
Checking integrity... done (0 conflicting)
The following 1 package(s) will be affected (of 0 checked):

New packages to be INSTALLED:
  plexmediaserver: 0.9.12.4.1192

The process will require 192 MiB more space.

Proceed with this action? [y/N]: y
[PLEX] [1/1] Installing plexmediaserver-0.9.12.4.1192...
===> Creating users and/or groups.
Creating group 'plex' with gid '972'.
pw: gid `972' has already been allocated
Using existing user 'plex'.
[PLEX] [1/1] Extracting plexmediaserver-0.9.12.4.1192: 100%
Message for plexmediaserver-0.9.12.4.1192:
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *

multimedia/plexmediaserver includes an RC script:
/usr/local/etc/rc.d/plexmediaserver

TO START PLEXMEDIASERVER ON BOOT:
sysrc plexmediaserver_enable=YES

START MANUALLY:
service plexmediaserver start

Once started, visit the following to configure:
http://localhost:32400/web

* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
# service -e
/etc/rc.d/cleanvar
/etc/rc.d/newsyslog
/etc/rc.d/syslogd
/etc/rc.d/virecover
/etc/rc.d/motd
/usr/local/etc/rc.d/plexmediaserver
/etc/rc.d/cron


The plexmediaserver service is running, however, I am still unable to connect to its web interface.
If I try to stop the service:
Code:
# service plexmediaserver stop
plexmediaserver not running? (check /var/run/plex/plex.pid).

Which is the same problem as before.
 
Last edited:

danb35

Hall of Famer
Joined
Aug 16, 2011
Messages
15,504
"Using the ports method" is compiling it yourself.

What makes you think that the plexmediaserver service is running? Because your system doesn't think it is. What happens if you do 'service plexmediaserver start'?
 

Sirach Matthews

Dabbler
Joined
Sep 23, 2014
Messages
20
This is why I think plexmediaserver service is running:
Code:
# service -e
/etc/rc.d/cleanvar
/etc/rc.d/newsyslog
/etc/rc.d/syslogd
/etc/rc.d/motd
/usr/local/etc/rc.d/plexmediaserver
/etc/rc.d/cron


When I run service plexmediaserver start:
Code:
# service plexmediaserver start
Starting plexmediaserver.


After that, I am able to use the web interface for PLEX, however, it is still displaying the old server version (0.9.11.1.678), and not the new version (0.9.12.4.1192) which I installed.

When I restart the jail, I lose the web interface, and when I run service plexmediaserver start:
Code:
Starting plexmediaserver.
su: pam_start: system error
/usr/local/etc/rc.d/plexmediaserver: WARNING: failed to start plexmediaserver
 

SweetAndLow

Sweet'NASty
Joined
Nov 6, 2013
Messages
6,421
I'd just delete the jail and start over. It is very simple to use pkg install. Something along the way got messed up.
 

danb35

Hall of Famer
Joined
Aug 16, 2011
Messages
15,504
service -e doesn't list the services that are running; it lists the services that are available. But I concur with @SweetAndLow that something else is messed up, and the easiest course of action would be to delete the jail and start over.
 

SweetAndLow

Sweet'NASty
Joined
Nov 6, 2013
Messages
6,421
Did you install the plugin then try to update using ports?
 

cyberjock

Inactive Account
Joined
Mar 25, 2012
Messages
19,526
I agree with everyone else.. destroy the jail and recreate it.

The metadata can be backed up and restored. You'd have to look at the Plex documents/forums to see where the data is kept so you can back it up yourself. That is beyond the purview of this forum so you probably won't find the answer here unless someone else has had the same problems you are having.
 

Sirach Matthews

Dabbler
Joined
Sep 23, 2014
Messages
20
The metadata can be backed up and restored. You'd have to look at the Plex documents/forums to see where the data is kept so you can back it up yourself. That is beyond the purview of this forum so you probably won't find the answer here unless someone else has had the same problems you are having.
I have had little success with that in the past. The procedure usually results in having to start over, anyways.

My original problem, was not with PLEX specifically or metadata, but more so with recovering from the loss of shared libraries. I like to use problems that occur as ways to gain experience and knowledge while trying to recover from them. I know there are lots of smart people out there, who may not have encountered the exact issue I am having, but with their experience and knowledge, might be able to lend some helpful suggestions to steer me in the right direction.

Though, by now, I have already started a new Jail for PLEX, I have retained the problematic one, so I can continue to tinker and hopefully find a solution. Should I find a solution through my tinkering that does not involve abandonment, I shall definitely share it here.

So far, I have found that the "missing" libraries are present within the jail, yet it still says they are missing.

I remain completely open to suggestions.
 
Last edited:

Jailer

Not strong, but bad
Joined
Sep 12, 2014
Messages
4,977
Well as you have discovered your attempt to "install the latest version" is what caused your problem in the first place. The FreeBSD Handbook outlines the process on how to install and update ports.

I would suggest following Cyberjocks suggestion and install Plex via the package manager. But if you insist on installing via ports follow the steps outlined in the manual for upgrading your jail. Specifically update your port tree and then use the portmaster or portupgrade method.
 

cyberjock

Inactive Account
Joined
Mar 25, 2012
Messages
19,526
I don't like installing from ports as there's much more room for problems. If a compile error occurs 99.9% of FreeNAS users may not even be able to identify that there was a compile error, let alone know how to fix it.

pkg-ng is much simpler as you simply do something like:

pkg update
pkg upgrade

If a newer version has been compiled and put in the pkg-ng repositories, it will be downloaded. Ports is updated very very shortly (an hour?) after Plex is updated officially. The pkg-ng repos can take 1-3 days. Despite this I still use the pkg-ng repos because it removes virtually all of the potential problems and makes it dead simple to maintain and update Plex in the future. If having to wait a couple of days for an upgrade of Plex is going to be a pain for you, you probably should just use the Windows server version. For me, it's not a big deal. I don't even update Plex within a week or two because I just don't sweat it if an update comes out and I'm too busy to deal with it. ;)
 
Status
Not open for further replies.
Top