FreeNAS 11 - Media Permission problem

Status
Not open for further replies.

Yakje

Explorer
Joined
Feb 8, 2017
Messages
82
Version : FreeNAS-11.0-U4

I recently setup FreeNAS 11 and am currently trying to get everything up and running. Most of the jails i installed using the following guide: FN 11 Jails Setup
All of the jails like: Sabnzbd, Sonarr, Radarr & Headphones are already up and running, but i just can't seem to connect them to my media dataset.

For example in Radarr i get the following error:
radarr error.jpg

This is how i setup my datasets (every jail has a separate dataset under the "apps" dataset for config files):
volumes.jpg

These are my jails + the mounts:
jails.jpg mounts.jpg

I changed the permissions of the /mnt/tank/media dataset (with "set permission recursively" enabled) to the default FreeNAS media user/group with UID&PGID "8675309" (also not sure if i should use this default media user and group or create a new one myself?):
media volume permissions.jpg

This is the output i get when performing the cmd ls - l inside the radarr jail:
radarr jail.jpg

I do have a user&group radarr:radarr which has access to the config files, but I'm not sure which command I should use to enable radarr and all of the other jails access to the media dataset.
 
Last edited by a moderator:

Yakje

Explorer
Joined
Feb 8, 2017
Messages
82
Anyone who can help me out here? still have not been able to fix the problem :S
 

Glorious1

Guru
Joined
Nov 23, 2014
Messages
1,211
In your last image, the file listing of radarr, it shows the directory media is owned by root. Who is the owner and what are the permissions of the directories inside? That could be a problem unless the radarr user is root.

You might want to show your Jails > Storage configuration (source-destination) too.

One solution is to set everything to permissions 777, which lets anybody do anything. The following is more work but allows more limited permissions:

In FreeNAS WebGUI, set permissions for Media dataset (which contains the storage) recursively to mode 750:
Owner - read, write, execute
Group - read, execute
Other - none

In the jail, add a new user with User ID (number) matching the owner of the dataset/folders (probably your FreeNAS user, see it in WebGUI, Account > Users). In my transmission jail, I called the user tranny, and my User ID in FreeNAS is 1001:
Code:
pw useradd -n tranny -u 1001 -d /nonexistent -s /usr/sbin/nologin


In the jail, change ownership of the data-directory and change the user the plugin runs as (shown for the transmission jail):
Code:
service transmission onestop
chown -R tranny:tranny /usr/pbi/transmission-amd64/etc/transmission/home
chown -R tranny:tranny /var/db/transmission
sysrc 'transmission_user=tranny'

# If there's trouble later, rerun the chown command.
 

Yakje

Explorer
Joined
Feb 8, 2017
Messages
82
Thanks for the reply Glorious! Not quite sure what you mean by my "jails storage destinations", i guess i already posted them in my first post didn't i?

Anyways, i tried executing the commands you told me about:

Code:
service sonarr onestop
chown -R media:media /usr/local/share/sonarr
chown -R media:media /media
sysrc 'sonarr_user=media'


now i gave user/group media:media ownership over the /media directory as you can see:
sonarrrr.jpg

But turns out i am not even able to access sonarr @ http://192.168.0.4:8989/ anymore :S
I have no clue, what exactly i'm doing wrong here?
 

Glorious1

Guru
Joined
Nov 23, 2014
Messages
1,211
That's right, you did show the storage setup window. It shows you also have the /config directory in the jail linked to the outside storage /mnt/tank/apps/sonarr, so you would have to change owners on that also. It is still owned by sonarr.

Apparently the user you created inside the jail is 'media'. You didn't indicate if the user 'media' has the same user ID as you outside the jail?

Finally, please confirm that the folders inside media folder in the jail have the same owner and permissions as media folder (it gets confusing when owners and folders have the same name).
 

Yakje

Explorer
Joined
Feb 8, 2017
Messages
82
That's right, you did show the storage setup window. It shows you also have the /config directory in the jail linked to the outside storage /mnt/tank/apps/sonarr, so you would have to change owners on that also. It is still owned by sonarr.

Alright i changed this by executing the following command:
Code:
chown -R media:media /config


Apparently the user you created inside the jail is 'media'. You didn't indicate if the user 'media' has the same user ID as you outside the jail?

I checked if the "media" user inside the jail matched the UID and GID of the "media" user of my "media" dataset outside the jail. As you can see here it is a match!
sonar media.jpg

Finally, please confirm that the folders inside media folder in the jail have the same owner and permissions as media folder (it gets confusing when owners and folders have the same name).

Yea i understand it's quite confusing when both the folder and user have the same name, sorry about that ^^

After i did all of this, i was able to start sonarr again and also able to add the path! hooray :D
sonarr path.jpg
Although sonarr now seems to be working, it seems sabnzbd is having some problems to create the folder and start downloading.
sabnzbd.jpg

I guess this is also a permissions issue :S. Should i change the user sabnzb runs as to media:media aswell as change the owner of the config and media folder to media:media? Currently it is looking like this:
sabnzbd jail.jpg
 

Glorious1

Guru
Joined
Nov 23, 2014
Messages
1,211
Yes, I think you would have to do this for all your jails that have storage. I wonder if it is possible to install some or all of the apps in a common jail? I guess you can't do that using plugin jails, but it might be possible to install additional apps in a jail using pkg or ports? Might make management easier with fewer jails.

The first image above only shows the UID and GID for user media inside the jail, so not clear it matches outside. But I guess it must if it is working. Glad I could help.
 

Yakje

Explorer
Joined
Feb 8, 2017
Messages
82
Yea i have read it is possible to install multiple apps in a single jail, i am however going to stick with my current setup using a new jail for every app for now.

Here is a screenshot of the "media" user in FreeNas, as you can see it matches the UID of the "media" user in the sonarr jail:
users.jpg

I will now try to do the same for Sabnzbd, will let you know if it worked out! Rlly appreciate ur help <3!
 

Yakje

Explorer
Joined
Feb 8, 2017
Messages
82
Did the same thing for Sabnzbd and Radarr, now all of them are running smoothly. I can add a movie, then sab starts downloading and when finished sonarr/radarr will place the file in the movies/tv directory for plex to be able to add it to the library.

These are the commands i used:
Code:
service sabnzbd onestop
sysrc 'sabnzbd_user=media'
chown -R media:media /config


Thanks Glorious1!
 
Status
Not open for further replies.
Top