Yet Another "Can't Add Media To Plex" Post

Status
Not open for further replies.
Joined
May 2, 2017
Messages
211
Looking for advice on what next to try...

I waited to get FreeNAS 11.0-STABLE installed before tackling setting up Plex. I have done a manual installation of Plex following the guide here.

https://forums.freenas.org/index.ph...to-install-plex-in-a-freenas-9-10-jail.19412/

It was written for 9.10, but seemed to work the same on 11.0. It installed a standard template and downloaded and installed Plex 1.5.6.3790-4613ce077. I can access the Plex Web UI, but can't see attached storage. I have created a Plex user and group with the same UID and GID reported for the user in the Plex Jail on FreeNAS. I added a storage component for a movie library to Plex through the Web UI, but it says there is no media in the folder.

1. If I go to the shell for the jail, I can browse the contents of the mounted storage I added (as root), so I'm fairly certain this is another permissions issue. Am I missing something?

2. When I created the plex user on my FreeNAS system, it required me to create a password. Is there a password for the Plex user on the Jail? I'm assuming they should be the same to work correctly?

3. I'm not familiar with Docker or VM's yet. Is there a better, more "future-proof" way of installing Plex? Should I wait for Docker? Make a VM? If you weren't in a hurry to set this up, would you do something different than use a jail, is the question...

4. Or am I just stoopid? :smile:

Any help would be great....
 

styno

Patron
Joined
Apr 11, 2016
Messages
466
Maybe I am missing something, but why are you not installing the Plex jail via the plugin system?
 
Joined
May 2, 2017
Messages
211
I tried it that way too with the same result.

I was mainly looking to have a little more control over the name of the jail, and system updates and such. Figured since neither worked, it didn't really matter. Other than adding storage, everything was as expected.
 

styno

Patron
Joined
Apr 11, 2016
Messages
466
Okay, the plugin should work out of the box (it did for me).
Can you check the following and dump the output here between code-tags?
Code:
#### indentify the plex jail#
[root@yournas] ~# jls
   JID  IP Address	  Hostname					  Path
	 1  -			   plexmediaserver_1			 /mnt/yourpool/jails/plexmediaserver_1

#### drop to a bash shell in the jail
[root@yournas] ~# jexec 1 bash

#### identify the user that started the plex process
[root@plexmediaserver_1 /]# ps aux | grep Plex_Media_Server
plex 24298  0.0  0.8 405336 262516 ??  IsJ  Sun01PM 24:42.94 /usr/pbi/plexmediaserver-amd64/share/plexmediaserver/Plex_Media_Server (Plex Media Server)
root 45208  0.0  0.0  16332   1876  2  S+J   6:50PM  0:00.00 grep Plex_Media_Server

#### verify the permissions on the storage mount points
[root@plexmediaserver_1 /]# ls -la /your/storage/mount/points
 
Joined
May 2, 2017
Messages
211
Give me a bit. I deleted the whole thing while I research what to do... Jails, users, everything... I will have time to reinstall this tomorrow. Perhaps find another step-by-step guide along the way.

Perhaps the more pertinent question is what would you recommend to set up Plex. Using the jail, a VM or wait for Docker support? I'm not married to the idea of a Jail. Is this the most flexible. I'm open to all options at this point...
 

styno

Patron
Joined
Apr 11, 2016
Messages
466
Just use a jail for now, I am pretty sure your only issue with your Plex setup is with permissions.
 
Joined
May 2, 2017
Messages
211
Okay, gonna do a step-by-step here for the benefit of others who stumble across this with similar issues...

1. On the Jails tab, clicked "Create Jail". Gave it a name ('plex'), checked "Autostart" and "VIMAGE" in the advanced options. Verified it had an IP address in the range I set for my jails in the configuration section.

2. Once I click "OK", the system downloaded a standard FreeNAS 11 template, and successfully created the Jail. In my chosen dataset location there is now a ".warden-template-standard" and a "plex" sub-dataset. Jail is running, and has a MAC address and the "allow.raw_sockets=true" in the 'sysctls' field.

3. From a shell prompt, typed "jls" and found the Jail was assigned a JID of '1'.

4. Typed "jexec 1 tcsh" to get a shell prompt from within the Jail.

5. From "root@plex", typed "pkg update && pkg upgrade -y" to apply all current updated packages to the jail.

6. Ran "pkg install multimedia/plexmediaserver" from the Jail shell to install Plex. Setup created a user with a UID of 972 and group with a GID of 972.

7. From the Jail shell, ran "sysrc plexmediaserver_enable=YES" to run Plex at start.

8. From the Jail shell, ran "service plexmediaserver start" to start Plex.

That's where I'll stop until we determine the next step. At this point, I can access the web GUI for Plex as expected, and all works except for my permission issues. Enough for tonight. Let me know what your next setup step would be? And thanks!
 
Joined
May 2, 2017
Messages
211
Code:
USER   PID %CPU %MEM	VSZ   RSS TT  STAT STARTED	TIME COMMAND			 
root 10758  0.0  0.0  13144  2040  -  IJ   22:12   0:00.01 /bin/sh /etc/rc	 
root 11291  0.0  0.0  13144  2112  -  IJ   22:12   0:00.00 /bin/sh /etc/rc	 
root 11295  0.0  0.0  10472  1504  -  IJ   22:12   0:00.00 /usr/sbin/syslogd -s
root 11296  0.0  0.0  10472  1852  -  IsJ  22:12   0:00.00 /usr/sbin/syslogd -s
plex 15236  0.0  0.2 219888 66184  -  IsJ  22:36   0:01.88 /usr/local/share/plex
plex 15239  0.0  0.2 186868 58172  -  INJ  22:36   0:04.29 Plex Plug-in [com.ple
plex 15246  0.0  0.1 142336 20820  -  IJ   22:36   0:00.71 /usr/local/share/plex
plex 15249  0.0  0.1 161232 40636  -  IJ   22:36   0:01.78 Plex Plug-in [com.ple
plex 15250  0.0  0.1 163024 43152  -  IJ   22:36   0:01.90 Plex Plug-in [com.ple
plex 15251  0.0  0.0  76300 11916  -  IJ   22:36   0:00.04 /usr/local/share/plex
plex 15283  0.0  0.1 155600 34336  -  IJ   22:36   0:01.21 Plex Plug-in [com.ple
plex 15293  0.0  0.1 156624 36352  -  IJ   22:36   0:01.44 Plex Plug-in [com.ple
plex 15294  0.0  0.1 159952 38744  -  IJ   22:36   0:01.61 Plex Plug-in [com.ple
plex 15321  0.0  0.1 165840 45504  -  IJ   22:36   0:01.79 Plex Plug-in [com.ple
root 18235  0.0  0.0  19676  3024  0  SJ   22:55   0:00.01 tcsh				 
root 18242  0.0  0.0  21244  2160  0  R+J  22:55   0:00.00 ps aux   
 

SweetAndLow

Sweet'NASty
Joined
Nov 6, 2013
Messages
6,421
Maybe I am missing something, but why are you not installing the Plex jail via the plugin system?
Plugin and jail are exactly the same thing. One just has the ability to turn off the service in the GUI.
 

styno

Patron
Joined
Apr 11, 2016
Messages
466
That's where I'll stop until we determine the next step. At this point, I can access the web GUI for Plex as expected, and all works except for my permission issues. Enough for tonight. Let me know what your next setup step would be? And thanks!
Right, the next step would be to add your storage to the jail. For Plex you can map read-only as in normal conditions, Plex is only used to index, present and transcode the content, not to mess around with it.
ex. Source: /mnt/yourpool/photos mapped as read-only on Destination: /mnt/photos.
Now you should be able to add a new photo library from within the Plex web gui and point it to /mnt/photos.

If this gives an error, please provide the output of ls -al /mnt; ls -al /mnt/photos
 
Joined
May 2, 2017
Messages
211
Code:
root@plex:/ # ls -al /mnt										 
total 37																		
drwxr-xr-x	3 root  wheel	3 Jun 25 09:00 .								 
drwxr-xr-x   17 root  wheel   21 Jun 24 22:06 ..								
drwxrwx---  448 1234  4321   448 May  9 22:42 Music							 
root@plex:/ # ls -al /mnt/Music/Boston/Boston					 
total 19172																	 
drwxrwx---  2 1234  4321		 5 May  9 20:43 .							   
drwxrwx---  4 1234  4321		 4 May  9 20:43 ..							 
-rw-r--r--  1 1234  1234   4578913 Jul  7  2015 More Than A Feeling.MP3		 
-rw-r--r--  1 1234  1234  12106892 Jul  7  2015 Peace Of Mind.mp3			   
-rw-r--r--  1 1234  1234   2904155 Jul  7  2015 Rock & Roll Band.MP3			
root@plex:/ # id plex											 
uid=972(plex) gid=972(plex) groups=972(plex)	 


I think I know where we're headed here, just not sure the best route... Relatively recent UNIX convert here, so bear with me. I know the concepts, just not the commands.

For those following along at home... My permissions are set to give every user the same UID (user) and GID (group) on all systems in the house, including the NAS. This allows a pure native NFS environment, and keeps permissions and access consistent. Say a user has a UID and GID of 1111 on everything. His permissions follow him from any machine, and his access to NAS storage is the same everywhere on the local LAN.

In my setup, I created a user/group for family members to enable shared access. There is a USER, as in the code above, with a UID of 1234. That user belongs to a GROUP, with a GID of 4321. That's the family account. The family account controls the files under their account, but if I add a family members UID (say 1111) to the family group (4321), that family member (1111) can access the shared family resources. That's a mouthful, but I don't think it's all too uncommon.

Now the question for the UNIX guru's is how to get Plex to have access to this stuff? Plex is UID 972 and GID 972. I like what I have so far on my home setup, so I'd rather make Plex bend to the will of my network, rather than make my network bend to Plex. The network is the one in control, Plex is a convenience... So now for how to make that happen?

Thanks again...
 

SweetAndLow

Sweet'NASty
Joined
Nov 6, 2013
Messages
6,421
Code:
root@plex:/ # ls -al /mnt										 
total 37																		
drwxr-xr-x	3 root  wheel	3 Jun 25 09:00 .								 
drwxr-xr-x   17 root  wheel   21 Jun 24 22:06 ..								
drwxrwx---  448 1234  4321   448 May  9 22:42 Music							 
root@plex:/ # ls -al /mnt/Music/Boston/Boston					 
total 19172																	 
drwxrwx---  2 1234  4321		 5 May  9 20:43 .							   
drwxrwx---  4 1234  4321		 4 May  9 20:43 ..							 
-rw-r--r--  1 1234  1234   4578913 Jul  7  2015 More Than A Feeling.MP3		 
-rw-r--r--  1 1234  1234  12106892 Jul  7  2015 Peace Of Mind.mp3			   
-rw-r--r--  1 1234  1234   2904155 Jul  7  2015 Rock & Roll Band.MP3			
root@plex:/ # id plex											 
uid=972(plex) gid=972(plex) groups=972(plex)	 


I think I know where we're headed here, just not sure the best route... Relatively recent UNIX convert here, so bear with me. I know the concepts, just not the commands.

For those following along at home... My permissions are set to give every user the same UID (user) and GID (group) on all systems in the house, including the NAS. This allows a pure native NFS environment, and keeps permissions and access consistent. Say a user has a UID and GID of 1111 on everything. His permissions follow him from any machine, and his access to NAS storage is the same everywhere on the local LAN.

In my setup, I created a user/group for family members to enable shared access. There is a USER, as in the code above, with a UID of 1234. That user belongs to a GROUP, with a GID of 4321. That's the family account. The family account controls the files under their account, but if I add a family members UID (say 1111) to the family group (4321), that family member (1111) can access the shared family resources. That's a mouthful, but I don't think it's all too uncommon.

Now the question for the UNIX guru's is how to get Plex to have access to this stuff? Plex is UID 972 and GID 972. I like what I have so far on my home setup, so I'd rather make Plex bend to the will of my network, rather than make my network bend to Plex. The network is the one in control, Plex is a convenience... So now for how to make that happen?

Thanks again...
Your descriptions are correct. To get Plex to do what you want create that family group in the jail with the correct gid then add the plex user in the jail to that group. A user can be a member of multiple groups.

Sent from my Nexus 5X using Tapatalk
 
Joined
May 2, 2017
Messages
211
1. Ran "pw group add GROUPNAME -g 4321"

2. Ran "pw user mod plex -G GROUPNAME"

This should mean that plex is now a member of the family member group who can read the files everywhere else, but I still get a message there is no content in the mounted location...

Code:
root@plex:/ # ls -la /mnt/Music/Boston/Boston					 
total 19172																	 
drwxrwx---  2 1234  GROUPNAME		 5 May  9 20:43 .							 
drwxrwx---  4 1234  GROUPNAME		 4 May  9 20:43 ..							
-rw-r--r--  1 1234 1234	 4578913 Jul  7  2015 More Than A Feeling.MP3	   
-rw-r--r--  1 1234 1234	12106892 Jul  7  2015 Peace Of Mind.mp3			 
-rw-r--r--  1 1234 1234	 2904155 Jul  7  2015 Rock & Roll Band.MP3 


So the files are owned by the users primary group, but the folders are owned by the family's shared group? Now I can play these files using another user who is a member of the family group, even though they are owned this way... Just not in Plex. So I'm confused...
 
Joined
May 2, 2017
Messages
211
Created a user called 'plex' on FreeNAS and set its Primary Group to the shared family group, and all works now... Couple questions?

1. When creating the user on FreeNAS, it required a password. What does "Disable Password Login" do under FreeNAS User Settings? If I enable that (to disable password login), will that block access to the files again? Plex is adding them, so I don't want to make them disappear. LOL

2. Any security implications here? Just from what you see in what I've described...?

Hope this thread helps others narrow down Plex and permission issues...
 

SweetAndLow

Sweet'NASty
Joined
Nov 6, 2013
Messages
6,421
Created a user called 'plex' on FreeNAS and set its Primary Group to the shared family group, and all works now... Couple questions?

1. When creating the user on FreeNAS, it required a password. What does "Disable Password Login" do under FreeNAS User Settings? If I enable that (to disable password login), will that block access to the files again? Plex is adding them, so I don't want to make them disappear. LOL

2. Any security implications here? Just from what you see in what I've described...?

Hope this thread helps others narrow down Plex and permission issues...
There is no way a user called Plex being added to freenas made this work.

What I want to know is why you keep referring to the gid as 4321 when the files have a group of 1234?

Sent from my Nexus 5X using Tapatalk
 
Joined
May 2, 2017
Messages
211
Oh, but it did... LOL

There is a user (UID 1234) with a matching group for that user of the same name (GID 1234). Then there is a group which I made for family members (GID 4321). I create the individual user (1234) and add him as a member of the family group (4321). When I apply owner permissions to the folder and subfolders, the folder owner becomes the family group of (4321), but files are retaining the ownership of the user that created them (1234).

This appears to be why Plex can't see the files within these folders, but if you then create a matching Plex account on FreeNAS and add it as a member of the same family members group (4321), suddenly they all appear.
 

joebpa

Dabbler
Joined
Feb 8, 2018
Messages
11
I've been trying to follow this thread and i'm getting a head ache. I have been reading so many threads on Plex installs and they all appears to be saying the same yet things are not working. I have run a couple commands found on other threads and noticed that my system doesn't appear to be seeing Plex correctly. I assume it is the user permissions issue again. I have been following an older post that steps it through the GUI install of Plex Media Server and that had always worked prior to 11.1-U1. I would like to send my info on what command and the responses I got but I am not familiar with how to use the tags. Before I post can I get a little know how help. I have been keeping my running installation guide up to date, but this one has got me.
 

Redcoat

MVP
Joined
Feb 18, 2014
Messages
2,925
A demo here: I'll put your above post in code tags by selecting the "code box" in the line above and pasting it in there:

Code:
I've been trying to follow this thread and i'm getting a head ache. I have been reading so many threads on Plex installs and they all appears to be saying the same yet things are not working. I have run a couple commands found on other threads and noticed that my system doesn't appear to be seeing Plex correctly. I assume it is the user permissions issue again. I have been following an older post that steps it through the GUI install of Plex Media Server and that had always worked prior to 11.1-U1. I would like to send my info on what command and the responses I got but I am not familiar with how to use the tags. Before I post can I get a little know how help. I have been keeping my running installation guide up to date, but this one has got me.


So, select and copy off the shell display (or better, SSH in and copy from there), then past it in between the code tags as above.
 

joebpa

Dabbler
Joined
Feb 8, 2018
Messages
11
Ok, Let me start by saying I did figured out my issue adding movies to my web interface. When adding a library in the browse area I was using Media instead of media. Yes it is case sensitive and that got me. LOL I'm curious why i do not show a mounted storage folder in my jail when i run these commands? If i create a subfolder it does display. Is this just normal behavior. Maybe I just dont understand the structure yet. Feel free to educate me. This is what i have been checking:
____
root@freenas:~ # id media
uid=8675309(media) gid=8675309(media) groups=8675309(media)
root@freenas:~ # ls -l /mnt
total 5
-rw-r--r-- 1 root wheel 5 Feb 18 14:56 md_size
drwxr-xr-x 4 root wheel 4 Feb 18 16:40 NAS
root@freenas:~ # jls
JID IP Address Hostname Path
1 plexmediaserver_1 /mnt/NAS/Jails/plexmediaserver_1
root@freenas:~ # jexec 1 tcsh
root@plexmediaserver_1:/ # ls -la /media
total 14
drwxr-xrwx 2 root wheel 2 Feb 18 20:45 .
drwxr-xr-x 18 root wheel 22 Feb 18 16:45 ..
root@plexmediaserver_1:/ # ls -la /mnt
total 14
drwxr-xr-x 2 root wheel 2 Sep 28 2016 .
drwxr-xr-x 18 root wheel 22 Feb 18 16:45 ..
root@plexmediaserver_1:/ #
____
 

joebpa

Dabbler
Joined
Feb 8, 2018
Messages
11
I think i posted that wrong. I should have used the Code tags..SMH
 
Status
Not open for further replies.
Top