[How-To] Giving Plugins Write Permissions to Your Data

Status
Not open for further replies.

Joshua Parker Ruehlig

Hall of Famer
Joined
Dec 5, 2011
Messages
5,949
I'm not sure what that even means or what that would entail in regards to fixing the issue. The other issue I just ran into though is it seems the path in regards to the CHOWN -R command I referenced previously is different. SABnzbd plugin for example is not /var/db/sabnzbd, nor do I believe usr/local has anything either.
If you show a screenshot of the "ls -l" command I asked for earlier I could check.

are you using the plugin for sabnzbd? If not then the paths are different.
 

TheDubiousDubber

Contributor
Joined
Sep 11, 2014
Messages
193
can't take SS at the moment but here is ouput

root@plex: ls -l /mnt/Movies
total 0

root@plex: ls -l /mnt
total 18
drwxrwxr-x 0 dubious admin 2 Jan 28 02:58 Movies
drwxrwxr-x 2 dubious admin 2 Jan 28 13:41 Music
drwxrwxr-x 88 dubious admin 88 Jan 28 11:56 TV Shows

I am using the sabnzbd plugin and the path /var/db/sabnzbd did not exist since I hadn't started the plugin yet (thought I had).


UPDATE: oddly enough a restart fixed the issue. Plex is now loading movies properly. For whatever reason it continued to load new files copied into the TV folder but wouldn't recognize anything in the movie folder.
 
Last edited:

Joshua Parker Ruehlig

Hall of Famer
Joined
Dec 5, 2011
Messages
5,949
The folders look readable, and no windows ACLs so I don't see why plex can't read the files. how about..
"ls -l /mnt/Movies"
 

TheDubiousDubber

Contributor
Joined
Sep 11, 2014
Messages
193
And now for the next problem, I installed sickrage plugin. I went in to shell and added user and changed default user per instructions, then when I went to restart I get this:

Code:
root@sickrage_1:/ # service sickrage start
Starting sickrage.
PID dir: /var/run/sickrage must be writable (write permissions). Exiting.
/usr/local/etc/rc.d/sickrage: WARNING: failed to start sickrage
root@sickrage_1:/ #


I also noticed that the service status toggle doesn't appear to work and is stuck in the off position. My SABnzbd, Sickrage and Couchpotato plugins are all like this. Though SAB and CP appear to be working. I wonder if changing the user inside the jail is causing these issues.
 

Joshua Parker Ruehlig

Hall of Famer
Joined
Dec 5, 2011
Messages
5,949
And now for the next problem, I installed sickrage plugin. I went in to shell and added user and changed default user per instructions, then when I went to restart I get this:

Code:
root@sickrage_1:/ # service sickrage start
Starting sickrage.
PID dir: /var/run/sickrage must be writable (write permissions). Exiting.
/usr/local/etc/rc.d/sickrage: WARNING: failed to start sickrage
root@sickrage_1:/ #


I also noticed that the service status toggle doesn't appear to work and is stuck in the off position. My SABnzbd, Sickrage and Couchpotato plugins are all like this. Though SAB and CP appear to be working. I wonder if changing the user inside the jail is causing these issues.
Some plugins need their pidfile directories cleared.
rm -r /var/db/sickrage
 

TheDubiousDubber

Contributor
Joined
Sep 11, 2014
Messages
193
Some plugins need their pidfile directories cleared.
rm -r /var/db/sickrage

Seems to have worked though the path is /var/run/sickrage. Now that I am able to get to the WebUI, it's telling me there is an update, but give me permission denied in the logs after the update fails. :/

This is the error under logs in the sickrage webui

2016-01-28 17:32:01 Thread-30 :: Error while trying to update: error 13 : Permission denied
 
Last edited:

Joshua Parker Ruehlig

Hall of Famer
Joined
Dec 5, 2011
Messages
5,949
Seems to have worked though the path is /var/run/sickrage. Now that I am able to get to the WebUI, it's telling me there is an update, but give me permission denied in the logs after the update fails. :/
sweet!
 

TheDubiousDubber

Contributor
Joined
Sep 11, 2014
Messages
193
So after dealing with so many issues. I tried to start over from scratch. I took approach 1 instead of approach 2 and it worked like a charm. Plex, Sickrage, CP and SAB are all working beautifully and without issue, as well as all permissions with the CIFS share I have setup to manage everything manually. I use plexpass version which was why I took the 2nd approach the first time. Since CP, SAB and SR all have plugins with the common UID 816, solution 1 worked, but not with Plex since the UID is different. However, plex doesn't require permissions like the others do since it can still run perfectly fine with read-only access.
 

RobTheRed

Dabbler
Joined
Feb 8, 2016
Messages
25
I really don't know what I'm doing wrong. I screwed up transmission a week or so ago, so I uninstalled and re-installed.

Here was my process:
1) Download Transmission
2) Set Transmissions settings in FreeNAS to:
- Watch Directory: /media/Torrents (jail mount)
- Incomplete Download Directory: /media/Downloads/Incomplete (jail mounted Downloads folder)
- Downloaded Permissions: 777
3) Look at user "transmission" (921) in FreeNAS and make sure it's part of the "media" group (816).
4) Look at jails -> transmission_1 -> Storage and make sure that /media/Downloads and /media/Torrents are mounted.
5) Look at Storage -> /mnt/Volume1/media/Downloads and /mnt/Volume1/media/Torrents and make sure that they're set to owner (user): media, owner(group): media, and that the group and owner have full permissions while other only has read and execute permissions (775). Unix Permission type, and the permissions were set recursively.
6) Within Transmission Jail -> ssh -> add media group pw groupadd -n media -g 816
7) Within transmission jail add transmission to media group: pw groupmod media -M transmission
8) Verify user was added: pw groupshow media outputs -> media:*:816:transmission
9) verify output from ls-l on media:
drwxrwxr-x+ 18 816 media 23 Feb 8 08:28 Downloads
drwxrwxr-x+ 2 816 media 2 Feb 8 08:27 Torrents
10) Startup transmission (Plugins -> Installed -> Transmission switch to on)
11) Send torrent to transmission via CouchPotato

And I get the Error: Permission denied (/media/Torrents/<torrentname>)

What am I doing wrong? Did I miss a step somewhere? I had this working before, but I don't remember what I had to do to get it to work in the first place. I really wish it would just work out of the box.

UPDATE: I figured it out... apparently I never changed the permissions of the folders WITHIN the jail to the correct user. They were set up as media (user) but not as the group.
Changed via: chown -R transmission:media Downloads
and chown -R transmission:media Torrents and it seems to be working now.

I guess I'll leave this post up here for others to follow should they need it.
 
Last edited:

Drew Heath

Explorer
Joined
Mar 7, 2016
Messages
80
This seems like such a straight forward process after reading the explanation, but I am out of ideas as to what to look at next. I am starting of my project with SABnzbd and will work out from there to CP, Headphones, Plex, etc. To test SAB I have downloaded an nzb for an album, uploaded it to SAB and have successfully downloaded the file, but cannot post process. The exact error is:
2016-03-17 13:00:36,213 ERROR: Post Processing Failed for The Weeknd - Beauty Behind the Madness (Cannot create final folder /complete/music/The Weeknd - Beauty Behind the Madness)
2016-03-17 13:00:36,213 ERROR: Failed making (/complete/music/The Weeknd - Beauty Behind the Madness)

SAB is configured to use /media/Downloads then /incomplete and /complete with the category music (which based on what I am seeing I believe uses a sub folder in complete for a full path of /media/Downloads/complete/music).

/media/Downloads is a dataset configured as 775 media (UID 816): Downloads (GID 1002) (The storage path is /mnt/ZFS-Vol-01/Downloads and is added to the jail as /media/Downloads)

I originally figured the group approach would be the most straight forward. This in my mind allows the actual service account user in the jail to only need to be added to the group versus a change in account. After the group yielded this error, I created the media user (UID 816) and added it as the owner user to the dataset and saw the same error. I have also tried setting the /media/Downloads folder to 777 with no change in ability to work with the files. Here is what the folder permissions look like now:

drwxrwxr-x 5 media Downloads 5 Mar 16 22:03 Downloads

then inside Downloads:

drwxrwxr-x 3 media Downloads 3 Mar 17 12:16 complete
drwxrwxr-x 3 media Downloads 3 Mar 17 10:26 incomplete
drwxrwxr-x 2 media Downloads 2 Mar 16 22:03 nzb

then inside complete:

drwxrwxr-x 2 media Downloads 2 Mar 17 12:57 music

if I id media, i see the proper group membership, so with user and group being rwx, the permissions look complete:

uid=816(media) gid=816(media) groups=816(media),1002(Downloads)

I also added a shell to the media user to allow me to test creating files as the media user in an attempt to get more information on the denial:

chsh -s /bin/csh media
su media
cd /media/Downloads/complete/music
mkdir test

The directory is created with no issues, and removing the dir with rm -r works as well.

The last thing I have done is to look at the started service with top and see two phython scripts running, one under root and the other under media, I would assume SAB is the media account.

PID USERNAME THR PRI NICE SIZE RES STATE C TIME WCPU COMMAND
83412 root 6 52 0 176M 51468K usem 0 0:04 0.00% python2.7
87333 media 33 24 0 268M 67228K usem 1 0:03 0.00% python2.7
87209 root 1 20 0 17568K 3164K pause 1 0:00 0.00% tcsh
83119 root 1 20 0 12080K 1876K select 1 0:00 0.00% syslogd
83172 root 1 20 0 14184K 1852K nanslp 1 0:00 0.00% cron
88365 root 1 20 0 18668K 2420K CPU2 2 0:00 0.00% top

I feel like I am right on the edge of this working. I was trying to mess with auditing (no experience doing this in FreeBSD) but couldn't get the service to start.

****UPDATE****
Got it. This was a clear case of me being a bonehead. In the categories section of SAB I expected the path to be relative to that of the downloads folder. When opening my eyes I see that the path was relative to the original installation location, so I was trying to place the files in the wrong place. I hope that some of my troubleshooting with help others in how to test permissions in their folder structure. No amount of testing will help however when you set SAB to put things in places that don't exist!
 
Last edited:

Joshua Parker Ruehlig

Hall of Famer
Joined
Dec 5, 2011
Messages
5,949
I thought categories were relative to the downloads folder. at least we know that's something to check, especially if you change the folder location after setting up categories.
 

Drew Heath

Explorer
Joined
Mar 7, 2016
Messages
80
I thought categories were relative to the downloads folder. at least we know that's something to check, especially if you change the folder location after setting up categories.
That is true if you set the Default category. From what I can tell, it does not use the download folder listed in the Folders section. It was driving me crazy to say the least.
 

Joshua Parker Ruehlig

Hall of Famer
Joined
Dec 5, 2011
Messages
5,949
That is true if you set the Default category. From what I can tell, it does not use the download folder listed in the Folders section. It was driving me crazy to say the least.
It seems to work for me and anyone who uses the same method detailed in my blog (google search "jruehlig freenas")
Never heard of this specific issue so maybe it depends the order you do stuff
 

Drew Heath

Explorer
Joined
Mar 7, 2016
Messages
80
I also wonder if this has something to do with SAB version 1.0.
 

Steve Brown

Explorer
Joined
May 7, 2015
Messages
80
Josh,

Are you aware of any issues with Plex permission issues with FreeNAS 9.10? I have upgraded and cant seem to delete files I get an error when trying to do so. I am running plex 9.15.6 tried to update using PMS_Updater.sh but that seems like it might need to be fixed because of the new jails in 9.10... should I make my storage mounts chown plex:group for the movies and tvshows folders I use?
 

Joshua Parker Ruehlig

Hall of Famer
Joined
Dec 5, 2011
Messages
5,949
Josh,

Are you aware of any issues with Plex permission issues with FreeNAS 9.10? I have upgraded and cant seem to delete files I get an error when trying to do so. I am running plex 9.15.6 tried to update using PMS_Updater.sh but that seems like it might need to be fixed because of the new jails in 9.10... should I make my storage mounts chown plex:group for the movies and tvshows folders I use?
I don't use plex and am not aware of anything specific to plex with freenas 9.10 (haven't updated yet either)
 

Drew Heath

Explorer
Joined
Mar 7, 2016
Messages
80
Josh,

Are you aware of any issues with Plex permission issues with FreeNAS 9.10? I have upgraded and cant seem to delete files I get an error when trying to do so. I am running plex 9.15.6 tried to update using PMS_Updater.sh but that seems like it might need to be fixed because of the new jails in 9.10... should I make my storage mounts chown plex:group for the movies and tvshows folders I use?
I am not sure this is your issue, but in reading about Plex on FreeBSD, they don't support the update script you referenced and have had a lot of questions regarding issues with it. I am personally considering making an Ubuntu jail and manually installing Plex because the support, features and updates are better for Linux.
 

Steve Brown

Explorer
Joined
May 7, 2015
Messages
80
Josh,

Just did an update that came out on 3/25/16 for FreeNAS 9.10 and did a reboot. I can now delete movies/tvshows within plex app.

Drew,

I will look into doing this as well thank you for the advice. I am fairly new to FreeNAS and dont have a whole lot of knowledge but I can definitely read and teach my self :).
 

Drew Heath

Explorer
Joined
Mar 7, 2016
Messages
80
Josh,

Just did an update that came out on 3/25/16 for FreeNAS 9.10 and did a reboot. I can now delete movies/tvshows within plex app.

Drew,

I will look into doing this as well thank you for the advice. I am fairly new to FreeNAS and dont have a whole lot of knowledge but I can definitely read and teach my self :).
Come to find out Linux jail support discontinued in 9.3. I am trying to find some other work arounds, but don't have a good solution yet on the FreeNAS box itself. I did get the last update to Plex however from FreeNAS, and had no issues. I'm only living without premium libraries at this point.
 

Viktor Westin

Dabbler
Joined
Apr 18, 2016
Messages
13
Hello there!

I'm pretty new to FreeNAS and of course I'm having trouble with permissions (I think).

I've got the latest stable release of FreeNAS (9.10) and the latest version of Transmission. The issue I'm having and that I just can't figure out why is happening, is that when downloads are completed in transmission, they do not appear in my downloads folder. But - if I restart my server, they sure enough show up after reboot. How can this be?
 
Status
Not open for further replies.
Top