Plex Permission Woes

jhax

Dabbler
Joined
May 22, 2023
Messages
32
Greetings,

After banging my head against a wall for several hours, I am reaching out for help. I am unable to view my media folders within plex.

My Setup:
Terramaster unit set up to run truenas.

Disk mounts and app/media storage locations within disks
jailhouse --- pms (as setup via the danb35 script)

mnt/disk1/media/Movies (this is also a dataset within my disk1 pool set up within truenas, as instructed here)
- I had set up a plex 972 user and plex group 1000​
- Dataset was owned by root/wheel with user: plex; access = full control; recursive; inherit on and group: plex; access = full control; recursive; and inherit on​
- mount point set up to /mnt/disk1/media/Movies points to /mnt/jailhouse/iocage/jails/pms/root/media​
- adding plex user to media group within the accounts UI in truenas​

With these settings I was able to navigate to /media in plex, however, my Movies directory is viewable, but inaccessable (grayed out)

Things I have tried:
chown plex:plex (and media:media) on the Movies dataset from within my truenas CLI
changing the owner and group to plex:plex (and media:media) within the truenas Edit Permissions UI
chmod 777 for the directory (and subsequent child directories) via the CLI
viewing and changing ownership and permissions from within the pms jail console
setting the plex user's permissions wide open within the Edit User UI

I cant think of anything else, any assistance would be appreciated.

Cheers,
Justin
 
Joined
Jan 7, 2015
Messages
1,155
Via the CLI enter the jails console, iocage exec pmsgo to cd /media and see who owns the mounted files according to the jail. ll

Who owns the files? Maybe post a screenshot.

Also the plex user should have a group ID of 972 as well.
 

jhax

Dabbler
Joined
May 22, 2023
Messages
32
1711596657940.png
 
Joined
Jan 7, 2015
Messages
1,155
Hmm. What about the files inside Movies? I can tell that the plex jail does not know who the media user is. In the old days the media user was auto created with the user/group id of 8675309 jenny jenny lol... Add media user to jail with user/group id 8675309, possibly fixes it. However,....

Also if the main goal is plex, then let plex own it, all of it. That alone might cure all of this.. root can always access it. Just make sure you do it from the GUI as the GUI wont let you break things. Make sure the plex user/group is 972 on jail and host and let plex/972 just own it. And if anything anyone else needs access to the data add that user to the plex/972 group. And dont create separate jail for all accompanying softwares install in same jail, or repeat this issues.

The news is BSD is going away anyhow, so jails as we know them are dying. Sad, they are so good.

Edit: The plus sign at the end of the drxr-xr etc means the files are governed by ACL permissions, well im here to say they suck.. Stick to linux style permissions and have less issues.
 
Last edited:

jhax

Dabbler
Joined
May 22, 2023
Messages
32
No such luck.

1711749590970.png


Outside the jail:

1711748470426.png


Inside the jail:
1711748659053.png
 
Last edited:

victort

Guru
Joined
Dec 31, 2021
Messages
973
Joined
Jan 7, 2015
Messages
1,155
So those are your datasets mounted into the /media location within the jail. Anything removed from here will remove it.

But you still have something not quite configured right. You really should not be seeing numbers as owners. From the look of this plex should be able to read those directories.

Can you please verify what user and group id plex has according to the host cat /etc/passwd from the host CLI), and according to the jail iocage exec pms then cat /etc/passwd plex should be at the bottom of the lists and should say something very close to:
plex:*:972:972:Plex Media Server:/nonexistent:/usr/sbin/nologin

On both. So let me know if this is or isnt the case.

Also who is user 1003?
 
Joined
Jan 7, 2015
Messages
1,155
And to add the media (8675309) user to the jail do these from the jail command line while you are in there.

pw useradd -n media -u 8675309 -d /nonexistent -s /usr/sbin/nologin
pw groupadd -n media -g 8675309
pw groupmod media -m plex

Also whoever user 1003 is according to the host you might as well just add them to the jail as well.. Just edit and repeat the above commands for the 1003 user/group whoever it is fill in with the correct name....

pw useradd -n ???? -u 1003 -d /nonexistent -s /usr/sbin/nologin
pw groupadd -n ???? -g 1003
pw groupmod ???? -m plex -m media

Now at very least it should not be showing you numbers as group owners of the files. Once you have verified the plex user/group is 972 on both host and jail, from the jails CLI id do chown -R plex:plex /media && chmod -R 774 /media

You might also need to do this to your other jails as well if you have any. IMO its a great idea to just install everything to one jail for this very reason.
 
Last edited:

jhax

Dabbler
Joined
May 22, 2023
Messages
32
So those are your datasets mounted into the /media location within the jail. Anything removed from here will remove it.

But you still have something not quite configured right. You really should not be seeing numbers as owners. From the look of this plex should be able to read those directories.

Can you please verify what user and group id plex has according to the host cat /etc/passwd from the host CLI), and according to the jail iocage exec pms then cat /etc/passwd plex should be at the bottom of the lists and should say something very close to:
plex:*:972:972:Plex Media Server:/nonexistent:/usr/sbin/nologin

On both. So let me know if this is or isnt the case.

Also who is user 1003?
1711816496444.png


Bottom is host CLI top is within the jail

1711816568320.png
 

jhax

Dabbler
Joined
May 22, 2023
Messages
32
Okay, I have everything updated, Ill give it another go.

Here is inside the jail

1711817496578.png


Outside the jail

1711817651928.png


Here is the passwd file again

1711817983454.png


Still no access to my content within plex
 
Last edited:

victort

Guru
Joined
Dec 31, 2021
Messages
973
Okay, I have everything updated, Ill give it another go.

Here is inside the jail

View attachment 77199

Outside the jail

View attachment 77200

Here is the passwd file again

View attachment 77201

Still no access to my content within plex
Ok. So you can't mount a dataset with datasets underneath and have it work properly. You need to mount ALL the datasets for the files to show up. So if you have a dataset called "media" with sub-datasets underneath it, you need to mount ALL the sub-datasets also. It's just how jails work.
 

jhax

Dabbler
Joined
May 22, 2023
Messages
32
They are all mounted to media. Should I just destroy the jail, delete the sub datasets and re-install?
 

victort

Guru
Joined
Dec 31, 2021
Messages
973
They are all mounted to media. Should I just destroy the jail, delete the sub datasets and re-install?
You need to mount each dataset to its own folder. Movies should be mounted to media/Movies etc…
 
Joined
Jan 7, 2015
Messages
1,155
So this is something I wouldnt have caught. He is saying to create the directories Movies, Shows, Music, etc.. within the plex jail inside /media so give that a try. From CLI,

iocage exec pms
cd /media
mkdir Movies Shows Music
chown plex:plex Movies Shows Music

Then adjust your mounts to the new locations i.e media/Movies etc. and not just media.
 

victort

Guru
Joined
Dec 31, 2021
Messages
973
So this is something I wouldnt have caught. He is saying to create the directories Movies, Shows, Music, etc.. within the plex jail inside /media so give that a try. From CLI,

iocage exec pms
cd /media
mkdir Movies Shows Music
chown plex:plex Movies Shows Music

Then adjust your mounts to the new locations i.e media/Movies etc. and not just media.
You don’t have to create the directories. Just fill them out when mounting and they will be autocreated.
 
Top