You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@subversion.apache.org by Chris Rodgers <ch...@cardiov.ox.ac.uk> on 2017/10/05 10:31:37 UTC

Query about warnings: mod_dav_svn: nested Location '/repos/reponame' hinders access to '' in SVNPath Location '/repos/reponame'

Dear Subversion team,

I run subversion on a Fedora 26 machine, with Apache 2.4.27 and
Subversion mod_dav_svn 1.9.7 installed from the Fedora repositories.

I see lots of errors like this in my httpd error_log:

> [Thu Oct 05 10:53:19.131284 2017] [:warn] [pid 30014] mod_dav_svn:
> nested Location '/repos/reponame' hinders access to '' in SVNPath
> Location '/repos/reponame'
Here is the section for this repository in
/etc/httpd/conf.d/subversion.conf:

> <Location /repos/reponame>
>    DAV svn
>    SVNPath /srv/svn/repos/reponame
>    SVNIndexXSLT "/repos-web/view/repos-reponame.xsl"
>
>    # Include per-directory access control policy
>    AuthzSVNAccessFile /srv/svn/user_access/reponame_authz
>
>       # Require SSL connection for password protection.
>       SSLRequireSSL
>
>       AuthType Basic
>       AuthName "Authorization Realm"
>       AuthUserFile /srv/svn/user_access/reponame_passwd
>       Require valid-user
> </Location>

There are other equivalent <Location /repos/othername> blocks too.

How can I suppress this warning? / Does it matter?

Things I previously tried:

1. Per https://groups.google.com/forum/#!topic/subversion_users/kQNOHEYjjvs

I grepped all files in /etc/httpd to check. I do not have any nested
Location blocks in my config.

2. Again per
https://groups.google.com/forum/#!topic/subversion_users/kQNOHEYjjvs

I adjusted the Location block to <Location /repos/reponame/>

and SVNPath /srv/svn/repos/reponame to SVNPath /srv/svn/repos/reponame/

(i.e. adding a trailing slash).

But this did not remove the warning, AND it meant that a svn clients now
show an error accessing the repository root:

> $ svn ls 'https://hostname/repos/reponame'
> svn: E175002: Unable to connect to a repository at URL
> 'https://hostname/repos/reponame'
> svn: E175002: The OPTIONS request returned invalid XML in the
> response: XML parse error at line 1: no element found
> (https://hostname/repos/reponame)
>
> and
>
> $ svn ls
> 'https://cardiosvn.fmrib.ox.ac.uk/repos/crodgers/'                                                      
>  
> svn: E175002: Unable to connect to a repository at URL
> 'https://hostname/repos/reponame'
> svn: E175002: The OPTIONS request returned invalid XML in the
> response: XML parse error at line 1: no element found
> (https://hostname/repos/reponame)
>
>
Note that the two svn ls commands both send a URL to the server (seen in
the access_log) WITHOUT the trailing slash.


Using Chrome web browser, I see a 404 error at
https://hostname/repos/reponame (correctly I think - there is no such
file in the httpd web root folder) and I see the repository listing at
https://hostname/repos/reponame/


Using TortoiseSVN's repository browser FAILS with this setup with an XML
error like the command line.


svn ls, Chrome, and TortoiseSVN's repository browser can access folders
within the repository OK, e.g. svn ls
'https://hostname/repos/reponame/dir1' or svn ls
'https://hostname/repos/reponame/dir1/' are both fine.

Best wishes,

Chris.


Re: Query about warnings: mod_dav_svn: nested Location '/repos/reponame' hinders access to '' in SVNPath Location '/repos/reponame'

Posted by Daniel Shahaf <d....@daniel.shahaf.name>.
Chris Rodgers wrote on Thu, 05 Oct 2017 12:37 +0100:
> You were right about the double Include of the subversion.conf file.
> Thank you!

You're welcome.  I've clarified the error message in r1811189 and
nominated it for backport to 1.9.8:

     ap_log_error(APLOG_MARK, APLOG_WARNING, 0, NULL,
-                 "mod_dav_svn: nested Location '%s' hinders access to '%s' "
-                 "in SVNPath Location '%s'",
+                 "mod_dav_svn: Location '%s' hinders access to '%s' "
+                 "in parent SVNPath Location '%s'",
                  child->root_dir,
                  svn_urlpath__skip_ancestor(parent->root_dir, child->root_dir),
                  parent->root_dir);

Cheers,

Daniel

Re: Query about warnings: mod_dav_svn: nested Location '/repos/reponame' hinders access to '' in SVNPath Location '/repos/reponame'

Posted by Chris Rodgers <ch...@cardiov.ox.ac.uk>.
Hi Daniel,

You were right about the double Include of the subversion.conf file.
Thank you!

Best wishes,

Chris.

Re: Query about warnings: mod_dav_svn: nested Location '/repos/reponame' hinders access to '' in SVNPath Location '/repos/reponame'

Posted by Daniel Shahaf <d....@daniel.shahaf.name>.
Chris Rodgers wrote on Thu, 05 Oct 2017 11:31 +0100:
> > [Thu Oct 05 10:53:19.131284 2017] [:warn] [pid 30014] mod_dav_svn:
> > nested Location '/repos/reponame' hinders access to '' in SVNPath
> > Location '/repos/reponame'

This error means that you have two <Location /repos/reponame> blocks
with SVNPath directives.  It is worded this way because it's written
with <Location /foo> and <Location /foo/bar> pairs in mind.

This might just mean that subversion.conf is included twice into httpd.conf.

> How can I suppress this warning? / Does it matter?
> 

You can suppress the warning by ensuring that every possible /foo/bar
URL path belongs to at most one SVNPath/SVNParentPath <Location>
scope.  I'm not familiar enough with httpd internals to answer the
second question.

> Things I previously tried:
> 
> 1. Per https://groups.google.com/forum/#!topic/subversion_users/kQNOHEYjjvs
> 
> I grepped all files in /etc/httpd to check. I do not have any nested
> Location blocks in my config.
> 

As above, it is not the <Location> blocks that are nested but the URLs:

<Location /foo>
  SVNPath /x
</Location>
⋮
<Location /foo/bar>
  SVNPath /y
</Location>

> 2. Again per
> https://groups.google.com/forum/#!topic/subversion_users/kQNOHEYjjvs
> 
> I adjusted the Location block to <Location /repos/reponame/>
> 
> and SVNPath /srv/svn/repos/reponame to SVNPath /srv/svn/repos/reponame/
> 
> (i.e. adding a trailing slash).
> 
> But this did not remove the warning, AND it meant that a svn clients now
> show an error accessing the repository root:
> 
> > $ svn ls 'https://hostname/repos/reponame'
> > svn: E175002: Unable to connect to a repository at URL
> > 'https://hostname/repos/reponame'
> > svn: E175002: The OPTIONS request returned invalid XML in the
> > response: XML parse error at line 1: no element found
> > (https://hostname/repos/reponame)
> >
> > and
> >
> > $ svn ls
> > 'https://cardiosvn.fmrib.ox.ac.uk/repos/crodgers/'                                                      
> >  
> > svn: E175002: Unable to connect to a repository at URL
> > 'https://hostname/repos/reponame'
> > svn: E175002: The OPTIONS request returned invalid XML in the
> > response: XML parse error at line 1: no element found
> > (https://hostname/repos/reponame)
> >
> >
> Note that the two svn ls commands both send a URL to the server (seen in
> the access_log) WITHOUT the trailing slash.

Yes, Subversion internally always strips trailing slashes.  (This
actually happens in the client before it calls into the libraries.)  That's
why adding the trailing slash breaks the repository root URL: it makes
the Location block not match it.

HTH

Daniel