Help needed: FreeNAS 11.2 plex shows it is playing videos, but devices do not play

Server Version#: 1.18.3.2129
Player Version#: Misc Android, Web, iOS, Chromecast (tv dongle)

Hi all - I recently deleted my old 11.1 FreeNAS PlexPass jail and reinstalled a fresh 11.2 version. I am now having various issues playing back different newer videos on different devices.

Some files play fine. These mostly seem to be files that need no transcoding.

Most recent files exhibit the same symptoms and do not play successfully:

  • Are MKV’s
  • Most (but not all) require transcoding of at least the audio.
  • The impacted videos (for iOS, Chrome webplay, and Chromecast’ed streams) will show the “spinner” endlessly when playing back (instead of playing), while the timecode shows 0:00 and the dashboard shows no activity. But press pause on the devices, and click play again, and the stream shows up on the dashboard, with the status as playing, with correct timecode and a thumbnail image of where the stream is up to. Pressing pause on the device again will pause it on the dashboard, and resuming will resume. But at no stage does anything play on the devices. It still shows the spinner.
  • Not all devices have the same problems - Android app seems to do OK for some of the files, but “casting” to chromecast will yield the same results as the point above. Yet Android app will also have the same problems as above. I cannot find a common cause.

I suspected the transcoder, and access to the transcode folder. However, I have set this up as both a mount point and also as a local folder to test, with rwe permissions of 777 - I can see the transcoder making new folders and heaps of chunked files with proper file sizes. So I don’t think its a path or permission issue.

Bandwidth and CPU graphs all show something is happening.

I found the following items of interest in the debug logs (film was “Cars”):

Dec 27, 2019 16:42:14.739 [0x812837000] Debug — MDE: Selected protocol dash; container: mp4
Dec 27, 2019 16:42:14.739 [0x812837000] Debug — MDE: analyzing media item 5269
Dec 27, 2019 16:42:14.739 [0x812837000] Debug — MDE: Cars: Direct Play is disabled
Dec 27, 2019 16:42:14.739 [0x812837000] Debug — MDE: Cars: media must be transcoded in order to use the dash protocol
Dec 27, 2019 16:42:14.739 [0x812837000] Debug — MDE: Cars: no direct play video profile exists for http/mkv/h264
Dec 27, 2019 16:42:14.739 [0x812837000] Debug — MDE: Cars: no direct play video profile exists for http/mkv/h264/ac3
Dec 27, 2019 16:42:14.739 [0x812837000] Debug — MDE: Cannot direct stream audio stream due to codec ac3 when profile only allows aac
Dec 27, 2019 16:42:14.739 [0x812837000] Debug — MDE: Cars: selected media 0 / 5269

It’s as if there is no MKV codec.
And this appears a few times too:

Dec 27, 2019 16:42:29.405 [0x80bdbdc00] Warning — Transcode runner appears to have died.

Plex itself is saying an update is available: 1.18.3.2156. However, FreeNAS 11.2 plugin interface is not detecting any updates, and my understanding is as of v11.2 we should be using Freenas to update plex, not scripts? An “apt upgrade” shows no new packages. I’ve seen the old “wget” script doesn’t work under 11.2, and I’ve not found an instruction on manual updates yet, so I’ve not pushed this further.

Any help would be greatly appreciated.

I would post full logs, but the exceed the post limit. Any requests?

Ent.

Did you install plex via plugin or manual install using pkg / build+install?

I swapped to iocage jails earlier this year and used pkg to install, as I heard others having weird issues using the plugin at the time.

I know a easy way to update the codecs is to select a heap of movies and click analysis (plex WebUI) as it’s suppose to download any missing before running the task (or so I’ve seen before on the forums).

Edit also if you do not change the branch, I think the default FreeBSD was every 3 or 6 months (so you might not see the update). My understanding is freenas just runs the pkg upgrade command now when it detects a version change.

Edit2: https://www.ixsystems.com/community/threads/freenas-11-and-iocage-style-plugins-pkg-repo.55225/ tells you how ro change update channel to latest (I manually set mine up so use at own risk)

Hi xInsertx - it is indeed the plugin via FreeNAS jails. I’ll have a poke around that link - I don’t mind manual updates. It’s just a question of - have I missed something, or is this iocage jail weirdness.

I would restart the service than run the analysis task as suggested above , you should see in the log if it detects the codecs needed to be updated/downloaded.

Atleast that’s what I did for one of my installs that had the same problem.

Here’s a list of what I can see in the codec folder. keep in mind this is an install that hasn’t been updated in a few months.

libaac_decoder.so
libaac_encoder.so
libac3_decoder.so
libac3_encoder.so
libdca_decoder.so
libh264_decoder.so
libhevc_decoder.so
liblibx264_encoder.so
libmp3_decoder.so
libmpeg2video_decoder.so
libmpeg4_decoder.so
libmsmpeg4v3_decoder.so
libvp6f_decoder.so

EasyAudioEncoder

Thanks! The Jail (and even FreeNAS) have been rebooted multiple times.

Even after performing the Analysis task across all my libraries, my list is abbreviated compared to yours:

I presume these get downloaded when needed? So presumably they will be furnished just in time for use?

Next step is to try a manual update.

OK, so I changed the branch as described above. It’s telling me the available server is:
plexmediaserver-plexpass-1.18.3.2129 Plex Media Server component
Which is the same as is installed.
Yet Plex itself is still reporting 1.18.3.2156 as available. I haven’t done a manual update as I read the old wget script no longer works with the new iocage/plugin approach. (but happy to see links to suggestions).

Getting back on the topic of the symptoms (a lot of devices won’t play my MKV’s, and it seems Transcoding has a hand in this), I installed the Plex Windows player. Every problem file plays OK. Meanwhile, back on Chromecast or in the Chrome browser or on Android and iOS devices, the file continues to suggest its playing back in the dashboard, while the devices show a “spinner” endlessly spinning.

I have an unshakable feeling this is a transcode issue. But I can’t put my finger on what is wrong.

Perhaps the best way forward is to find a manual update method?

It just occurred to me, are you trying to use hardware transcoding (igpu etc) or software? Because hardware transcoding involves extra steps I believe in iocage.

Also that version info is correct, pkg/ports is usually a few versions behind https://www.freshports.org/multimedia/plexmediaserver-plexpass/

I saw this, but you might have weird permission issues if your not careful How to manually update PlexPass on FreeNAS /FreeBSD from TAR file (ending freebsd-amd64.tar.bz2)

You could check to see if the codecs are in the tarball, replying from a iPad so can’t myself.

Still makes me think it might not be able to download the codec from plex.tv which is weird.

1 Like

xInsertx is correct, but there’s one thing people fail to realize when dealing with Unix;
and that is ACL’s (Access Control Lists).

While Plex Media Server ( PMS) requires read-only access on Windows and other various platforms, it requires some very specific permissions when running on FreeNAS/FreeBSD.

Open Unix permissions (RWXRWXRWX) alone will not cut it, as your data pool is most likely governed by ACL’s, which will need to need to reflect this as well.
Note: I figured this out after a server overhaul, upgrade, and data migration.

Try reviewing and performing the following to correct this:

  • First: Navigate to the parent folder of your data/media and run an “ls -la

If your permissions are set to open ending with a “+” sign (drwxrwxrwx+), then you have an ACL set which is controlling your Unix Security/Access.

How to view your current ACL’s

  • Login to your FreeNAS box via command line using PuTTY/MobaXterm/ etc.
  • Type the following:
    getfacl /path/to/target/media

Example:
getfacl /media/
#file: /media
#owner: 1000
#group: wheel
owner@:rwxp–aARWcCos:-------:allow
group@:rwxp–a-R-c–s:-------:allow
everyone@:r-x—a-R-c–s:-------:allow <----- This is your problem

Setting ACL’s with allowable permissions for everyone

(preferred for FreeNAS media only)

  • Login to the FreeNAS WebGUI as “root
  • Navigate to: Storage > “target pool” > click the gear an select edit permissions.
  • Under ACL Type ? select Unix
  • Save this setting and close/minimize the browser

Login to your FreeNAS box once more
Set the following ACL’s on the parent media folder.

  • Target Dir:
    setfacl -m everyone@:full_set:fd:allow /mnt/[pool]/media/

Note: This should also open permissions on your target media recursively, and should re-enforce them even if you or someone attempts to modify then using “Unix permissions”, this will also enforce to files added to these folders

Your target ACL should look like this now
getfacl /media/
#file: /media
#owner: 1000
#group: wheel
owner@:rwxp–aARWcCos:-------:allow
group@:rwxp–a-R-c–s:-------:allow
everyone@:rwxpDdaARWcCos:fd-----:allow < — This is what PMS wants

To test this out:

  • Log in to your local PMS via from a browser
  • Select any media category and attempt to edit using the 3 dots next to it
  • Select Add folders > Browse for Media Folder
  • Navigate to the location of your media files

If you can see the files/folders your access should be good.

If you are still having issues once this has occurred, let me know and I’ll link the URL I posted in FreeNAS forums to Back up your PMS Database and Reinstall.
Note: This is a much lengthier process (time-wise), but the instructions are less complicated

Hi SavioDesign and xInsertx, thanks for the continued interest and help. Still no success. :frowning:

I will answer the suggestions/questions next, but something xInsertx mentioned (about the server possibly not downloading codecs from plex) got me thinking: I have the plex trailer ad and preroll set up for movies - it should show a trailer from the web, then the preroll, before a movie. The web trailer never loads - the spinner just spins and I end up skipping to the preroll which is locally hosted and plays fine, before the movie also “spins” its spinner.

I had assumed this was “another minor problem” and that the trailers were loaded directly from the web by the Plex client (not the server). But what if its the server loading the trailer? What if my plex jail isn’t able to connect outside? How can I test this? I checked the dashboard and it shows the trailer’s frames, and the fact its being transcoded too. I tried ping to test external connectivity, but the command seems to be removed.

root@plex-plexpass:/mnt/transcoder # ping www.google.com
ping: ssend socket: Operation not permitted

Maybe this is worth following? It is weird because FreeNAS has no problem with external connectivity, as does an Ubuntu VM I am running on FreeNAS via Bhyve.

The transcoder is set to NOT use hardware. Its a headless box with mobo video only, but a grunty CPU:
image

The transcode filesystem was already UNIX but did not have the ACL “+” permissions SavioDesign shows here. I updated it and rebooted, but nothing changed with streaming transcoded content:

root@plex-plexpass:/ # getfacl /mnt
# file: /mnt
# owner: nobody
# group: wheel
            owner@:rwxp--aARWcCos:-------:allow
            group@:rwxp--a-R-c--s:-------:allow
         everyone@:rwxpDdaARWcCos:fd-----:allow
root@plex-plexpass:/ # getfacl /mnt/transcoder/
# file: /mnt/transcoder/
# owner: nobody
# group: wheel
            owner@:rwxp--aARWcCos:-------:allow
            group@:rwxp--a-R-c--s:-------:allow
         everyone@:rwxpDdaARWcCos:fd-----:allow
root@plex-plexpass:/

I’ve moved the transcode folder between my shares (mounted under /mnt), but also as a local file elsewhere, and finally as a local file under /mnt (which it is now) all as part of problem solving. I did not have the + but do have it now:

root@plex-plexpass:/mnt # ls -la
total 153
drwxrwxrwx+  8 nobody  wheel   8 Dec 29 14:22 .
drwxr-xr-x  20 root    wheel  24 Dec 23 15:42 ..
drwxrwxrwx   3 nobody  wheel  14 Sep  3 19:18 homemovies
drwxrwxrwx   9 nobody  wheel  20 Dec  2 23:02 itunes
drwxrwxrwx  23 nobody  wheel  81 Dec 28 22:15 movies
drwxrwxrwx   2 nobody  wheel   3 Oct 12  2017 preroll
drwxrwxrwx+  3 nobody  wheel   3 Dec 29 16:02 transcoder
drwxrwxrwx  31 nobody  wheel  33 Dec 24 07:58 tv

Sub folder (for interest/completeness):

root@plex-plexpass:/mnt/transcoder/Transcode/Sessions # ls -la
total 44
drwxrwxrwx+ 3 plex  wheel   3 Dec 29 16:24 .
drwxrwxrwx+ 3 plex  wheel   3 Dec 29 15:00 ..
drwxrwxrwx+ 2 plex  wheel  86 Dec 29 16:24 plex-transcode-thutwjjg6jrptpggi3l4shyx-b3904527-5332-443d-b8de-d7fd25705fd4
root@plex-plexpass:/mnt/transcoder/Transcode/Sessions #

This shows a transcoded stream is being created in the folder (there is chunked content in the folder). This was also happening before the ACL change. Neither resulted in streaming success.

Any other suggestions? (I really appreciate them). Is the network connectivity theory worth pursuing?

Network connectivity should be the first thing you test.
From the command line, log into the jail and run: ping google.com

If you have packet loss or no response, be sure your jail’s network connections are set up properly.

**Verify and Validate the following **
If you are assigning static connections, use automatic (DHCP) connections instead by setting the following from the FreeNAS WebGUI Jail > Edit > Basic properties

  • DHCP Autoconfigure IPv4
  • VNET
  • Berkeley Packet Filter
  • Auto-start

To enforce Static IP assignments to a Jail or any Device log into your router and set reservations in your router’s LAN Setup.
Verify your MAC Adress shown in the LAN setup matches what’s seen on FreeNAS WebGUI Jail > Edit > Network Properties> vnet0_mac

Once this is done, restart your Jail from the command line ( as root)
e.g.
iocage restart plex
or reboot your NAS and it should pick up the assignment at startup.

1 Like

Thanks to xInsertx for his suspicion that codecs weren’t downloading, and SavioDesign for the direct instructions: this problem has been solved!

Root cause: The jail was set to a manual IP address and gateway. Despite the IPv4 default router being set in the FreeNAS jail config under Basic Properties, this did not appear as a default route in the jail itself (netstat -rn had no default route) and I had not checked this previously as indications were external networking was fine (see below). I was unable to add a default route when I found the problem (jail error msg) so I said “#### it” and enabled DHCP.

Transcoding started working immediately.

External networking false positive/Point of confusion: The failure of ping to run was because “allow_raw_sockets” was FALSE under “Jail Properties”. Setting this to true allowed ping to run, and I could then ping external IPs despite the lack of a default route. How? I am unsure. But this lead me to believe my connectivity was fine. I was also able to do the old http webserver connection test “telnet your.website 80” and do a manual “GET /” with two returns, and get a proper HTML response.

I assumed external networking was fine. Evidence said it was!

I still have no idea why it wasn’t fine if I was able to ping, look up host names, and connect to webservers! :-/ But there it is. I will dig on this more when I get time.

Thanks everyone for their input! :smiley:

1 Like

Sorry for the late replies, was off camping.

Good call on figuring out it was the default route, I sometimes forget (being a netsec admin) to run through some basic troubleshooting as it’s thing I just assume people would have done.

I might write up a detailed guide about plex + bsd as we get asked this a fair amount on the freenas forum. I’ve been working with a few people to make a script to install services correctly, setup permissions etc and has some inbuilt troubleshooting, but we still have a few kinks to work out.

1 Like

The killer for me was - there was definitely external network connectivity. It could ping, it could connect to web servers. I just didn’t stop and look at the routes - I should have. I assumed. Obviously it was getting SOME connectivity from somewhere (the guest’s host, presumably), but why it worked for some things and not others, I do not know.

I could easily see this becoming a time burner on the forum. A guide would be a good idea.

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