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

Status
Not open for further replies.

Matt Bennett

Cadet
Joined
May 11, 2016
Messages
5
I could really use some help setting up the Emby Plugin.

I'm very new to this, but was able to read through tons of forum posts, and setup a very good freenas box (48TB of storage), which I share via CIFS to several Windows boxes, and a Nvidia Shield TV.

I have setup the shares (/Storage/Media/Movies and /Storage/Media/TV), and everyone has access to them no problem (user: nobody, group: shareusers). On the Windows systems I can browse to the share using \\freenas\Movies or \\freenas\TV.

Again everything so far has been working great. Now, onto Emby. I followed several posts on how a basic setup of Emby should be, but they all seem to be missing several steps that a newbie like myself needs to complete the setup.

First thing I did was install the plugin (piece of cake).
upload_2016-6-26_10-11-40.png


Under Jails, the emby_1 Storage/media looks like this...
upload_2016-6-26_10-13-12.png


I'm able to start the Emby plugin, and go to the webpage listed (192.168.1.102:8096) without issue.

The problem happens when I try to add the content to Emby, it doesn't seem to recognize my movies path (/mnt/Storage/Media/Movies) and gives me the following error:
"There was an error adding the media path. Please ensure the path is valid and the Emby Server process has access to that location."
I've tried dozens of different (/Storage/Media/Movies, or /Media/Movies, etc) ways to add this storage, and all give the same error.
 

BBarker

Contributor
Joined
Aug 7, 2015
Messages
120
You've created datasets for each subset of media? You might be better served leaving your storage pointing to media and then creating directories for each subset in the media folder for your shares to pull from rather than separate datasets.

Also, you may have to change your destination to "mnt" for your attached storage.
 

Matt Bennett

Cadet
Joined
May 11, 2016
Messages
5
Being a newbie, I'm not exactly sure how to do either of the things you've said (and worry about making changes that would affect all my data). But I thought my issue was permission based, which is why I posted in this thread.

Should my initial post be moved to the Plugin's section?
 

Joshua Parker Ruehlig

Hall of Famer
Joined
Dec 5, 2011
Messages
5,949
Being a newbie, I'm not exactly sure how to do either of the things you've said (and worry about making changes that would affect all my data). But I thought my issue was permission based, which is why I posted in this thread.

Should my initial post be moved to the Plugin's section?
as stated, likely not a permission issue. jail mountpoints don't span datasets. either have several mounts, or have your media organized in folders on a single dataset (this is what I do).
 

Matt Bennett

Cadet
Joined
May 11, 2016
Messages
5
So how would I go about changing to a single dataset, with folders (I thought this was how I set this up). The screenshot of my FreeNAS storage doesn't actually look like that, I actually see something like this.

-Storage
--Storage
---Media
----Media/Movies
----Media/TV
----Media/Music
----Media/Music Videos
---Jails
----Jails Warden...
----Jails/emby_1

So in the screenshot, it looks like Storage and Media/Storage are on the same level, but in reality, Movies, TV, Music, and Music Videos, all reside under Media.

I think it looks different in the screenshot, because I shrank the screen down.
 

Joshua Parker Ruehlig

Hall of Famer
Joined
Dec 5, 2011
Messages
5,949
So how would I go about changing to a single dataset, with folders (I thought this was how I set this up). The screenshot of my FreeNAS storage doesn't actually look like that, I actually see something like this.

-Storage
--Storage
---Media
----Media/Movies
----Media/TV
----Media/Music
----Media/Music Videos
---Jails
----Jails Warden...
----Jails/emby_1

So in the screenshot, it looks like Storage and Media/Storage are on the same level, but in reality, Movies, TV, Music, and Music Videos, all reside under Media.

I think it looks different in the screenshot, because I shrank the screen down.
if you have data in any of the subdatasets of Media, back it up somewhere.
delete all those subdatasets, and create folders instead in their place. restore data you previously backed up.
 

BBarker

Contributor
Joined
Aug 7, 2015
Messages
120
You need to create one dataset in your storage pool and call it "media" (assuming that is the name you want to give it).

Depending on how much data you have distributed over your dataset(s) this may require you to back all your media up from all datasets to a secure location, destroy the datasets that are subsets of "media" so all you have is the one dataset called "media" remaining. This will be the root folder that all your media sub folders will be kept in and sorted. Keep in mind that when you destroy a dataset, you lose all the data you had in that dataset so it's important that you have all your files securely backed up before you start this process.

Check to make sure that your CIFS shares points to the "media" dataset and not the other datasets you just deleted. Access your media folder using a windows machine with your CIFS share and create folders for the different types of media files you will be storing there like "Movies", "TV Shows", "Music", etc. Now you can restore the media that you have backed up to the appropriate folders you just created within the media dataset. When setting up plugins and other computers to access the "media" dataset, you can now point them to the correct folders within your dataset to pull the information from.

I don't use emby, but I know that Plex let me access my Movie, TV Shows and Music folders individually when setting it up so I would assume that emby has the same ability.
 

Matt Bennett

Cadet
Joined
May 11, 2016
Messages
5
Hmm, originally I thought that's what I did, created the Media share, and then created folders within that share. Being a newbie, obviously I screwed up. However, couldn't I fix the permissions on the Media dataset, create the folders for (Movies, TV, Music, Music Videos). Then copy each subdataset (Media/Movies, Media/TV, etc), into the newly created folders under Media?
 

BBarker

Contributor
Joined
Aug 7, 2015
Messages
120
I think you may be confusing folders and datasets. It shouldn't be a problem to create folders within your media dataset with your windows machine and then move the files over from the individual datasets into the new folders using the same machine as long as you have your CIFS shares pointing to the "media" dataset instead of each individual dataset now currently set up. Once done, delete one of the sub datasets and confirm that the new folder is not effected before deleting the other two.

Having your files backed up is always a good idea just in case you destroy the wrong dataset!

Your freenas machine will have a pool called "Storage" with one dataset called "media" when you are finished (jails are separate and will still be showing in their current location which is fine). Your windows machine will will browse the "media" dataset at \\freenas\Storage\media and should show all the newly created folders and their corresponding data when you open them.
 

Matt Bennett

Cadet
Joined
May 11, 2016
Messages
5
Just as a followup, I followed both BBarker and Joshua's advice, and created folders under the "Media" dataset, and this fixed the issues I've been having with Emby. It was almost too easy, and I didn't have to delete anything, just created the new folders, and moved everything to them (took quite a while though).

Thanks for all the assistance, it is appreciated.
 

BBarker

Contributor
Joined
Aug 7, 2015
Messages
120
Just as a followup, I followed both BBarker and Joshua's advice, and created folders under the "Media" dataset, and this fixed the issues I've been having with Emby. It was almost too easy, and I didn't have to delete anything, just created the new folders, and moved everything to them (took quite a while though).

Thanks for all the assistance, it is appreciated.

That's good news Matt, I'm glad you got it sorted out.

I have had lots of tremendous help here from forum members and am glad that any information you may have gleaned from my posts turned out to be helpful.
 

sleepless007

Cadet
Joined
Dec 4, 2015
Messages
6
So guys i think i've been running in a permissions problem with transmission and sonarr and can't seem to get it sorted out, would really apreciate some help!

First i have two Datasets (Media and Downloads) ownership anton and group anton (UID:1001, GUID:1001)

Installed sonarr and transmission plugins and added storage to the jails
transmission storage: Downloads/Torrents --> mountpoint in jail /media
sonarr 1st storage: /Media --> mountpoint in jail /media
sonarr 2nd storage: /Downloads/Torrents --> mountpoint in jail /media

I configured transmission plugin for downloads and incomplete downloads in folder inside of Torrents

Then i took the way of going with Solution 2 and did the following in both jails:

Code:
service transmission stop
chown -R anton:anton /var/db/transmission
sysrc 'transmission_user=anton'
service transmission start


and

Code:
service sonarr onestop
chown -R anton:anton /var/db/sonarr
sysrc 'sonarr_user=anton'
service sonarr start


Sonarr has no write access to the /Downloads/Torrents Folder, it can't remove torrents from Transmission client. This is the output of ls -l /Download/Torrents from transmission and sonarr jail:

root@transmission_1:/media # ls -l
total 106
-rwxrwxr-x+ 1 anton anton 12292 Sep 18 23:21 .DS_Store
drwxrwxr-x+ 2 anton anton 2 Sep 19 06:27 incomplete
drwxrwxr-x+ 7 anton anton 8 Sep 19 06:27 seeding
drwxrwxr-x+ 2 anton anton 2 Sep 18 23:21 torrentfiles

root@sonarr_1:/ # ls -l /media/
total 123
-rwxrwxr-x+ 1 anton anton 12292 Sep 18 23:21 .DS_Store
-rwxrwxr-x+ 1 anton anton 0 Sep 13 07:04 .windows
drwxrwxr-x+ 5 anton anton 6 Sep 17 21:06 Movies
drwxrwxr-x+ 2 anton anton 2 Sep 13 07:55 Music
drwxrwxr-x+ 127 anton anton 128 Sep 19 00:05 Serien
drwxrwxr-x+ 5 anton anton 6 Sep 18 23:34 torrents
root@sonarr_1:/ # cd /media/torrents/
root@sonarr_1:/media/torrents # ls -l
total 106
-rwxrwxr-x+ 1 anton anton 12292 Sep 18 23:21 .DS_Store
drwxrwxr-x+ 2 anton anton 2 Sep 19 06:27 incomplete
drwxrwxr-x+ 7 anton anton 8 Sep 19 06:27 seeding
drwxrwxr-x+ 2 anton anton 2 Sep 18 23:21 torrentfiles
root@sonarr_1:/media/torrents #


Really need some help here...

kind regards
 
Last edited:

Joshua Parker Ruehlig

Hall of Famer
Joined
Dec 5, 2011
Messages
5,949
So guys i think i've been running in a permissions problem with transmission and sonarr and can't seem to get it sorted out, would really apreciate some help!

First i have two Datasets (Media and Downloads) ownership anton and group anton (UID:1001, GUID:1001)

Installed sonarr and transmission plugins and added storage to the jails
transmission storage: Downloads/Torrents --> mountpoint in jail /media
sonarr 1st storage: /Media --> mountpoint in jail /media
sonarr 2nd storage: /Downloads/Torrents --> mountpoint in jail /media

I configured transmission plugin for downloads and incomplete downloads in folder inside of Torrents

Then i took the way of going with Solution 2 and did the following in both jails:

Code:
service transmission stop
chown -R anton:anton /var/db/transmission
sysrc 'transmission_user=anton'
service transmission start


and

Code:
service sonarr onestop
chown -R anton:anton /var/db/sonarr
sysrc 'sonarr_user=anton'
service sonarr start


Sonarr has no write access to the /Downloads/Torrents Folder, it can't remove torrents from Transmission client. This is the output of ls -l /Download/Torrents from transmission and sonarr jail:

root@transmission_1:/media # ls -l
total 106
-rwxrwxr-x+ 1 anton anton 12292 Sep 18 23:21 .DS_Store
drwxrwxr-x+ 2 anton anton 2 Sep 19 06:27 incomplete
drwxrwxr-x+ 7 anton anton 8 Sep 19 06:27 seeding
drwxrwxr-x+ 2 anton anton 2 Sep 18 23:21 torrentfiles

root@sonarr_1:/ # ls -l /media/
total 123
-rwxrwxr-x+ 1 anton anton 12292 Sep 18 23:21 .DS_Store
-rwxrwxr-x+ 1 anton anton 0 Sep 13 07:04 .windows
drwxrwxr-x+ 5 anton anton 6 Sep 17 21:06 Movies
drwxrwxr-x+ 2 anton anton 2 Sep 13 07:55 Music
drwxrwxr-x+ 127 anton anton 128 Sep 19 00:05 Serien
drwxrwxr-x+ 5 anton anton 6 Sep 18 23:34 torrents
root@sonarr_1:/ # cd /media/torrents/
root@sonarr_1:/media/torrents # ls -l
total 106
-rwxrwxr-x+ 1 anton anton 12292 Sep 18 23:21 .DS_Store
drwxrwxr-x+ 2 anton anton 2 Sep 19 06:27 incomplete
drwxrwxr-x+ 7 anton anton 8 Sep 19 06:27 seeding
drwxrwxr-x+ 2 anton anton 2 Sep 18 23:21 torrentfiles
root@sonarr_1:/media/torrents #


Really need some help here...

kind regards
It looks like you implemented Solution #2 correctly so I see no reason UNIX permissions would stop sonarr from writing to those folders.

But you do have windows ACLs enabled on those folders, so that is probably the issue.
 

sleepless007

Cadet
Joined
Dec 4, 2015
Messages
6
This would be my only suspicion left, i'm gonna start over this evening setting up unix permissions and give it another shot

The strange thing is it's only transmission which is causing so much trouble, sonarr in combination with plex works like a charm, and then transmission enters the room :mad:...
I've been messing around for a whole day now...

all the best!
 

Wallybanger

Contributor
Joined
Apr 17, 2016
Messages
150
Shockingly, options 3 worked really well. Thanks. Now I don't have to leave my Transmission share open on the network :)
 

KennethW

Dabbler
Joined
Sep 24, 2016
Messages
13
Thanks! Used #2 solution for transmission as my dataset has user:user permission. Sweet!
 

bryce

Explorer
Joined
Apr 15, 2014
Messages
97
Created a new sabnzbd plugin jail to see if I can get this working without having to run sabnzbd as it's default user and having to work around all that shit. Anyways, here's what I did after adding my user bryce with a uid of 1001 and my group shareusers with a gid of 1001.

Code:
root@sabnzbd_2:/ # chown -R bryce:shareusers /var/db/sabnzbd					
root@sabnzbd_2:/ # chown -R bryce:shareusers /media							 
root@sabnzbd_2:/ # sysrc 'sabnzbd_user=bryce'								   
sabnzbd_user: bryce -> bryce													
root@sabnzbd_2:/ # service sabnzbd start										
Starting sabnzbd.															   
/usr/local/etc/rc.d/sabnzbd: WARNING: failed to start sabnzbd				   
root@sabnzbd_2:/ # ls -l /media												 
total 1																		 
-rw-rw-rw-  1 bryce  shareusers  0 Oct 10 10:21 New Text Document.txt		   
drwxrwxrwx  2 bryce  shareusers  2 Oct 10 10:21 New folder					 
root@sabnzbd_2:/ # ls -l /var/db/sabnzbd										
total 20																		
drwxr-xr-x  3 bryce  shareusers	 3 Oct 10 10:15 Downloads					
drwxr-xr-x  2 bryce  shareusers	 3 Oct 10 10:23 admin						
drwxr-xr-x  2 bryce  shareusers	 4 Oct 10 10:15 logs						 
-rw-------  1 bryce  shareusers  6534 Oct 10 10:31 sabnzbd.ini				 
-rw-------  1 bryce  shareusers  6534 Oct 10 10:31 sabnzbd.ini.bak 
 

Joshua Parker Ruehlig

Hall of Famer
Joined
Dec 5, 2011
Messages
5,949
Created a new sabnzbd plugin jail to see if I can get this working without having to run sabnzbd as it's default user and having to work around all that crap. Anyways, here's what I did after adding my user bryce with a uid of 1001 and my group shareusers with a gid of 1001.

Code:
root@sabnzbd_2:/ # chown -R bryce:shareusers /var/db/sabnzbd					
root@sabnzbd_2:/ # chown -R bryce:shareusers /media							
root@sabnzbd_2:/ # sysrc 'sabnzbd_user=bryce'								  
sabnzbd_user: bryce -> bryce													
root@sabnzbd_2:/ # service sabnzbd start										
Starting sabnzbd.															  
/usr/local/etc/rc.d/sabnzbd: WARNING: failed to start sabnzbd				  
root@sabnzbd_2:/ # ls -l /media												
total 1																		
-rw-rw-rw-  1 bryce  shareusers  0 Oct 10 10:21 New Text Document.txt		  
drwxrwxrwx  2 bryce  shareusers  2 Oct 10 10:21 New folder					
root@sabnzbd_2:/ # ls -l /var/db/sabnzbd										
total 20																		
drwxr-xr-x  3 bryce  shareusers	 3 Oct 10 10:15 Downloads					
drwxr-xr-x  2 bryce  shareusers	 3 Oct 10 10:23 admin						
drwxr-xr-x  2 bryce  shareusers	 4 Oct 10 10:15 logs						
-rw-------  1 bryce  shareusers  6534 Oct 10 10:31 sabnzbd.ini				
-rw-------  1 bryce  shareusers  6534 Oct 10 10:31 sabnzbd.ini.bak
possibly it isn't starting cause it needs permission to the pidfile directory. I wish the init script outputted this error =[

rm -r /var/run/sabnzbd
 

bryce

Explorer
Joined
Apr 15, 2014
Messages
97
I've tried removing removing the pid directory, doesn't change a thing. Just fails to start, no error in the console.
 

Joshua Parker Ruehlig

Hall of Famer
Joined
Dec 5, 2011
Messages
5,949
could you also try setting sabnzbd_group just in case that makes a difference.

maybe it would be good to see what errors are happening.
edit the "command_args" in /usr/local/etc/rc.d/sabnzbd and remove the "--daemon" then try starting it.
 
Status
Not open for further replies.
Top