trouble with apps accessing folder permissions

Myths

Cadet
Joined
May 10, 2022
Messages
3
hi i have my folders setup threw the apps and i can see them on the apps but when i try to save changes i get directory error accessing. i do not see anywhere in the apps setting to give it permissions other than showing it where the folders are to use. i have changed folder permissions from root to main user. im not finding any other answers for scale.
 

morganL

Captain Morgan
Administrator
Moderator
iXsystems
Joined
Mar 10, 2018
Messages
2,694
Suggest you focus on one app and work out what user it is.
 

jack123

Dabbler
Joined
May 14, 2022
Messages
11
Hi
I have the same problem but with plex but cant seem to find the plex default user to give it permissions.
 

dontplexonme

Dabbler
Joined
May 13, 2022
Messages
10
So this is what I did to fix permissions,
Originally I came from a Ubuntu Docker server and just wanted to migrate all my files over.

Created the smb share, set ACL and transferred the configuration files over.

Created another user named plex, and set permissions to full access then selected the box that said set permissions recursively then confirm it (it will warn you it may break things)

The docker apps started working with the plex user with the exception of Tdarr that is still broken some how? But yeah

Give that a shot!
 

mervincm

Contributor
Joined
Mar 21, 2014
Messages
157
Hi
I have the same problem but with plex but cant seem to find the plex default user to give it permissions.
If you are using the default plex app, I believe it is UID1000. I swapped to the TrueCharts Plex app to make things more obvious
 

mervincm

Contributor
Joined
Mar 21, 2014
Messages
157
My approach has for app permissions in scale has been

(Note: this is not the way if you want support from TrueCharts, just what worked for me)

1) IDs and Groups
-create new ID&Group ahead of time and have UID/GID the same number for simplicity
-create them for each app you have (say radarr)
-create one called media

2) Directory Structure
-your directory structure looks like this
-for app config (ssdpool is the pool I happen to use for my apps)
/ssdpool/radarr

-for media (HDDpool is the pool I use for my plex media and dl locations)
hddpool/data
hddpool/data/media
hddpool/data/media/movies

3) Datasets
-for each app that requires app config storage, you can use the default PVC, but I chose to instead create a dataset on (ssdpool) ssdpool/radarr
-(I believe ix and TC will suggest you use PVC, but I have not yet figured them out to the degree that I am comfortable yet)

4) APP config
-appconfig storage is hostpath(simple) from /mnt/ssdpool/radarr
-apps that need access to media get a custom storage hostpath(simple) from /mnt/hddpool/data to /data
-PUID is set to radarr
-UMASK is set to 002
-runAsUser is set to radarr
-runAsGroup is set to media
-fsGroup is set to media

5) Ownership/Permissions
-ssdpool/radarr
-ownership: user:radarr group:radarr
-permissions user rwe, group r-e, other ---

-hddpool/data/media/movies folder (set via a script)
-ownership user:radarr group:media
-permissions files:664 folders:775

**edit fixed an error, added a missing value in App config**
 
Last edited:

jack123

Dabbler
Joined
May 14, 2022
Messages
11
Thx for the reply. I created plex(PV i guess, available applications) on a ssd (/ssdpool/radarr), my mediafolder is /mnt/spaceNas/media, /mnt/spaceNas/media/movies, /mnt/spaceNas/media/tvshows.
Since i am a novice i have a few questions. So here goes.
-create one called media (create one what? and what user should it have)
Set PUID, UMASK, RUNASU, FSgroup how?
Set permissions via script?

Thx
 
Last edited:

mervincm

Contributor
Joined
Mar 21, 2014
Messages
157
-create one called media (create one what? and what user should it have)
Create a user called media and a group called media. I create them with common UID/GID number for clarity.
1652831655197.png
1652831692579.png

Set permissions via script?
Here is a chunk of a script I cobbled together from Dr. google :) .It will display owners and permissions set differently than what I would like, then change them to what I would like them to be. It is wordy as hell but that is just to help me recall just what each chunk is doing.
I have a chunk just like this for each type of media.
I added delays in case I didn't actually want to continue to perform a task, I can just cancel out

Code:
echo "Find and fix Ownership/Permissions errors in Media folders"
sleep 2
echo
echo
echo
echo "Step (1)  Movies"
echo
echo "     (1a) Movies:ownership. Files/folders should have owner user:radarr group:media"
echo
echo "          Finding files/folders with owner user not set to radarr"
sleep 2
find /mnt/hddpool/data/Media/Movies ! -user radarr -ls
echo
echo "          Finding files/folders with owner group not set to media"
sleep 2
find /mnt/hddpool/data/Media/Movies ! -group media -ls
echo
echo "          Fixing files/folders with owner user:group not set to radarr:media"
sleep 2
chown -R radarr:media /mnt/hddpool/data/Media/Movies
echo
echo "     (1b) Movies:permissions. Files/Folders should have permissions 664/775"
echo
echo "          Finding files with permissions not set to 664"
sleep 2
find /mnt/hddpool/data/Media/Movies -type f ! -perm 664 -ls
echo
echo "          Finding folders with permissions not set to 775"
sleep 2
find /mnt/hddpool/data/Media/Movies -type d ! -perm 775 -ls
echo
echo "          Fixing files with permissions not set to 664"
sleep 2
find /mnt/hddpool/data/Media/Movies -type f -exec chmod 664 '{}' ';'
echo
echo "          Fixing folders with permissions not set to 775"
sleep 2
find /mnt/hddpool/data/Media/Movies -type d -exec chmod 775 '{}' ';'
echo




Set PUID, UMASK, RUNASU, FSgroup how?
TrueCharts Application Settings (This is for TrueChart Radarr application, 1003 is the UID for my user radarr)
1652831936038.png
 

jack123

Dabbler
Joined
May 14, 2022
Messages
11
Hej
Thx for the help. My plex is installed from the default applications, i guess ill have to think on this. There should be a way to change app config without having to install docker.
 
Last edited:

mervincm

Contributor
Joined
Mar 21, 2014
Messages
157
I moved away from trying to use the docker-compose option to using the TrueCharts apps, and things are working much better.
 

jack123

Dabbler
Joined
May 14, 2022
Messages
11
One would think there should be a simple tutorial somewhere, but no dice.
 

jack123

Dabbler
Joined
May 14, 2022
Messages
11
Little update, i suspect its not the permissions thats causing me not see files in plex.
In local nfs share i can access files but not in truenas shell with ls. It has something to do with nfs share and datasets, although i dont have an idea what.
 

mervincm

Contributor
Joined
Mar 21, 2014
Messages
157
If you are running plex locally and using Linux style owner and permissions it’s pretty straight forward. the Plex ID goes in the group that owns all your media and make sure to apply enough permissions so that the group has read and execute to the media files and folders
 

jack123

Dabbler
Joined
May 14, 2022
Messages
11
I believe i have done that.
root@truenas[~]# ls -la /mnt/spaceNas/media
total 13
drwxrwxrwx 5 plex plex 5 May 22 18:24 .
drwxrwxrwx 3 root root 3 May 22 11:46 ..
drwxrwxrwx 4 plex plex 4 May 22 18:24 .Trash-1000
drwxrwxrwx 2 plex plex 2 May 12 23:14 movies
drwxrwxrwx 2 plex plex 2 May 12 23:14 tvshows
root@truenas[~]# ls -la /mnt/spaceNas/media/movies
total 12
drwxrwxrwx 2 plex plex 2 May 12 23:14 .
drwxrwxrwx 5 plex plex 5 May 22 18:24 ..
root@truenas[~]# ls -la /mnt/spaceNas/media/tvshows
total 12
drwxrwxrwx 2 plex plex 2 May 12 23:14 .
drwxrwxrwx 5 plex plex 5 May 22 18:24 ..
root@truenas[~]# ls -la /mnt/spaceNas/
total 12
drwxrwxrwx 3 root root 3 May 22 11:46 .
drwxrwxrwx 5 root root 5 May 22 11:49 ..
drwxrwxrwx 5 plex plex 5 May 22 18:24 media
root@truenas[~]#
I suspect it has to do with this
root@truenas[~]# cat /etc/exports

"/mnt/spaceNas/media"\
*(sec=sys,rw,no_subtree_check)
root@truenas[~]#
 

truecharts

Guru
Joined
Aug 19, 2021
Messages
788
One would think there should be a simple tutorial somewhere, but no dice.
We've multiple tutorials for this available though...

Generally we **heavily** advice not to do any of the customisations @mervincm did, definately not as a first time user of TrueCharts apps.
 

truecharts

Guru
Joined
Aug 19, 2021
Messages
788
If you are running plex locally and using Linux style owner and permissions it’s pretty straight forward. the Plex ID goes in the group that owns all your media and make sure to apply enough permissions so that the group has read and execute to the media files and folders
But he's not, he's most likely using NFSv4 style ACL's, considering he talked about NFS shares on the same datasets.
 

jack123

Dabbler
Joined
May 14, 2022
Messages
11
├─/mnt/scale 192.168.1.11:/mnt/spaceNas/media nfs4 ......
├─/mnt/movie 192.168.1.11:/mnt/spaceNas/media/movies nfs4 .....
└─/mnt/tv 192.168.1.11:/mnt/spaceNas/media/tvshows nfs4 .....
Is this correct or do i have to have a separate nfs share for each mountpoint?
 

jack123

Dabbler
Joined
May 14, 2022
Messages
11
Hi
Tried truechart and didnt get that either to work either. I fully admit the fault lies with me and my inexperience with this.
Thx for everyone who tried to help.
Update:I got it to work. I set permission for my mountingpoints(movies and tv) with chmod in local on ubuntu and set 2 seperate nfs share(movies and tv) in truenas . That said i cant explain it.
 
Last edited:

mervincm

Contributor
Joined
Mar 21, 2014
Messages
157
We've multiple tutorials for this available though...

Generally we **heavily** advice not to do any of the customisations @mervincm did, definately not as a first time user of TrueCharts apps.
Do you mean the permission script? I am just trying to follow the best practices folks developed for docker-based configs as much as I can in Scale.
 

truecharts

Guru
Joined
Aug 19, 2021
Messages
788
Do you mean the permission script? I am just trying to follow the best practices folks developed for docker-based configs as much as I can in Scale.

Nope... That was about your changes to permissions on our apps, like we said "the customisations", you script is generally fine.

The permissions issue should be fixed (as well as remove the need for any permissions script) by the changes soon to be pushed, see our recent announcement for that...
 
Top