Plex server doesn't work after update

Hi,

My plex server was running fine last night, but has probably been updated over night by my PMS_updater script and now the server doesn’t work. (https://github.com/mstinaff/PMS_Updater)

In the Plex Media Server.log i see the following:

Feb 14, 2019 22:25:30.560 [0x80cba3900] ERROR - Timeout or error reading status line from plug-in pipe [com.plexapp.system], we're killing it.
Feb 14, 2019 22:25:30.560 [0x80cba3900] ERROR - Error received reading configuration for com.plexapp.system
Feb 14, 2019 22:25:30.561 [0x80bcd1f00] WARN - JobManager: Could not find job for handle 1105
Feb 14, 2019 22:25:30.999 [0x80cba2000] ERROR - Timeout or error reading status line from plug-in pipe [com.plexapp.system], we're killing it.
Feb 14, 2019 22:25:30.999 [0x80cba2000] ERROR - Error received reading configuration for com.plexapp.system
Feb 14, 2019 22:25:31.000 [0x80bcd1f00] WARN - JobManager: Could not find job for handle 1106
Feb 14, 2019 22:25:31.420 [0x80e06c400] ERROR - Timeout or error reading status line from plug-in pipe [com.plexapp.system], we're killing it.
Feb 14, 2019 22:25:31.421 [0x80e06c400] ERROR - Error received reading configuration for com.plexapp.system
Feb 14, 2019 22:25:31.421 [0x80bcd1f00] WARN - JobManager: Could not find job for handle 1107
Feb 14, 2019 22:25:34.551 [0x80d817900] ERROR - downloadContainer: expected MediaContainer element, found html
Feb 14, 2019 22:25:34.551 [0x80d817900] WARN - DVR:Subscription: No container available for /tv.plex.providers.epg.xmltv:12/metadata/tv%2Eplex%2Exmltv%3A%2F%2Fshow%2FSo%2520ein%2520Ding
Feb 14, 2019 22:25:38.266 [0x80d616000] ERROR - Error issuing curl_easy_perform(handle): 28
Feb 14, 2019 22:25:38.267 [0x80d616000] ERROR - DVR:Device: Error refreshing existing device device://tv.plex.grabbers.hdhomerun/14107020, marking as dead.
Feb 14, 2019 22:25:38.268 [0x80d616000] ERROR - Error issuing curl_easy_perform(handle): 7
Feb 14, 2019 22:25:38.268 [0x80d616000] WARN - HTTP error requesting POST http://127.0.0.1:32600/devices/discover (0, No error) (Failed to connect to 127.0.0.1 port 32600: Connection refused)
Feb 14, 2019 22:31:31.726 [0x80ceb8500] INFO - AutoUpdate: no updates available
Feb 14, 2019 22:31:33.089 [0x80cba3900] WARN - [CompanionPlayer] We already have a handler, overwriting.
Feb 14, 2019 22:31:33.550 [0x80c652900] WARN - LongPoll: Got error, closing.
Feb 14, 2019 22:31:34.927 [0x80c652400] WARN - LongPoll: Got error, closing.
Feb 14, 2019 22:31:35.408 [0x80f386e00] INFO - AutoUpdate: no updates available
Feb 14, 2019 22:31:57.001 [0x80c652900] WARN - LongPoll: Got error, closing.

I can log into the server and see all my shows, but it will not play anything. What could be wrong?

Server Version#:v1.15.0.659-9311f93fd
Player Version#: Web client

Just curious, the script you referenced above is for FreeNAS, so are you running your server in FreeNAS or FreeBSD??? Also, what version of FreeNAS or FreeBSD are you running???

Yes the script is for freenas, but works just fine on FreeBSD. I am running 11.2-RELEASE-p4

1.15.0 has some packing changes, my best guess is that the script is not read for that yet (I mean its not updated in ages).

Even the freebsd port it self will need some updates on the rc.d script and Makefile, so probably best to wait for that, unless you want to poke with it you’re self.

I have tried installing 1.15 manually after with the same error, so now I am trying to find the old version, but that seems quite hard.

FYI - FreeNAS has updated their jail system recently, so I doubt that this script would even work on FreeNAS anymore… As @mikec_pt noted above, it hasn’t been updated in ages…

Hopefully the port/package will be available soon, as I have already notified the port maintainer that there was an update to the PLEX server… It will take him a little bit to do what ever voodoo he has to do to make it available in the ports tree and some time after that for the package servers to build the package and make it available in that form…

You can just “pkg install” it the port/package version is still on 1.14.x

If you want to use the port to update, this might help (and its how I updated my local freebsd server):
Diff for the Makefile

--- Makefile-orig 2019-02-03 01:05:16.480657000 +0000
+++ Makefile-new      2019-02-14 22:18:21.441183000 +0000
@@ -2,12 +2,11 @@
 # $FreeBSD: head/multimedia/plexmediaserver/Makefile 487765 2018-12-18 19:21:25Z feld $
 
 PORTNAME=      plexmediaserver
-PORTVERSION?=  1.14.1.5488
-DISTVERSIONSUFFIX?=cc260c476
-PORTREVISION?= 0
+PORTVERSION?=  1.15.0.601
+DISTVERSIONSUFFIX?=14b35e112
 CATEGORIES=    multimedia
 MASTER_SITES=  https://downloads.plex.tv/plex-media-server/${DISTVERSION}-${DISTVERSIONSUFFIX}/
-DISTNAME=      PlexMediaServer-${DISTVERSION}-${DISTVERSIONSUFFIX}-freebsd-${ARCH}
+DISTNAME=      PlexMediaServer-${DISTVERSION}-${DISTVERSIONSUFFIX}-FreeBSD-${ARCH}
 
 MAINTAINER?=   feld@FreeBSD.org
 COMMENT=       Plex Media Server component
@@ -47,11 +46,8 @@
        # binaries don't come pre-stripped
        ${FIND} ${WRKSRC}/Resources -name '*.so' -exec ${STRIP_CMD} {} \+
        ${FIND} ${WRKSRC} ${WRKSRC}/Resources -name 'Plex*' -depth 1 -exec ${STRIP_CMD} {} \+
-       ${FIND} ${WRKSRC} -depth 1 -name 'lib*' -exec ${STRIP_CMD} {} \+
+       ${FIND} ${WRKSRC} -depth 1 -name 'lib/*' -exec ${STRIP_CMD} {} \+
        ${RM} ${WRKSRC}/start.sh ${WRKSRC}/Resources/start.sh
-       # Older verisons of Plex we have to create a symlink
-       # Newer versions of Plex ship a duplicate file; we'll just symlink
-       ${RM} ${WRKSRC}/libpython2.7.so
 
 post-patch-RELAY-off:
        ${RM} ${WRKSRC}/Plex\ Relay
@@ -59,7 +55,7 @@
 do-install:
        (cd ${WRKSRC} && ${COPYTREE_SHARE} \* ${STAGEDIR}/${DATADIR})
        # Python fix for older releases of Plex
-       ${INSTALL} -lrs ${STAGEDIR}/${DATADIR}/libpython2.7.so.1 ${STAGEDIR}/${DATADIR}/libpython2.7.so
+       ${INSTALL} -lrs ${STAGEDIR}/${DATADIR}/lib/libpython2.7.so.1 ${STAGEDIR}/${DATADIR}/lib/libpython2.7.so
        # Workaround for space in binary name
        ${INSTALL} -lrs ${STAGEDIR}/${DATADIR}/Plex\ Media\ Server ${STAGEDIR}/${DATADIR}/Plex_Media_Server

But the rc.d script also needs changes cause the start.sh script is different now too, and based on the new start.sh script this should do it:

--- plexmediaserver.in.orig     2018-08-14 16:28:39.300158000 +0100
+++ plexmediaserver.in.new      2019-02-14 22:14:38.537119000 +0000
@@ -40,11 +40,24 @@
 
 plex_precmd()
 {
+       # Set identification variables for FreeNAS; with fallback to FreeBSD
+       if [ -f "/etc/version" ]; then
+               export PLEX_MEDIA_SERVER_INFO_VENDOR="$(cat /etc/version|cut -d- -f1)"
+               export PLEX_MEDIA_SERVER_INFO_DEVICE=NAS
+               export PLEX_MEDIA_SERVER_INFO_MODEL="$(uname -m)"
+               export PLEX_MEDIA_SERVER_INFO_PLATFORM_VERSION="$(cat /etc/version|cut -d- -f2-)"
+       else
+               export PLEX_MEDIA_SERVER_INFO_VENDOR=FreeBSD
+               export PLEX_MEDIA_SERVER_INFO_DEVICE=PC
+               export PLEX_MEDIA_SERVER_INFO_MODEL="$(uname -m)"
+               export PLEX_MEDIA_SERVER_INFO_PLATFORM_VERSION="$(uname -r)"
+       fi
+
        export SUPPORT_PATH="${%%PORTNAME%%_support_path}"
        export HOME="${%%PORTNAME%%_support_path}/Plex Media Server"
        export PYTHONHOME="%%DATADIR%%/Resources/Python"
        export SCRIPTPATH="%%DATADIR%%"
-       export LD_LIBRARY_PATH="%%PREFIX%%/lib/compat:${SCRIPTPATH}"
+       export LD_LIBRARY_PATH="${SCRIPTPATH}/lib"
        export PLEX_MEDIA_SERVER_HOME="${SCRIPTPATH}"
        export PLEX_MEDIA_SERVER_MAX_PLUGIN_PROCS=${%%PORTNAME%%_maxplugins}
        export PLEX_MEDIA_SERVER_APPLICATION_SUPPORT_DIR=${%%PORTNAME%%_support_path}

So if you don’t want to wait for the port to update I suppose you could update the port files locally.

Actaully the comments here:

+       #${FIND} ${WRKSRC}/Resources -name '*.so' -exec ${STRIP_CMD} {} \+
+       #${FIND} ${WRKSRC} ${WRKSRC}/Resources -name 'Plex*' -depth 1 -exec ${STRIP_CMD} {} \+
+       #${FIND} ${WRKSRC} -depth 1 -name 'lib/*' -exec ${STRIP_CMD} {} \+
+       #${RM} ${WRKSRC}/start.sh ${WRKSRC}/Resources/start.sh
        # Older verisons of Plex we have to create a symlink
        # Newer versions of Plex ship a duplicate file; we'll just symlink

Was me testing… I don’t think we need the strip commands …at leas not any more but wasn’t sure. And I also prefer to keep the start.sh for reference

Updated the diff for the Makefile without the comments

I have just restored the server from last nights backup. Its now running 1.14.1.5488 and working just fine. I might try to update it manually to 1.15 to test if its the script.

I was able to get 1.15.0.659 working by updating /usr/local/etc/rc.d/plexmediaserver_plexpass adding “/lib” to the end of the following line:

Before:

export LD_LIBRARY_PATH="/usr/local/lib/compat:${SCRIPTPATH}

After:

export LD_LIBRARY_PATH="/usr/local/lib/compat:${SCRIPTPATH}/lib

You are right! This worked like a champ.

Yeah that’s in the diff too but there more stuff you should apply everything.

One other thing is that we no longer require compat9x (the builds are actually done on 11 anyway but this means we don’t need RUN_DEPENDS+= ${LOCALBASE}/lib/compat/libstdc++.so.6:misc/compat9x anymore

There are changes to the portversion/distversionsuffix/master_sites to make the newest version. I outlined makefile differences in this post.

That’s not enough see the diff for the rc.d script I posted, ideally you should include all as it help identify if the system is freebsd or freenas in the logs, but the most important and also posted above is:

-       export LD_LIBRARY_PATH="%%PREFIX%%/lib/compat:${SCRIPTPATH}"
+       export LD_LIBRARY_PATH="${SCRIPTPATH}/lib"

We don’t need /usr/local/lib/compat anymore has we no longer have this dependency in the new builds

1 Like

This is a posterchild example of why I advise people to not use that 3rd party script (hack) and instead install PMS the proper way using FreeBSD package/port management tools, and update it using the official FreeBSD methods.

Way too many people are stumbling upon that script (or being recommended it) when it is an outdated hack that is not necessary and can cause problem when it falls out of date.

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