Server Version#: 1.18.9.2578-513b381af
Player Version#: N/A (Server issue)
FreeBSD Version#: 11.3-RELEASE-p7
FreeNAS Version#: 11.3-U2.1
Hi there,
I’ve been trying to setup a Plex Media Server in a FreeNAS jail running FreeBSD 11.3 for the past few days. I’m trying to migrate my media from a previous Plex install on macOS, but I’m having a couple problems.
One problem is that the loading icon that shows up when you first setup a server stays there for a couple minutes, before showing this screen:
I’m able to click the menu items at the top, but when importing things to the Media library I have a problem whose symptoms are the same as this thread. I can’t seem to find a way to implement the fix since OP was running Windows. I am running a reverse proxy on a separate jail, but I haven’t put this Plex jail behind it yet. I’ve forwarded 32400 to the IP address I’ve given to the jail.
I went on the FreeNAS forums last night to get some help and changed the file permissions of the media to 0755 and gave ownership to user plex with uid 972 and group media
I’ve done many clean installs of Plex trying the plugin given by FreeNAS, installing manually from pkg, and using danb35’s automated script.
One of the suspicions we had last night on the FreeNAS forums was that it could be a plugin issue, since com.plexapp.system keeps getting killed and restarted because reading from configuration is timing out. However, I’m also having the same log messages when trying to save my library imports as the above thread.
Edit: It seems that the upload button isn’t attaching my zip full of logs; the errors are the same as linked thread. I was able to attach the zip to my FreeNAS post, which can be found here
Not until today sorry, can do an ls on theses dirs:
ls -l /usr/local/share/plexmediaserver/Resources ls -l /usr/local/plexdata/Plex\ Media\ Server
In the first there should only be one plugins dir if not Its easy to fix, on the other do you actually have a plugins dir there? And if so can you then ls that one dir?
There is one plugins dir in /usr/local/share/plexmediaserver/Resources, with -513b381af appended at the end of the directory name. (So the full path is /usr/local/share/plexmediaserver/Resources/Plug-ins-513b381af)
I created a plugins dir in /usr/local/plexdata/Plex\ Media\ Server while looking for what could’ve caused problems. It wasn’t there before and is currently empty
Also, the broken plex is hogging a lot of resources while it’s running, to the point where it takes a couple minutes to just connect to the machine thru ssh and basically makes the FreeNAS web control unusable, if that helps with any diagnosis.
That is the expected case for the install dir, it should only have on and with should have an hash in the name so that’s fine.
You don’t need the Plugins dir on the other one for sure the log does complain about being unable to access it which could be because it was created with bad permissions but that’s unlikely.
Lets try this:
Remove the dir you created.
Stop PMS
pkg remove plexmediaserver
rm -rf /usr/local/share/plexmediaserver (don’t worry this is just the install dir no user data is saved here).
chown -R plex /usr/local/plexdata/
install plexmediaserver again and restart the service
Also, I can confirm that it’s indeed the plexmediaserver service causing the lack of resources, since as soon as I stopped it the CPU usage shown on the FreeNAS cp went from 100% to 3%. Again, I’m not sure if that helps with anything but it’s a bit weird, especially since it worked perfectly fine on macOS.
Attached are the most recent logs Archive.zip (9.8 KB)
This is comment is mostly for if someone else has this problem;
I have a pi-hole running and thought it could be blocking domain resolutions to Plex, so I changed the nameservers on the jail just to 1.1.1.1. For my setup with pi-hole looping back to a unbound server on the raspberry pi, it didn’t help and I still arrive at the same page.
@nnhien the resource usage is for sure suspicious, but I run on BSD my self (not FreeNAS) and doesn’t see this, my jail is on 12.0 though, but there’s also no other reports of this on 11.3.
Can you update to 1.19.1 first since that seems to be available on bsd now and let me know if it just magically fixes it (there’s not expected fix on the changelog for that) but there some changes in curl/openssl libs that I’m just hoping maybe help ( its a long shot for sure).
If with 1.19.1 it still happens than we will need to dig deeper.
I think I assumed incorrectly that plex was hogging resources though. I checked the larger history of resource usage and it’s actually pretty ok. It was probably just a coincidence for the times that I looked at the resource usage it went from 100% to 0% right after I turned off the service.
Now back to you’re issues lets try to start PMS manually. There’s a start.sh script along side the binaries but it will default to the standard application_support_data_path.
Edit the start.sh script and use this:
#!/bin/sh
# 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 plexmediaserver_support_path="/usr/local/plexdata/"
export SUPPORT_PATH="${plexmediaserver_support_path}"
export HOME="${plexmediaserver_support_path}/Plex Media Server"
SCRIPT=$(readlink -f $0)
SCRIPTPATH=$(dirname ${SCRIPT})
export LD_LIBRARY_PATH="${SCRIPTPATH}/lib"
export PLEX_MEDIA_SERVER_HOME="${SCRIPTPATH}"
export PLEX_MEDIA_SERVER_MAX_PLUGIN_PROCS=6
export LC_ALL="en_US.UTF-8"
export LANG="en_US.UTF-8"
export PYTHONHOME="${SCRIPTPATH}/Resources/Python"
export PATH="${SCRIPTPATH}/Resources/Python/bin:${PATH}"
ulimit -s 3000
./Plex\ Media\ Server
Alternatively just make sure to add this lines before SCRIPT=$(readlink -f $0)
export plexmediaserver_support_path="/usr/local/plexdata/"
export SUPPORT_PATH="${plexmediaserver_support_path}"
export HOME="${plexmediaserver_support_path}/Plex Media Server"
Hm, I’m experiencing the resource hogging again. I tried starting it manually like you said and I still reach the same page.
Edit: It seems like it starts out with reasonable resource usage, but then as time goes on it slowly starts spawning sh instances that I can see in top which causes the resource bottleneck
Edit 2: Aha, I found where the resource hogging starts; when the core component problem page gets pushed, at least 4 instances of sh are spawned, and the CPU is maxed out. Also, when the “please wait a moment” page shows, an additional sh is spawned, which is probably expected behavior since the CPU isn’t maxed out at that point (it’s just at around 50%)
I remember trying to install something on a different jail and json wouldn’t compile; maybe this is ultimately a FreeNAS or a FreeBSD problem with cpp.
I’ve also tried installing it on fresh jails and it still wouldn’t work.