SOLVED User configuration to allow Subsonic to read media library

Status
Not open for further replies.

bcknapp

Dabbler
Joined
Dec 28, 2014
Messages
11
Hello everyone,

Disclaimer: I am still very new to BSD and FreeNAS and am trying to learn the basics such as how users and permissions work within this environment. I come from a long history of using Windows and I am learning that permissions, users, and groups are handled very differently. Please bare with me as I am a newbie.

I have installed the Subsonic plugin in the past with no problems, but with dataset permissions which were more lax (Other was set to read and execute). With this installation I have tried to tighten up the dataset permissions (Other is set to none), but it has caused the Subsonic plugin to not be able to read my music library (I have tested this, and I think this to be the cause). Currently, I have my music library stored in a dataset called media, with permissions as such:

Owner: read, write, execute,
Group: read, write, execute,
Other: none

As of now Subsonic is unable to scan the media folder that I have linked via the "add storage" button in the jail section.

I had a similar issue when installing the BitTorrent Sync plugin, but I was able to solve the issue by following this guide posted by Cainram https://forums.freenas.org/index.php?threads/btsync-configuration-guide.22927/

In the above process there is an existing user called btsync that exists in the jail when the plugin is installed. I created a group with a group ID that matched the group owner name and ID of the dataset I wanted the plugin to be able to access, made this matched group the owner of the linked mount point (or whatever you would call it), and added the existing btsync user to that group (all within the jail), thus allowing the bittorrent sync plugin access to the freenas dataset.

I am wondering if that process or something similar can be done with the Subsonic plugin such that I don't have to allow any permissions for Other to my dataset? I compared the list of users in both my BTsync jail and my Subsonic jail to see if I can find a user Subsonic, or something equally obvious. The only 2 users that existed in the Subsonic jail that did not exist in the BTsync jail were media and cups. Is it possible that the user media is what Subsonic uses?

Again, my understanding of the way permissions work with programs and services in BSD is still very limited so I appreciate if someone more knowledgeable could steer me in the right direction.

Thank you!
Brian
 

bcknapp

Dabbler
Joined
Dec 28, 2014
Messages
11
Ok, so just after I finished writing this I came upon a section in the freebsd handbook about viewing processes and I was able to determine that the user media is in fact the user that owns the subsonic process.

Within the jail I created the group family with id 1003 to match the group owner of the dataset on my freenas and added the user media to it. I restarted the plugin and the jail, but unfortunately subsonic is still unable to see or scan my media library.

Any suggestions are appreciated.

Thanks
 

Joshua Parker Ruehlig

Hall of Famer
Joined
Dec 5, 2011
Messages
5,949
Ok, so just after I finished writing this I came upon a section in the freebsd handbook about viewing processes and I was able to determine that the user media is in fact the user that owns the subsonic process.

Within the jail I created the group family with id 1003 to match the group owner of the dataset on my freenas and added the user media to it. I restarted the plugin and the jail, but unfortunately subsonic is still unable to see or scan my media library.

Any suggestions are appreciated.

Thanks
What you are doing sounds like it should work. (Adding media to a group that matches the group that owns the data) Resterting the jail / plugin should be unnecessary in this case.

I'm surprised subsonic still can't browse to the music, can you show the permissions of some music files/folders. "ls -l /path/to/music"

EDIT
And as a sanity check, you...
1) mounted you media dataset into the jail
2) entered the jail's perspective to these files in Subsonic
 

bcknapp

Dabbler
Joined
Dec 28, 2014
Messages
11
Hi Joshua,

Been working on this all evening and I think I've just solved it.

Yes to both of your sanity check questions. With some trial and error I found that when I changed the mount location to what subsonic defaults to (/var/music) rather than the others I had tried (/media/music -- i soon realized this was the user media's home folder and might cause problems, and /mnt/music) after creating the identical group and adding the user media to it, everything worked fine!

It took my whole evening but I have a slightly better understanding of how it all works.

As for the permissions to the music path, I assume you are referring to within the jail?

Here is a what that shows:

Code:
root@subsonic_1:/ # ls -l /var/music                                           
total 13339                                                                    
drwxrwx---   16 1001  family        21 Jan  8 16:32 !DRM                       
drwxrwx---    2 1001  family         3 Jan  8 16:32 $RECYCLE.BIN               
drwxrwx---   20 1001  family        20 Jan  8 16:38 Books                      
drwxrwx---   16 1001  family        16 Jan  8 16:39 Christmas                  
drwxrwx---   45 1001  family        45 Jan  8 16:49 Cloud-BK                   
drwxrwx---   46 1001  family        46 Jan  8 16:58 Cloud-BK (Untagged)        
drwxrwx---  195 1001  family       195 Jan  8 17:34 Cloud-JT                   
drwxrwx---   99 1001  family        99 Jan  8 17:45 Cloud-JT (Untagged)        
drwxrwx---    7 1001  family         7 Jan  8 17:45 Cloud-SK                   
drwxrwx---   10 1001  family        10 Jan  8 17:46 Comedy                     
-rwxrwx---    1 1001  family  13316920 Dec  4 08:32 Mew -- The Zookeeper_s Boy L
ive In Copenhagen Nov 14.mp3                                                   
drwxrwx---   15 1001  family        15 Jan  8 17:47 Mixes                      
drwxrwx---   71 1001  family        71 Jan  8 17:56 Music                      
drwxrwx---  863 1001  family       863 Jan  8 18:36 Music (Untagged)           
drwxrwx---    3 1001  family        70 Jan  8 18:36 Playlists                  
drwxrwx---    5 1001  family         5 Jan  8 18:36 Purchased                  
drwxrwx---    3 1001  family         4 Jan  8 18:38 Rips                       
drwxrwx---    3 1001  family         3 Jan  8 18:38 Sort                       
-rwxrwx---    1 1001  family        84 Jan  8 16:32 desktop.ini       


I guess it doesn't matter too much now, but can you seen any reason why that would have caused problems when I was mounting it in the previously mentioned locations?

Thanks for your reply!

Brian
 

Joshua Parker Ruehlig

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

Been working on this all evening and I think I've just solved it.

Yes to both of your sanity check questions. With some trial and error I found that when I changed the mount location to what subsonic defaults to (/var/music) rather than the others I had tried (/media/music -- i soon realized this was the user media's home folder and might cause problems, and /mnt/music) after creating the identical group and adding the user media to it, everything worked fine!

It took my whole evening but I have a slightly better understanding of how it all works.

As for the permissions to the music path, I assume you are referring to within the jail?

Here is a what that shows:

Code:
root@subsonic_1:/ # ls -l /var/music                                          
total 13339                                                                   
drwxrwx---   16 1001  family        21 Jan  8 16:32 !DRM                      
drwxrwx---    2 1001  family         3 Jan  8 16:32 $RECYCLE.BIN              
drwxrwx---   20 1001  family        20 Jan  8 16:38 Books                     
drwxrwx---   16 1001  family        16 Jan  8 16:39 Christmas                 
drwxrwx---   45 1001  family        45 Jan  8 16:49 Cloud-BK                  
drwxrwx---   46 1001  family        46 Jan  8 16:58 Cloud-BK (Untagged)       
drwxrwx---  195 1001  family       195 Jan  8 17:34 Cloud-JT                  
drwxrwx---   99 1001  family        99 Jan  8 17:45 Cloud-JT (Untagged)       
drwxrwx---    7 1001  family         7 Jan  8 17:45 Cloud-SK                  
drwxrwx---   10 1001  family        10 Jan  8 17:46 Comedy                    
-rwxrwx---    1 1001  family  13316920 Dec  4 08:32 Mew -- The Zookeeper_s Boy L
ive In Copenhagen Nov 14.mp3                                                  
drwxrwx---   15 1001  family        15 Jan  8 17:47 Mixes                     
drwxrwx---   71 1001  family        71 Jan  8 17:56 Music                     
drwxrwx---  863 1001  family       863 Jan  8 18:36 Music (Untagged)          
drwxrwx---    3 1001  family        70 Jan  8 18:36 Playlists                 
drwxrwx---    5 1001  family         5 Jan  8 18:36 Purchased                 
drwxrwx---    3 1001  family         4 Jan  8 18:38 Rips                      
drwxrwx---    3 1001  family         3 Jan  8 18:38 Sort                      
-rwxrwx---    1 1001  family        84 Jan  8 16:32 desktop.ini       


I guess it doesn't matter too much now, but can you seen any reason why that would have caused problems when I was mounting it in the previously mentioned locations?

Thanks for your reply!

Brian
permission levels look fine. media's home folder is actually /nonexistent, so that shouldn't be an issue.

I usually just put things under /mnt/whatever and never have an issue so I'm not sure why you were having one. Glad you got it solved though!
 

pizzaazzip

Dabbler
Joined
Dec 3, 2015
Messages
25
permission levels look fine. media's home folder is actually /nonexistent, so that shouldn't be an issue.

I usually just put things under /mnt/whatever and never have an issue so I'm not sure why you were having one. Glad you got it solved though!

Joshua,

Hey I've been having the same problem, here is my output of ls -l /var/music:
Code:
drwxr-xr-x 1 root wheel 16384 Nov 21 16:07 Strokes
drwxr-xr-x 1 root wheel 16384 Sep 24 2014 Styx
drwxr-xr-x 1 root wheel 16384 Jan 11 2015 Sum41
drwxr-xr-x 1 root wheel 16384 Apr 6 2014 SuperTramp
drwxr-xr-x 1 root wheel 16384 Dec 6 2014 Swedish House Mafia
drwxr-xr-x 1 root wheel 16384 Dec 7 07:13 Tame Impala
drwxr-xr-x 1 root wheel 16384 Oct 11 15:56 Taylor Swift
drwxr-xr-x 1 root wheel 16384 Nov 10 2014 Tears For Fears
drwxr-xr-x 1 root wheel 16384 Apr 20 2014 Tessa Violet
drwxr-xr-x 1 root wheel 16384 Feb 6 18:49 The Black Keys
drwxr-xr-x 1 root wheel 16384 Sep 26 2015 Toadies
drwxr-xr-x 1 root wheel 16384 Apr 6 2014 Toki Tsukasadoru
drwxr-xr-x 1 root wheel 16384 Feb 7 09:51 Two Door Cinema Club
drwxr-xr-x 1 root wheel 16384 Aug 31 2014 Vampire Weekend
drwxr-xr-x 1 root wheel 16384 Feb 7 09:50 Various Artists
drwxr-xr-x 1 root wheel 16384 Dec 6 2014 We Are Scientists
drwxr-xr-x 1 root wheel 16384 Feb 25 2015 Weezer


Any idea of what I'm doing wrong?
 

Joshua Parker Ruehlig

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

Hey I've been having the same problem, here is my output of ls -l /var/music:
Code:
drwxr-xr-x 1 root wheel 16384 Nov 21 16:07 Strokes
drwxr-xr-x 1 root wheel 16384 Sep 24 2014 Styx
drwxr-xr-x 1 root wheel 16384 Jan 11 2015 Sum41
drwxr-xr-x 1 root wheel 16384 Apr 6 2014 SuperTramp
drwxr-xr-x 1 root wheel 16384 Dec 6 2014 Swedish House Mafia
drwxr-xr-x 1 root wheel 16384 Dec 7 07:13 Tame Impala
drwxr-xr-x 1 root wheel 16384 Oct 11 15:56 Taylor Swift
drwxr-xr-x 1 root wheel 16384 Nov 10 2014 Tears For Fears
drwxr-xr-x 1 root wheel 16384 Apr 20 2014 Tessa Violet
drwxr-xr-x 1 root wheel 16384 Feb 6 18:49 The Black Keys
drwxr-xr-x 1 root wheel 16384 Sep 26 2015 Toadies
drwxr-xr-x 1 root wheel 16384 Apr 6 2014 Toki Tsukasadoru
drwxr-xr-x 1 root wheel 16384 Feb 7 09:51 Two Door Cinema Club
drwxr-xr-x 1 root wheel 16384 Aug 31 2014 Vampire Weekend
drwxr-xr-x 1 root wheel 16384 Feb 7 09:50 Various Artists
drwxr-xr-x 1 root wheel 16384 Dec 6 2014 We Are Scientists
drwxr-xr-x 1 root wheel 16384 Feb 25 2015 Weezer


Any idea of what I'm doing wrong?
So you added the /var/music folder to subsonic, started a rescan, and it'd not seeing the music? Those folders are all world readable so it doesn't seem like a permission issue you're facing
 

pizzaazzip

Dabbler
Joined
Dec 3, 2015
Messages
25
As far as I can tell that is what I did. When I entered some random thing in the folder location, it told me that folder didn't exist so that's nice.

OWTYl5N.png


Here is what the logs say.

Code:
[3/30/16 8:42:11 PM MDT] INFO UPnPService Disabling UPnP/DLNA media server
[3/30/16 8:42:11 PM MDT] INFO UPnPService Starting UPnP service - Done!
[3/30/16 8:42:18 PM MDT] INFO BootstrapVerificationFilter Servlet container: jetty-6.1.x
[3/30/16 8:42:18 PM MDT] INFO VersionService Resolved local Subsonic version to: 5.3
[3/30/16 8:42:18 PM MDT] INFO PlayerDao Created player 1.
[3/30/16 8:42:19 PM MDT] INFO VersionService Resolved latest Subsonic final version to: 5.3
[3/30/16 8:42:19 PM MDT] INFO VersionService Resolved latest Subsonic beta version to: 6.0.beta2
[3/30/16 8:42:21 PM MDT] WARN NetworkService No UPnP router found.
[3/30/16 8:42:28 PM MDT] INFO MediaScannerService Starting to scan media library.
[3/30/16 8:42:28 PM MDT] INFO MediaScannerService Scanned media library with 1 entries.
[3/30/16 8:42:28 PM MDT] INFO MediaScannerService Marking non-present files.
[3/30/16 8:42:28 PM MDT] INFO MediaScannerService Marking non-present artists.
[3/30/16 8:42:28 PM MDT] INFO MediaScannerService Marking non-present albums.
[3/30/16 8:42:28 PM MDT] INFO MediaScannerService Completed media library scan.
[3/30/16 8:42:28 PM MDT] INFO PlaylistService Starting playlist import.
[3/30/16 8:42:28 PM MDT] INFO PlaylistService Completed playlist import.
[3/30/16 8:47:11 PM MDT] INFO PodcastService Starting scheduled Podcast refresh.
[3/30/16 8:47:11 PM MDT] INFO PodcastService Completed scheduled Podcast refresh.
[3/30/16 8:52:54 PM MDT] INFO MediaScannerService Starting to scan media library.
[3/30/16 8:52:54 PM MDT] INFO MediaScannerService Scanned media library with 1 entries.
[3/30/16 8:52:54 PM MDT] INFO MediaScannerService Marking non-present files.
[3/30/16 8:52:54 PM MDT] INFO MediaScannerService Marking non-present artists.
[3/30/16 8:52:54 PM MDT] INFO MediaScannerService Marking non-present albums.
[3/30/16 8:52:54 PM MDT] INFO MediaScannerService Completed media library scan.
[3/30/16 8:52:55 PM MDT] INFO PlaylistService Starting playlist import.
[3/30/16 8:52:55 PM MDT] INFO PlaylistService Completed playlist import.
[3/30/16 9:11:43 PM MDT] INFO MediaScannerService Starting to scan media library.
[3/30/16 9:11:43 PM MDT] INFO MediaScannerService Scanned media library with 1 entries.
[3/30/16 9:11:43 PM MDT] INFO MediaScannerService Marking non-present files.
[3/30/16 9:11:43 PM MDT] INFO MediaScannerService Marking non-present artists.
[3/30/16 9:11:43 PM MDT] INFO MediaScannerService Marking non-present albums.
[3/30/16 9:11:43 PM MDT] INFO MediaScannerService Completed media library scan.
[3/30/16 9:11:43 PM MDT] INFO PlaylistService Starting playlist import.
[3/30/16 9:11:43 PM MDT] INFO PlaylistService Completed playlist import.
[3/30/16 9:15:16 PM MDT] INFO MediaScannerService Starting to scan media library.
[3/30/16 9:15:16 PM MDT] INFO MediaScannerService Scanned media library with 1 entries.
[3/30/16 9:15:16 PM MDT] INFO MediaScannerService Marking non-present files.
[3/30/16 9:15:16 PM MDT] INFO MediaScannerService Marking non-present artists.
[3/30/16 9:15:16 PM MDT] INFO MediaScannerService Marking non-present albums.
[3/30/16 9:15:16 PM MDT] INFO MediaScannerService Completed media library scan.
[3/30/16 9:15:16 PM MDT] INFO PlaylistService Starting playlist import.
[3/30/16 9:15:16 PM MDT] INFO PlaylistService Completed playlist import.
[3/30/16 10:45:44 PM MDT] INFO MediaScannerService Starting to scan media library.
[3/30/16 10:45:54 PM MDT] INFO MediaScannerService Scanned media library with 1 entries.
[3/30/16 10:45:54 PM MDT] INFO MediaScannerService Marking non-present files.
[3/30/16 10:45:54 PM MDT] INFO MediaScannerService Marking non-present artists.
[3/30/16 10:45:54 PM MDT] INFO MediaScannerService Marking non-present albums.
[3/30/16 10:45:54 PM MDT] INFO MediaScannerService Completed media library scan.
[3/30/16 10:45:54 PM MDT] INFO PlaylistService Starting playlist import.
[3/30/16 10:45:54 PM MDT] INFO PlaylistService Completed playlist import.
 

Joshua Parker Ruehlig

Hall of Famer
Joined
Dec 5, 2011
Messages
5,949
As far as I can tell that is what I did. When I entered some random thing in the folder location, it told me that folder didn't exist so that's nice.

OWTYl5N.png


Here is what the logs say.

Code:
[3/30/16 8:42:11 PM MDT] INFO UPnPService Disabling UPnP/DLNA media server
[3/30/16 8:42:11 PM MDT] INFO UPnPService Starting UPnP service - Done!
[3/30/16 8:42:18 PM MDT] INFO BootstrapVerificationFilter Servlet container: jetty-6.1.x
[3/30/16 8:42:18 PM MDT] INFO VersionService Resolved local Subsonic version to: 5.3
[3/30/16 8:42:18 PM MDT] INFO PlayerDao Created player 1.
[3/30/16 8:42:19 PM MDT] INFO VersionService Resolved latest Subsonic final version to: 5.3
[3/30/16 8:42:19 PM MDT] INFO VersionService Resolved latest Subsonic beta version to: 6.0.beta2
[3/30/16 8:42:21 PM MDT] WARN NetworkService No UPnP router found.
[3/30/16 8:42:28 PM MDT] INFO MediaScannerService Starting to scan media library.
[3/30/16 8:42:28 PM MDT] INFO MediaScannerService Scanned media library with 1 entries.
[3/30/16 8:42:28 PM MDT] INFO MediaScannerService Marking non-present files.
[3/30/16 8:42:28 PM MDT] INFO MediaScannerService Marking non-present artists.
[3/30/16 8:42:28 PM MDT] INFO MediaScannerService Marking non-present albums.
[3/30/16 8:42:28 PM MDT] INFO MediaScannerService Completed media library scan.
[3/30/16 8:42:28 PM MDT] INFO PlaylistService Starting playlist import.
[3/30/16 8:42:28 PM MDT] INFO PlaylistService Completed playlist import.
[3/30/16 8:47:11 PM MDT] INFO PodcastService Starting scheduled Podcast refresh.
[3/30/16 8:47:11 PM MDT] INFO PodcastService Completed scheduled Podcast refresh.
[3/30/16 8:52:54 PM MDT] INFO MediaScannerService Starting to scan media library.
[3/30/16 8:52:54 PM MDT] INFO MediaScannerService Scanned media library with 1 entries.
[3/30/16 8:52:54 PM MDT] INFO MediaScannerService Marking non-present files.
[3/30/16 8:52:54 PM MDT] INFO MediaScannerService Marking non-present artists.
[3/30/16 8:52:54 PM MDT] INFO MediaScannerService Marking non-present albums.
[3/30/16 8:52:54 PM MDT] INFO MediaScannerService Completed media library scan.
[3/30/16 8:52:55 PM MDT] INFO PlaylistService Starting playlist import.
[3/30/16 8:52:55 PM MDT] INFO PlaylistService Completed playlist import.
[3/30/16 9:11:43 PM MDT] INFO MediaScannerService Starting to scan media library.
[3/30/16 9:11:43 PM MDT] INFO MediaScannerService Scanned media library with 1 entries.
[3/30/16 9:11:43 PM MDT] INFO MediaScannerService Marking non-present files.
[3/30/16 9:11:43 PM MDT] INFO MediaScannerService Marking non-present artists.
[3/30/16 9:11:43 PM MDT] INFO MediaScannerService Marking non-present albums.
[3/30/16 9:11:43 PM MDT] INFO MediaScannerService Completed media library scan.
[3/30/16 9:11:43 PM MDT] INFO PlaylistService Starting playlist import.
[3/30/16 9:11:43 PM MDT] INFO PlaylistService Completed playlist import.
[3/30/16 9:15:16 PM MDT] INFO MediaScannerService Starting to scan media library.
[3/30/16 9:15:16 PM MDT] INFO MediaScannerService Scanned media library with 1 entries.
[3/30/16 9:15:16 PM MDT] INFO MediaScannerService Marking non-present files.
[3/30/16 9:15:16 PM MDT] INFO MediaScannerService Marking non-present artists.
[3/30/16 9:15:16 PM MDT] INFO MediaScannerService Marking non-present albums.
[3/30/16 9:15:16 PM MDT] INFO MediaScannerService Completed media library scan.
[3/30/16 9:15:16 PM MDT] INFO PlaylistService Starting playlist import.
[3/30/16 9:15:16 PM MDT] INFO PlaylistService Completed playlist import.
[3/30/16 10:45:44 PM MDT] INFO MediaScannerService Starting to scan media library.
[3/30/16 10:45:54 PM MDT] INFO MediaScannerService Scanned media library with 1 entries.
[3/30/16 10:45:54 PM MDT] INFO MediaScannerService Marking non-present files.
[3/30/16 10:45:54 PM MDT] INFO MediaScannerService Marking non-present artists.
[3/30/16 10:45:54 PM MDT] INFO MediaScannerService Marking non-present albums.
[3/30/16 10:45:54 PM MDT] INFO MediaScannerService Completed media library scan.
[3/30/16 10:45:54 PM MDT] INFO PlaylistService Starting playlist import.
[3/30/16 10:45:54 PM MDT] INFO PlaylistService Completed playlist import.
Not sure why it wouldn't see your files, I just tested my system and it works as expected. Maybe you can check the permission levels of the actual music files.
You could try changing the ownership to the user subsonic runs as just to see if that makes a difference
Code:
chown -R media:media /var/music
 

pizzaazzip

Dabbler
Joined
Dec 3, 2015
Messages
25
Not sure why it wouldn't see your files, I just tested my system and it works as expected. Maybe you can check the permission levels of the actual music files.
You could try changing the ownership to the user subsonic runs as just to see if that makes a difference
Code:
chown -R media:media /var/music
So I tried to change the ownership and it looks like it didn't do anything. I'm going to assume I'm just having issues with my file sharing for these folders (look at my previous posts if you are curious, it is a bit of a cluster) and I will try to use subsonic when I actually have these files stored in the NAS itself. Thanks for your help, hopefully when my server is properly setup, I won't have this issue.
 

pizzaazzip

Dabbler
Joined
Dec 3, 2015
Messages
25
Not sure why it wouldn't see your files, I just tested my system and it works as expected. Maybe you can check the permission levels of the actual music files.
You could try changing the ownership to the user subsonic runs as just to see if that makes a difference
Code:
chown -R media:media /var/music

BTW, I just setup subsonic on a different machine unrelated to FreeNAS and I think my problem with this was not giving my user account permissions to see the music folder. It is not default to give the admin user permissions to that folder and I imagine it wasn't default when I was working on this in April. I've got that FreeNAS box powered down currently so I can upgrade it easier so I'm not 100% sure about this..but I'm pretty sure this was the problem.
 
Status
Not open for further replies.
Top