Directory Permission Issues on 4.7 Beta 2?

Need help? Post your questions here.

Moderator: moderators

Directory Permission Issues on 4.7 Beta 2?

Postby asayler » Fri Jul 06, 2012 8:39 pm

Hello,

I'm using Subsonic 4.7 Beta 2 installed via the subsonic-4.7.beta2.deb package on a Ubuntu Server 12.04 x64 machine. This is a fresh install, not an upgrade.

From the "About Subsonic" page:
Code: Select all
Version:   4.7.beta2 (build 3011) – June 8, 2012
Server:   jetty-6.1.x, java 1.7.0_03, Linux (112.0 MB / 198.4 MB)


My java version:
Code: Select all
asayler@server:$ java -version
java version "1.7.0_03"
OpenJDK Runtime Environment (IcedTea7 2.1.1pre) (7~u3-2.1.1~pre1-1ubuntu3)
OpenJDK 64-Bit Server VM (build 22.0-b10, mixed mode)


I have Subsonic set to run as user "subsonic" via the necessary setting in the "/etc/default/subsonic" config file:
Code: Select all
SUBSONIC_USER=subsonic


This user has been assigned the UID of 110 as shown in the "/etc/passwd" file:
Code: Select all
subsonic:x:110:123::/home/subsonic:/bin/false


This user has also been assigned secondary membership in a group called "music-data" as shown in the "/etc/group" file:
Code: Select all
music-data:x:1002:asayler,subsonic


This is in addition to primary membership in the default "subsonic" group:
Code: Select all
subsonic:x:123:


I have confirmed that Subsonic is running as the "subsonic" user:
Code: Select all
asayler@server:$ ps -al | grep 110
0 S   110 17884     1  1  80   0 - 812047 futex_ pts/0   00:00:25 java


This works:
When I add a Media Folder to Subsonic pointing to the "subsonic" user home folder ("/home/subsonic"), the Media Folder content shows up in Subsonic after the necessary Media Folder scan. The "subsonic" home folder contains a single directory containing music files and has the following permissions (the same permissions and ownership apply to all sub-directories and sub-files):
Code: Select all
asayler@server:$ sudo -u subsonic ls -al /home/subsonic
total 20
drwxrwx--- 5 subsonic subsonic 4096 Jul  6 14:13 .
drwxr-xr-x 6 root     root     4096 Jun 11 19:07 ..
drwxrwx--- 3 subsonic subsonic 4096 Jul  6 13:52 Battlefield Band, The
drwxrwx--- 2 subsonic subsonic 4096 Jun 11 19:28 .fontconfig
drwxrwx--- 3 subsonic subsonic 4096 Jun 11 19:28 .java


These files all show up in Subsonic and I can play them without any issues. As expected, I can also access all of these files from the command line as the "subsonic" user.

This does not work:
When I add a Media Folder to Subsonic pointing to a shared music directory owned by another user and the "music-data" group, the Media Folder content fails to show up in Subsonic, even after a Media Folder scan. The music directory has the following permissions and contains several tens of thousands of songs organized in various sub-directories (the same permissions and ownership apply to all sub-directories and sub-files):
Code: Select all
asayler@server:$ sudo -u subsonic ls -al /data-store/music-store/
total 4
drwxrwxr-x 1 root    music-data  58 Jan 20 22:02 .
drwxrwxr-x 1 root    admin-data  66 Feb  9 14:07 ..
drwxrwxr-x 1 asayler music-data 122 Jul  1 23:38 asayler
drwxrwxr-x 1 asayler music-data   0 Jan 20 22:01 music
drwxrwxr-x 1 asayler music-data   0 Jan 20 22:02 playlists
drwxrwxr-x 1 asayler music-data   0 Jan 20 22:01 podcasts


These files do not show up in Subsonic. I am, however, able to access all of these files from the command line as the "subsonic" user.

Since the "subsonic" user is a member of the "music-data" group, and the group is given full permission (770) on the music directory and all sub-files and sub-directories, this should work. As you can see from the previous "ls" dump performed as the "subsonic" user, the user clearly has full access via the "music-data" group.

The Subsonic log does not provide any enlightenment:
Code: Select all
asayler@server:$ sudo tail /var/subsonic/subsonic.log
[2012-07-06 13:56:44,360] INFO MusicFolderDao - Created music folder /data-store/music-store
[2012-07-06 13:56:44,378] INFO MediaScannerService - Automatic media library scanning scheduled to run every 1 day(s), starting at Sat Jul 07 05:00:00 MDT 2012
[2012-07-06 13:57:07,774] INFO MediaScannerService - Starting to scan media library.
[2012-07-06 13:57:09,279] INFO MediaScannerService - Scanned media library with 20 entries.


I can resolve the issue by granting "other" read/execute permissions (775) on the music directory and all sub-directories and sub-files. But I would prefer not to do this, as I believe I should be able to make it work via only full group and owner permissions.
Edit: While though I had this working earlier with 775 permissions, when I try to duplicate it now It appears that even setting the read/execute permission to 775 do not resolve the issue...

Any ideas what I'm doing wrong, or why this is not working? I'm pretty sure I've used setups similar to this with previous (4.5 and before) versions of Subsonic without issue. Is this my mistake or a Subsonic bug?

Thanks,
Andy
Last edited by asayler on Fri Jul 06, 2012 9:09 pm, edited 1 time in total.
asayler
 
Posts: 29
Joined: Sat Nov 12, 2011 11:12 pm

Re: Directory Permission Issues on 4.7 Beta 2?

Postby asayler » Fri Jul 06, 2012 9:05 pm

The issue is definitively isolated to Subsonic. When I read a file and send the output to "/dev/null" as the "subsonic" user, everything works fine:

Code: Select all
asayler@server:$ sudo -u subsonic dd if=/data-store/music-store/asayler/flac/A/As\ Tall\ As\ Lions/As\ Tall\ As\ Lions/01\ -\ Stab\ City\ -\ 0939.flac of=/dev/null
49633+1 records in
49633+1 records out
25412140 bytes (25 MB) copied, 0.0251686 s, 1.0 GB/s
asayler
 
Posts: 29
Joined: Sat Nov 12, 2011 11:12 pm

Re: Directory Permission Issues on 4.7 Beta 2?

Postby asayler » Tue Jul 17, 2012 5:25 pm

Any thoughts on what might be going on here?

Anyone else using Subsonic running as a non-root user to successfully access media directories via group-based permission on Linux/Ubuntu 12.04?
asayler
 
Posts: 29
Joined: Sat Nov 12, 2011 11:12 pm

Re: Directory Permission Issues on 4.7 Beta 2?

Postby hakko » Tue Jul 17, 2012 8:56 pm

Another user reported that directories with a dash don't get scanned in 4.7 beta 2. Might be relevant for you too? viewtopic.php?f=5&t=9904&p=43573#p43570
MusicCabinet developer
hakko
 
Posts: 1416
Joined: Tue Apr 17, 2012 7:05 pm
Location: Sweden

Re: Directory Permission Issues on 4.7 Beta 2?

Postby asayler » Tue Jul 17, 2012 9:04 pm

That could very well be the issue, since I do use dashes in my directory names. That's a pretty major bug if it is the issue. And I don't really feel like redoing my entire systems FS structure just to accommodate Subsonic...

Hopefully this is fixed in the final 4.7 release.

Thanks for the pointer!
asayler
 
Posts: 29
Joined: Sat Nov 12, 2011 11:12 pm

Re: Directory Permission Issues on 4.7 Beta 2?

Postby diffy » Tue Jul 31, 2012 4:29 pm

asayler wrote:That could very well be the issue, since I do use dashes in my directory names. That's a pretty major bug if it is the issue. And I don't really feel like redoing my entire systems FS structure just to accommodate Subsonic...

Hopefully this is fixed in the final 4.7 release.

Thanks for the pointer!


Linux/Debian user, subsonic4.7b2 & subsonic4.6 here:
I have plenty of folders, thousands, with dashes in them - 95% of them in fact, and they are indexed just fine.

A wild guess is that it could be a java incompatibility.
diffy
 
Posts: 97
Joined: Fri Dec 30, 2011 11:28 pm
Location: Copenhagen, Denmark

Re: Directory Permission Issues on 4.7 Beta 2?

Postby asayler » Tue Jul 31, 2012 4:37 pm

diffy wrote:Linux/Debian user, subsonic4.7b2 & subsonic4.6 here:
I have plenty of folders, thousands, with dashes in them - 95% of them in fact, and they are indexed just fine.


Did you upgrade to 4.7, or do a fresh install? It was working fine in 4.6, so the issue is due to some new change in 4.7. It's possible that an upgrade works fine since it maintains the database. If you haven't tried it, I'd be curios to see what a clean 4.7 install does on your machine where it has to build the index from scratch.

diffy wrote:A wild guess is that it could be a java incompatibility.


It's possible. What version/make of Java are you using?

-Andy
asayler
 
Posts: 29
Joined: Sat Nov 12, 2011 11:12 pm

Re: Directory Permission Issues on 4.7 Beta 2?

Postby simpak » Sat Jun 22, 2013 9:42 am

asayler wrote:Hello,

I'm using Subsonic 4.7 Beta 2 installed via the subsonic-4.7.beta2.deb package on a Ubuntu Server 12.04 x64 machine. This is a fresh install, not an upgrade.

From the "About Subsonic" page:
Code: Select all
Version:   4.7.beta2 (build 3011) – June 8, 2012
Server:   jetty-6.1.x, java 1.7.0_03, Linux (112.0 MB / 198.4 MB)


My java version:
Code: Select all
asayler@server:$ java -version
java version "1.7.0_03"
OpenJDK Runtime Environment (IcedTea7 2.1.1pre) (7~u3-2.1.1~pre1-1ubuntu3)
OpenJDK 64-Bit Server VM (build 22.0-b10, mixed mode)


I have Subsonic set to run as user "subsonic" via the necessary setting in the "/etc/default/subsonic" config file:
Code: Select all
SUBSONIC_USER=subsonic


This user has been assigned the UID of 110 as shown in the "/etc/passwd" file:
Code: Select all
subsonic:x:110:123::/home/subsonic:/bin/false


This user has also been assigned secondary membership in a group called "music-data" as shown in the "/etc/group" file:
Code: Select all
music-data:x:1002:asayler,subsonic


This is in addition to primary membership in the default "subsonic" group:
Code: Select all
subsonic:x:123:


I have confirmed that Subsonic is running as the "subsonic" user:
Code: Select all
asayler@server:$ ps -al | grep 110
0 S   110 17884     1  1  80   0 - 812047 futex_ pts/0   00:00:25 java


This works:
When I add a Media Folder to Subsonic pointing to the "subsonic" user home folder ("/home/subsonic"), the Media Folder content shows up in Subsonic after the necessary Media Folder scan. The "subsonic" home folder contains a single directory containing music files and has the following permissions (the same permissions and ownership apply to all sub-directories and sub-files):
Code: Select all
asayler@server:$ sudo -u subsonic ls -al /home/subsonic
total 20
drwxrwx--- 5 subsonic subsonic 4096 Jul  6 14:13 .
drwxr-xr-x 6 root     root     4096 Jun 11 19:07 ..
drwxrwx--- 3 subsonic subsonic 4096 Jul  6 13:52 Battlefield Band, The
drwxrwx--- 2 subsonic subsonic 4096 Jun 11 19:28 .fontconfig
drwxrwx--- 3 subsonic subsonic 4096 Jun 11 19:28 .java


These files all show up in Subsonic and I can play them without any issues. As expected, I can also access all of these files from the command line as the "subsonic" user.

This does not work:
When I add a Media Folder to Subsonic pointing to a shared music directory owned by another user and the "music-data" group, the Media Folder content fails to show up in Subsonic, even after a Media Folder scan. The music directory has the following permissions and contains several tens of thousands of songs organized in various sub-directories (the same permissions and ownership apply to all sub-directories and sub-files):
Code: Select all
asayler@server:$ sudo -u subsonic ls -al /data-store/music-store/
total 4
drwxrwxr-x 1 root    music-data  58 Jan 20 22:02 .
drwxrwxr-x 1 root    admin-data  66 Feb  9 14:07 ..
drwxrwxr-x 1 asayler music-data 122 Jul  1 23:38 asayler
drwxrwxr-x 1 asayler music-data   0 Jan 20 22:01 music
drwxrwxr-x 1 asayler music-data   0 Jan 20 22:02 playlists
drwxrwxr-x 1 asayler music-data   0 Jan 20 22:01 podcasts


These files do not show up in Subsonic. I am, however, able to access all of these files from the command line as the "subsonic" user.

Since the "subsonic" user is a member of the "music-data" group, and the group is given full permission (770) on the music directory and all sub-files and sub-directories, this should work. As you can see from the previous "ls" dump performed as the "subsonic" user, the user clearly has full access via the "music-data" group.

The Subsonic log does not provide any enlightenment:
Code: Select all
asayler@server:$ sudo tail /var/subsonic/subsonic.log
[2012-07-06 13:56:44,360] INFO MusicFolderDao - Created music folder /data-store/music-store
[2012-07-06 13:56:44,378] INFO MediaScannerService - Automatic media library scanning scheduled to run every 1 day(s), starting at Sat Jul 07 05:00:00 MDT 2012
[2012-07-06 13:57:07,774] INFO MediaScannerService - Starting to scan media library.
[2012-07-06 13:57:09,279] INFO MediaScannerService - Scanned media library with 20 entries.


I can resolve the issue by granting "other" read/execute permissions (775) on the music directory and all sub-directories and sub-files. But I would prefer not to do this, as I believe I should be able to make it work via only full group and owner permissions.
Edit: While though I had this working earlier with 775 permissions, when I try to duplicate it now It appears that even setting the read/execute permission to 775 do not resolve the issue...

Any ideas what I'm doing wrong, or why this is not working? I'm pretty sure I've used setups similar to this with previous (4.5 and before) versions of Subsonic without issue. Is this my mistake or a Subsonic bug?

Thanks,
Andy



hat could very well be the issue, since I do use dashes in my directory names.
simpak
 
Posts: 1
Joined: Sat Jun 22, 2013 9:38 am


Return to Help

Who is online

Users browsing this forum: No registered users and 25 guests