Ubuntu + SVN: Could not open the requested SVN filesystem

luso picture luso · Sep 28, 2012 · Viewed 38.9k times · Source

I'm aware this question has been asked a lot of times. I believe I understand the answers, but I still had no luck.

I tried both one repo and multiple repos configurations, having the same issue for both of them.

So, with the config I'm interested in:

<Location /svn>
  DAV svn
  #SVNPath /media/ssd/svn/test
  SVNParentPath /media/ssd/svn
  SVNListParentPath On
  AuthType Basic
  AuthName "Subversion Repository"
  AuthUserFile /etc/apache2/dav_svn.passwd
  Require valid-user
</Location>

My repository

luso@bender:/media/ssd/svn$ ls -lart
total 16
drwx------ 7 luso     luso 4096 2012-09-15 16:20 ..
drwxr-sr-x 6 www-data svn  4096 2012-09-24 22:13 test
drwxrwsr-x 4 www-data svn  4096 2012-09-24 22:31 .
drwxr-sr-x 6 www-data svn  4096 2012-09-24 22:31 test2

Inside a project

luso@bender:/media/ssd/svn/test$ ls -lart
total 32
-rw-r--r-- 1 www-data svn  229 2012-09-24 22:13 README.txt
drwxr-sr-x 2 www-data svn 4096 2012-09-24 22:13 locks
drwxr-sr-x 2 www-data svn 4096 2012-09-24 22:13 hooks
drwxr-sr-x 2 www-data svn 4096 2012-09-24 22:13 conf
-r--r--r-- 1 www-data svn    2 2012-09-24 22:13 format
drwxr-sr-x 6 www-data svn 4096 2012-09-24 22:13 .
drwxrwsr-x 4 www-data svn 4096 2012-09-24 22:31 ..
drwxr-sr-x 6 www-data svn 4096 2012-09-24 22:40 db

the user luso and www-data are in both the svn and www-data groups. However, when /system/administration/users and groups, if I select the www-data user there is a warning: This account is disabled ¿¿?? If I try to enable it, it asks me to set a password. I didn't do it...

/media/ssd is my /dev/sdc drive (an ssd drive)

I can co using file:// protocol

luso@bender:~$ svn co file:///media/ssd/svn/test test
A    test/.classpath
A    test/.project
A    test/target
A    test/target/test-my-app-0.0.1-SNAPSHOT.jar
...
...

However,

luso@bender:~$ svn co http://localhost/svn/test test and
luso@bender:~$ svn co http://localhost/svn/test/trunk test

lead me to:

Authentication realm: <http://localhost:80> Subversion Repository
Password for 'luso': 
svn: Could not open the requested SVN filesystem

more precisely

<D:error xmlns:D="DAV:" xmlns:m="http://apache.org/dav/xmlns" xmlns:C="svn:">
<C:error/>
<m:human-readable errcode="13">Could not open the requested SVN filesystem</m:human-readable>
</D:error>

Of course, the same happens if I try to access via web browser...

And the same happens if I change

#SVNPath /media/ssd/svn/test
SVNParentPath /media/ssd/svn
SVNListParentPath On

with:

SVNPath /media/ssd/svn/test
#SVNParentPath /media/ssd/svn
#SVNListParentPath On

and reload/restart apache2

Also, the same happens when trying to access via https:// which is working fine.

I've read something indicating SELinux had something to do, but I don't dare to change this. I don't really know how to...

Might it be some kind of conflict with permissions? The /media/ssd drive is owned by luso... (no idea, just guessing)

So any other clue?

I'm running Ubuntu 10.04, Apache2, and StackOverflow :D

Thank you all.

EDIT: As suggested by p_strand, I've added a line

AuthzSVNAccessFile /etc/apache2/svn-policy-file

in dav_svn.conf config

Now, if I try http://localhost/svn/test it remains the same, and if I try http://localhost/svn I get a 403 Forbidden

Answer

Ian Roberts picture Ian Roberts · Sep 28, 2012
luso@bender:/media/ssd/svn$ ls -lart
total 16
drwx------ 7 luso     luso 4096 2012-09-15 16:20 ..

This is probably your problem - while the repository directories are accessible to the www-data user, their parent directory /media/ssd isn't. It and all its parent directories up the tree need at least world-execute permission (rwx--x--x or 711). The www-data user doesn't need to be allowed to read these directories but it does need to be able to descend into them (which is what the execute bit means for a directory).