Plex: no write access to destination

NJMorf

Explorer
Joined
Aug 9, 2017
Messages
53
I've read a number of posts on this subject but can't work out what I should be doing to fix this.

I have Plex running in a jail, transferred from the plugin version, set up as described here. My media files are split across two volumes, volume_1/Media and volume_2/Media: first one has TV, music and photos, second has movies. Each volume has a Media folder: the Plex jail has the first mapped to /media and the second to /media/Movies. Plex is working normally with the vol1 dataset (TV shows are recorded successfully) but every time I tell it to record a movie to the vol2 dataset, it immediately fails saying it has no write access to the destination.

Both Media datasets have root and wheel as owner and group. Permission type is Unix, with all of the mode boxes ticked. I have repeatedly tried to update the permissions on the affected volume_2/Media dataset (which then contains a Movies folder) with the recursive permissions box ticked but it seems to make no difference.

I don't have a Plex user account set up: I don't recall exactly why this is, or whether it was a deliberate choice by me or by the installation process (sorry). I have successfully recorded many films to the current vol2/Media/Movies folder, but not for at least a month. I did recently update FreeNAS from 11.1-U6 (or possibly -U7) to 11.2 but I don't know if the current problem predates or postdates that update.

I have had to repeatedly change the permissions on several of the datasets in the past, as users/groups (both remote computers and the Plex server) lost write access to them in the past, but recursively setting the permissions (to the same as they were actually showing at the time) seemed to fix it. This time, though the affected dataset is showing all permissions set except for Other-Write, it isn't accepting the permission changes I'm trying to make: I have tried and failed to both recursively set the unticked box and recursively clear all of the ticked boxes. I can, however, change the group owner. Regardless of the permission settings, I'm still able to create and delete both folders and files in the Movies dataset from my Win 10 machines, whose users are in a group I set up called Shares.

I've also tried using chmod to change permissions for the volume_2/Media/Movies folder from the command line with the same lack of success. Can anyone please suggest where I might be going wrong?

Thanks in advance.
 

nojohnny101

Wizard
Joined
Dec 3, 2015
Messages
1,478
go into the shell of your jail then type:

id plex

the return should look something like this:
Code:
root@plex:/ # id plex
uid=972(plex) gid=972(plex) groups=972(plex),1001(Media)


you need to create a user on the freenas side with the same UID. that is how you get permissions to work. the user accounts of a jail and the regular freenas (host) are completely separate. This is outlined quite clearly in the freenas manual:

Freenas 11.2-RELEASE Manual
 
Last edited:

NJMorf

Explorer
Joined
Aug 9, 2017
Messages
53
Thanks for the pointers. I've done as you suggested, creating a new plex user and group with the UID and GID reported in the jail. I've also added the new plex user to the wheel group which owns the storage, but none of that appears to have made any difference: Plex still can't access that share, nor can I change the permissions in the share either through the web interface or the command line: when I use the web interface, a message pops up instantaneously saying that the changes have been applied, but when I look again there is no change. Whenever I try to use chmod -R, I get error messages against each folder saying that the operation is not permitted. I suspect that if I could change the permissions, the new account would probably have access, but something is clearly stopping me from doing that.

Can anyone suggest anything else?
 

nojohnny101

Wizard
Joined
Dec 3, 2015
Messages
1,478
Can you layout your directory structure and your mappings a bit more clearly? perhaps in this format.

/parent directory
--------/child directory
 

SweetAndLow

Sweet'NASty
Joined
Nov 6, 2013
Messages
6,421
I wouldn't mount your dateset on top of another dataset in the jail. Make your mount paths not nested.
 

NJMorf

Explorer
Joined
Aug 9, 2017
Messages
53
The pool is named volume_2, consisting of two mirrored 3TB disks.

volume_2
-/Backups
-/Cloud
-/FileHistory
-/Media
-/jails

The Media dataset only contains a Movies folder (and its children). There are three jails, including Plex.

I have mounted the /Media/Movies folder as /media/Movies in Plex's jail. This is in addition to an earlier mount, volume_1/Media mounted as /media in the Plex jail.

I also have three other mounts in the Plex jail, including one for Plex's server data. The first two of these three are mounted to subfolders of /media. None of the mounts, other than the volume_2/Media/Movies folder, are misbehaving, as far as I am aware.
 

SweetAndLow

Sweet'NASty
Joined
Nov 6, 2013
Messages
6,421
The pool is named volume_2, consisting of two mirrored 3TB disks.

volume_2
-/Backups
-/Cloud
-/FileHistory
-/Media
-/jails

The Media dataset only contains a Movies folder (and its children). There are three jails, including Plex.

I have mounted the /Media/Movies folder as /media/Movies in Plex's jail. This is in addition to an earlier mount, volume_1/Media mounted as /media in the Plex jail.

I also have three other mounts in the Plex jail, including one for Plex's server data. The first two of these three are mounted to subfolders of /media. None of the mounts, other than the volume_2/Media/Movies folder, are misbehaving, as far as I am aware.
Try changing it so it's not nested
 

Mehul V

Explorer
Joined
Oct 17, 2015
Messages
53
The pool is named volume_2, consisting of two mirrored 3TB disks.

volume_2
-/Backups
-/Cloud
-/FileHistory
-/Media
-/jails

The Media dataset only contains a Movies folder (and its children). There are three jails, including Plex.

I have mounted the /Media/Movies folder as /media/Movies in Plex's jail. This is in addition to an earlier mount, volume_1/Media mounted as /media in the Plex jail.

I also have three other mounts in the Plex jail, including one for Plex's server data. The first two of these three are mounted to subfolders of /media. None of the mounts, other than the volume_2/Media/Movies folder, are misbehaving, as far as I am aware.
So you have two things mounted to your Plex jail:

Code:
/Media/Movies --> /media/Movies
volume_1/Media --> /media

Do you realize you are trying to mount two things to /media?


I would change this to something like this:
Code:
volume_2/Media/Movies-->/mnt/volume1/media
volume_1/Media      -->    /mnt/volume2/media

Then inside the jail, you can mount both inside either a single movie library(Movies) or as two separate libraries(English/Foreign):

Code:
/mnt/volume1/media
/mnt/volume2/media
 

NJMorf

Explorer
Joined
Aug 9, 2017
Messages
53
The mounts were nested as an attempt to make the movies folder appear in the same file structure as the rest of the media so that I wouldn't have to have Plex rebuild its database. While that didn't really work, and I have no real idea why I didn't redo it, I don't think it was really a problem. Plex was able to read and write to the Movies folder mounted from volume_2 for months without issue. Would where I mounted the folder really cause my primary problem here, which is the inability to change permissions on the dataset?

This is probably all becoming redundant. I'm in the middle of moving jails and datasets off of volume_2 and onto volume_1 so that I can destroy volume_2 and reuse the drives the way I should have done this in the first place, as another vdev on volume 1. It's taking hours to copy media files over the network onto an external drive to temporarily make room for the transfer, but I'm hopeful that everything, or mostly everything, will be working again when I'm done. The problem dataset will have been destroyed along with the pool.
 

oumpa31

Patron
Joined
Apr 7, 2015
Messages
253
I finally had time to set up my antenna and hd homerun box. Now I'm trying to record tv directly with plex and every time i try to record something i get this error. I set up a plex user per what is below per my freenas.

root@plex:/ # id plex
uid=972(plex) gid=972(plex) groups=972(plex)

I also made sure i added the Plex user to Wheel so it would have full access to write

my folder setup is as below

Source Destination
/mnt/Zeus/Plex/Movies /mnt/Plug-Ins/iocage/jails/plex/root/Movies
/mnt/Zeus/Plex/TV_Series /mnt/Plug-Ins/iocage/jails/plex/root/TV

I'm not sure where to go from here.
 

oumpa31

Patron
Joined
Apr 7, 2015
Messages
253
UPDATE:

I added the Plex user to the top Level "/mnt/Zeus" since it is a windows share it added the user to all folders under that Volume. Once that was done it had no problems recording from plex live tv.
 
Top