Permission problems / PLEX + Transmission + SickRage

Status
Not open for further replies.

BlazeStar

Patron
Joined
Apr 6, 2014
Messages
383
Hi guys,

Using FreeNAS-9.2.1.9-RELEASE-x64 (2bbba09)

I've been setting up PLEX + TRANSMISSION + COUCH POTATO + SICK RAGE

I've read a lot on this thread:
https://forums.freenas.org/index.ph...ssion-and-couchpotato-as-a-dlna-server.17165/

I set up datasets with media as user and group, with 770 permissions.

Datasets are in "Unix" style permissions, not ACLs.

Then I share the datasets with the different jails, using pretty much the same directory names and structure from the thread.

I keep having permission problems.

I've even set a cron job to set back the permissions to media:media 770.

But it's still problematic because for various instances.

Ex: SickRage snatches a torrent.
Then Transmission downloads it.
If my cron job didn't run, SickRage will fail to extract and move it, and then will never try again so I need to do a post-processing.

Then it defeats the purpose of automating everything as I keep having to check what has been downloaded and what shows up in PLEX and if it doesn't show up I have to try to fix it or move the files manually, and try to name them so SickRage / Couch Potato will recognize them, etc...

Have you run into similar issues?

How do you fix the permission problems once and for all?
 

Joshua Parker Ruehlig

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

BlazeStar

Patron
Joined
Apr 6, 2014
Messages
383
transmission runs as the 'transmission' user by default (UID 921) and writes files with 755 permissions (only owner can write the files). you can change either of these defaults.
this thread can guide you in solving this.
https://forums.freenas.org/index.ph...plugins-write-permissions-to-your-data.27273/

your cron solution makes me cringe =P

I did cringe a lot too but didn't know what to do ;)

So here's what I did... shut down the 4 plugins (Plex / Transmission / CouchPotato / SickRage) and opened up the 4 jails from shell.

First added user media with UID 816 (which seems to be the default).
When it existed, just double-checked it's UID was 816.
Same for groups.

I used the following commands:
Code:
pw useradd -n media -u 816 /nonexistent -s /usr/sbin/nologin
pw usershow media
pw groupadd -n media -g 816
pw groupshow media


All jails have now user and group media on with UID and GID 816.
And user media is in group media.

Then moving on, tried to change the /var/db/plugin permissions SickRage and CouchPotato

Code:
root@couchpotato_1:/var/db # ls
couchpotato        locate.database        ports
entropy            mergemaster.mtree    portsnap
freebsd-update        pbi
ipf            pkg

chown -R media:media /var/db/couchpotato/

root@sickrage_1:/var/db # ls
entropy            mergemaster.mtree    portsnap
freebsd-update        pbi            sickrage
ipf            pkg
locate.database        ports

chown -R media:media /var/db/sickrage/


But for Transmission and Plex, no folder with plugin name was present in /var/db/

Code:
root@transmission_1:/var/db # ls
entropy            ipf            mergemaster.mtree    pkg            portsnap
freebsd-update        locate.database        pbi

root@plexmediaserver_1:/var/db # ls
entropy            locate.database        pkg
freebsd-update        mergemaster.mtree    ports
ipf            pbi


Is that normal ?

Then moving on again I went and did the "sysrc" thing will all plugins, even for the groups:

Code:
root@couchpotato_1:/var/db # sysrc couchpotato_user=media
couchpotato_user:  -> media
root@couchpotato_1:/var/db # sysrc couchpotato_group=media
couchpotato_group:  -> media

root@sickrage_1:/var/db # sysrc sickrage_user=media
sickrage_user: sickrage -> media
sysrc sickrage_group=media
sickrage_group:  -> media

root@plexmediaserver_1:/var/db # sysrc plexmediaserver_user=media
plexmediaserver_user:  -> media
root@plexmediaserver_1:/var/db # sysrc plexmediaserver_group=media
plexmediaserver_group:  -> media

root@transmission_1:/var/db # sysrc transmission_user=media
transmission_user:  -> media
root@transmission_1:/var/db # sysrc transmission_group=media
transmission_group:  -> media


Then from the shell in FreeNAS (not in jails) I reset one last time my permissions for my share storage folders (chmod + chown).

Then restarted the plugins from the FreeNAS GUI.

Did I miss something?
 

Joshua Parker Ruehlig

Hall of Famer
Joined
Dec 5, 2011
Messages
5,949
I did cringe a lot too but didn't know what to do ;)

So here's what I did... shut down the 4 plugins (Plex / Transmission / CouchPotato / SickRage) and opened up the 4 jails from shell.

First added user media with UID 816 (which seems to be the default).
When it existed, just double-checked it's UID was 816.
Same for groups.

I used the following commands:
Code:
pw useradd -n media -u 816 /nonexistent -s /usr/sbin/nologin
pw usershow media
pw groupadd -n media -g 816
pw groupshow media


All jails have now user and group media on with UID and GID 816.
And user media is in group media.

Then moving on, tried to change the /var/db/plugin permissions SickRage and CouchPotato

Code:
root@couchpotato_1:/var/db # ls
couchpotato        locate.database        ports
entropy            mergemaster.mtree    portsnap
freebsd-update        pbi
ipf            pkg

chown -R media:media /var/db/couchpotato/

root@sickrage_1:/var/db # ls
entropy            mergemaster.mtree    portsnap
freebsd-update        pbi            sickrage
ipf            pkg
locate.database        ports

chown -R media:media /var/db/sickrage/


But for Transmission and Plex, no folder with plugin name was present in /var/db/

Code:
root@transmission_1:/var/db # ls
entropy            ipf            mergemaster.mtree    pkg            portsnap
freebsd-update        locate.database        pbi

root@plexmediaserver_1:/var/db # ls
entropy            locate.database        pkg
freebsd-update        mergemaster.mtree    ports
ipf            pbi


Is that normal ?

Then moving on again I went and did the "sysrc" thing will all plugins, even for the groups:

Code:
root@couchpotato_1:/var/db # sysrc couchpotato_user=media
couchpotato_user:  -> media
root@couchpotato_1:/var/db # sysrc couchpotato_group=media
couchpotato_group:  -> media

root@sickrage_1:/var/db # sysrc sickrage_user=media
sickrage_user: sickrage -> media
sysrc sickrage_group=media
sickrage_group:  -> media

root@plexmediaserver_1:/var/db # sysrc plexmediaserver_user=media
plexmediaserver_user:  -> media
root@plexmediaserver_1:/var/db # sysrc plexmediaserver_group=media
plexmediaserver_group:  -> media

root@transmission_1:/var/db # sysrc transmission_user=media
transmission_user:  -> media
root@transmission_1:/var/db # sysrc transmission_group=media
transmission_group:  -> media


Then from the shell in FreeNAS (not in jails) I reset one last time my permissions for my share storage folders (chmod + chown).

Then restarted the plugins from the FreeNAS GUI.

Did I miss something?
Which alternative were you trying to implement?

Adding the group 'media' was a waste. When a user is added, a coresponding group is added unless you specify something different.
Changing ownership of the /var/db/couchpotato & /var/db/sickrage to user+group 'media' was waste. That's is what they are by default.

If you read the "Relevant Information for Most Plugins I Support" you will know the data-directory for transmission and plex.
sysrc for groups was a waste. I don't really know what that entails for a process, lol.

####

I think it should work for you. Here is what I would have done...
  1. ran transmission + CP + SR in the same jail
    • alternatively, add a media user (UID 816) to the transmission jail
  2. set transmissions user as 'media'
  3. set transmissions download permissions to 777 (in the freenas interface)
  4. For Plex, mount dataset into its jail read-only.
 

BlazeStar

Patron
Joined
Apr 6, 2014
Messages
383
Which alternative were you trying to implement?

Adding the group 'media' was a waste. When a user is added, a coresponding group is added unless you specify something different.
Changing ownership of the /var/db/couchpotato & /var/db/sickrage to user+group 'media' was waste. That's is what they are by default.

If you read the "Relevant Information for Most Plugins I Support" you will know the data-directory for transmission and plex.
sysrc for groups was a waste. I don't really know what that entails for a process, lol.

####

I think it should work for you. Here is what I would have done...
  1. ran transmission + CP + SR in the same jail
    • alternatively, add a media user (UID 816) to the transmission jail
  2. set transmissions user as 'media'
  3. set transmissions download permissions to 777 (in the freenas interface)
  4. For Plex, mount dataset into its jail read-only.

By the number of times you've repeated it, I kinda understand the group thing was a waste of time... but a waste of maybe 5 minutes of time so that's not so bad right?

Sorry for that part, in the end, I just wanted to have everything perfectly in harmony across jails.

Concerning running Transmission + CouchPotato + Sickrage in the same jail, I have absolutely no idea on how to do that...

I'm such a n00b that I installed them using the "plugin method" which is go in the plugins tab and click install, then everything should work.

For now it's been working and I'm hoping that the change in Transmission's user will fix my problems.


Also, I don't see where I can set Transmission's download permissions.

When I open up the plugin config window from FreeNAS GUI I don't see anything like that.

Nor in the Transmission Web GUI.


One weird thing is that if I don't set the permission for the media files to 777, PLEX won't have access to it, therefore I set all my datasets containing movies and tv shows to 777.
 

Joshua Parker Ruehlig

Hall of Famer
Joined
Dec 5, 2011
Messages
5,949
By the number of times you've repeated it, I kinda understand the group thing was a waste of time... but a waste of maybe 5 minutes of time so that's not so bad right?

Sorry for that part, in the end, I just wanted to have everything perfectly in harmony across jails.

Concerning running Transmission + CouchPotato + Sickrage in the same jail, I have absolutely no idea on how to do that...

I'm such a n00b that I installed them using the "plugin method" which is go in the plugins tab and click install, then everything should work.

For now it's been working and I'm hoping that the change in Transmission's user will fix my problems.


Also, I don't see where I can set Transmission's download permissions.

When I open up the plugin config window from FreeNAS GUI I don't see anything like that.

Nor in the Transmission Web GUI.


One weird thing is that if I don't set the permission for the media files to 777, PLEX won't have access to it, therefore I set all my datasets containing movies and tv shows to 777.
Just stating they were a waste so you knew which steps you did that actually mattered.

You can download PBI files from download.freenas.org, then upload them to an existing plugin jail on the Jails tab.
What I do (for a sabnzbd+transmission+sickrage+couchpotato) is install sabnzbd as normal, then upload the remaining PBIs.

The permission setting should be at the bottom of transmissions config window, you can get to from the left pane. I added it in the latest version.
 

BlazeStar

Patron
Joined
Apr 6, 2014
Messages
383
Just stating they were a waste so you knew which steps you did that actually mattered.

You can download PBI files from download.freenas.org, then upload them to an existing plugin jail on the Jails tab.
What I do (for a sabnzbd+transmission+sickrage+couchpotato) is install sabnzbd as normal, then upload the remaining PBIs.

The permission setting should be at the bottom of transmissions config window, you can get to from the left pane. I added it in the latest version.

Ah yes, I'm still using 2.82 because when I try to update it gives me this error message in console:
Code:
Mar 31 23:23:13 UC-NAS manage.py: [common.pipesubr:58] Popen()ing: /sbin/umount -f '/mnt/UC/Prisons/transmission_1/media/torrentfiles'
Mar 31 23:23:13 UC-NAS manage.py: [middleware.exceptions:38] [MiddlewareError: umount: /mnt/UC/Prisons/transmission_1/media/torrentfiles: statfs: No such file or directory umount: /mnt/UC/Prisons/transmission_1/media/torrentfiles: unknown file system ]
 

Joshua Parker Ruehlig

Hall of Famer
Joined
Dec 5, 2011
Messages
5,949
Ah yes, I'm still using 2.82 because when I try to update it gives me this error message in console:
Code:
Mar 31 23:23:13 UC-NAS manage.py: [common.pipesubr:58] Popen()ing: /sbin/umount -f '/mnt/UC/Prisons/transmission_1/media/torrentfiles'
Mar 31 23:23:13 UC-NAS manage.py: [middleware.exceptions:38] [MiddlewareError: umount: /mnt/UC/Prisons/transmission_1/media/torrentfiles: statfs: No such file or directory umount: /mnt/UC/Prisons/transmission_1/media/torrentfiles: unknown file system ]
You could alternatively...
  1. stop transmission
  2. set umask to 0 in /usr/pbi/transmission-amd64/etc/transmission/home/settings.json
  3. start transmission
 

BlazeStar

Patron
Joined
Apr 6, 2014
Messages
383
Thanks! I did that and it should work.

But any idea why I can't update?

That "unknown file system" thing is scary.
 

Joshua Parker Ruehlig

Hall of Famer
Joined
Dec 5, 2011
Messages
5,949
Thanks! I did that and it should work.

But any idea why I can't update?

That "unknown file system" thing is scary.
I suspect a bug.
Are you on the latest release? I remember there being a period of time where alot of people were hitting that issue.
 

hansmuff

Dabbler
Joined
Mar 13, 2015
Messages
22
This is what has worked the best for me:
All directories that the plugins write to are put into one group I define in the FreeNAS group manager; in my case, group '100' named 'media'.
Let's pretend /mnt/pool/downloads and /mnt/pool/uploads are both to be used by multiple plugins.

chown -R root:media /mnt/pool/downloads
chown -R root:media /mnt/pool/downloads

So now those directories can be fully accessed by the media group, or more importantly, group number 100.

Stop all plugins, shell into each and do this:
1. Find their user: cat /etc/passwd (it's usually the last one, 816, 972, whatever, let us assume 816)

2. id 816 (find out what group they are in, let's pretend they are in group 816 called 'media')

You want the user to be (A) in group 100 as their logon group, so they are in group 100 on the NAS when they access it and (B) remain in their old group so the plugin files are still all accessible with 816:816, so you

3. pw groupadd newmedia -g100
4. pw usermod 816 -g100 -G816

Now your user will access the shared directories as a member of the group 100 ("media" on the NAS) and can still access any group '816' files in its jail.

This has worked out very nicely for me. I don't have to worry about different groups and user IDs for the files in the shared directories, and setting permissions in the plugins becomes a lot easier because all you have to make sure is to have '7' for the group permissions. All files will already be created (and opened) under the 'media' group.
 

whatnissan

Dabbler
Joined
Feb 18, 2015
Messages
49
AHHH im so frustrated at this... Some one please help me@!!!!!!!!! I cant change shit on my install I have resinstalled the stupid transmission plugin now like 8 times and im still haveing the same issues.. Ok somone help me ,how do you change the stupid user transmission runs as. Step by step cause none of these solutions worked for me. Im about to give up on this thing. It has to be a bug. IM new to freenas but not linux and this just doenst want to cooperate
 

BlazeStar

Patron
Joined
Apr 6, 2014
Messages
383
I suspect a bug.
Are you on the latest release? I remember there being a period of time where alot of people were hitting that issue.

Now running FreeNAS-9.3-STABLE-201503270027

I'm still getting the "unknown file system" errors while trying to update either PLEX or TRANSMISSION :(
 

Joshua Parker Ruehlig

Hall of Famer
Joined
Dec 5, 2011
Messages
5,949
Now running FreeNAS-9.3-STABLE-201503270027

I'm still getting the "unknown file system" errors while trying to update either PLEX or TRANSMISSION :(
what do you see under jails > mountpoints? are there entries you shouldn't have anymore?
 

BlazeStar

Patron
Joined
Apr 6, 2014
Messages
383
what do you see under jails > mountpoints? are there entries you shouldn't have anymore?
I don't have a "mountpoints" item when in the jails tab.

However, If I go under "Configuration", I see the "Jail root" as "/mnt/Data/Jails" which is what I initially set before creating any jail.

When in the "Storage" sub-tab of the "Jails" tab, I see all the shared datasets that I've put... and in the "Mounted" column, I see some that of them are set to "false"...

On that topic, all the shared folders of Transmission have the false flag, for mounted... maybe that could be part of the problem?

I've been looking everywhere in Jails and Plugins but I don't see anything saying "mountpoints"... Could you please let me know where to look?
 

Joshua Parker Ruehlig

Hall of Famer
Joined
Dec 5, 2011
Messages
5,949
I don't have a "mountpoints" item when in the jails tab.

However, If I go under "Configuration", I see the "Jail root" as "/mnt/Data/Jails" which is what I initially set before creating any jail.

When in the "Storage" sub-tab of the "Jails" tab, I see all the shared datasets that I've put... and in the "Mounted" column, I see some that of them are set to "false"...

On that topic, all the shared folders of Transmission have the false flag, for mounted... maybe that could be part of the problem?

I've been looking everywhere in Jails and Plugins but I don't see anything saying "mountpoints"... Could you please let me know where to look?
Yeah, I meant the 'Storage' tab, I just didn't remember what it was called at the time.
Maybe you should delete all those mountpoint from the storage tab for the transmissin jail first?
 

BlazeStar

Patron
Joined
Apr 6, 2014
Messages
383
Yeah, I meant the 'Storage' tab, I just didn't remember what it was called at the time.
Maybe you should delete all those mountpoint from the storage tab for the transmissin jail first?

Ok so I did that... I deleted all the storage for transmission.

Then I tried updating it again: SUCCESS.

But then it wouldn't start anymore...

I tried adding the storages again... no luck

Things were extremely slow in the GUI so I decided to reboot the whole FreeNAS server.

Now transmission is in RED in the plugin list, and won't start.

Also, for some reason, SickRage is now stopped too, and won't start either, while I did not delete storages or update it.

At this point I'm not sure what to do!
 

Joshua Parker Ruehlig

Hall of Famer
Joined
Dec 5, 2011
Messages
5,949
Ok so I did that... I deleted all the storage for transmission.

Then I tried updating it again: SUCCESS.

But then it wouldn't start anymore...

I tried adding the storages again... no luck

Things were extremely slow in the GUI so I decided to reboot the whole FreeNAS server.

Now transmission is in RED in the plugin list, and won't start.

Also, for some reason, SickRage is now stopped too, and won't start either, while I did not delete storages or update it.

At this point I'm not sure what to do!
I think when a plugin is red, that means the jail for it is stopped. You might want to start there.

AS for there sickrage plugin, try 'service sickrage start' from its jail.
 
Status
Not open for further replies.
Top