The out-of-the-box configuration of Plex on FreeBSD causes the localmedia agent to barf when trying to read subtitles containing Unicode characters. In "/usr/local/plexdata/Plex Media Server/Library/Logs/PMS Plugin Logs/com.plexapp.agents.localmedia.log" you get something like:
CRITICAL (agentkit:1057) - Exception in the update function of agent named 'Local Media Assets (Movies)', called with guid 'com.plexapp.agents.imdb://tt1617661?lang=en' (most recent call last):
File "bundles-release/Framework.bundle-dist/Contents/Resources/Versions/2/Python/Framework/api/agentkit.py", line 1055, in _update
File "/usr/local/share/plexmediaserver/Resources/Plug-ins-f38ac80/LocalMedia.bundle/Contents/Code/__init__.py", line 56, in update
File "/usr/local/share/plexmediaserver/Resources/Plug-ins-f38ac80/LocalMedia.bundle/Contents/Code/localmedia.py", line 260, in findSubtitles
if os.path.isfile(os.path.join(path, file_path_listing)):
File "/usr/local/share/plexmediaserver/Resources/Python/lib/python2.7/genericpath.py", line 29, in isfile
st = os.stat(path)
UnicodeEncodeError: 'ascii' codec can't encode characters in position 43-44: ordinal not in range(128)
This can be fixed by editing the startup script "/usr/local/etc/rc.d/plexmediaserver", changing the lines:
This fix is described in the Plex forums here: https://forums.plex.tv/discussion/comment/780533/#Comment_780533
I modled the rc script after the shell script that ships with Plex and at the time it was using the C locale. I am not sure if they changed it; haven't looked. Either way, this is a smart change.
A commit references this bug:
Date: Thu Dec 31 15:19:39 UTC 2015
New revision: 404948
multimedia/plexmediaserver(-plexpass): Fix scanner crash
The Plex processes were running under the C locale. This was to
replicate the behavior of the start.sh shell script shipped with Plex and
used by Linux distributions. The scanner process was crashing when it
encountered unicode filenames due to this locale.
Upstream Plex fixed this, but we were left affected.
This resolves the scanner process crash on FreeBSD.