14
votes

Trying to checkout from my SVN repo gives me

    svn: E195019: Redirect cycle detected for URL ...

However, it appears as if this error only occurs when I am behind some (specific) proxy server.

As discussed in other post (see tortoise svn giving me "Redirect cycle detected for URL 'domain/svn'" ), this error occurs if the SVN DAV is misconfigured, e.g., using SVNParentPath where one should use SVNPath. However, my configuration appears to be correct and - as far as I know - the problem only occurs when behind a proxy.

The setup of the repository is more or less standard, e.g.,

    ServerAlias  svn.mydomain.com
    <Location /myrepo>
        DAV svn
        SVNPath /var/www/vhosts/mydomain.com/svn/myrepo
        AuthType Basic
        AuthName "mydomain svn"
        AuthUserFile /var/www/vhosts/svn.mydomain.com/conf/htpasswd-myproject
        # Allow read-only access to anyone, otherwise require
        # require authentication
            Require valid-user
    </Location>
5

5 Answers

21
votes

I was facing similar kind of error following this tutorial: How to Install SVN Server on Ubuntu 18.04 & 16.04 LTS. Later realized, I have to delete the following line in Step 5

Alias /svn /var/lib/svn

14
votes

(I given an answer to my own question, after using half a weekend to search for the solution):

It appears as if this error message is related to the fact that the subversion repository is located in a directory svn/myrepo where the directory svn is also listed as the DocumentRoot of the subdomain svn.mydomain.com. That DocumentRoot directive was not obvious to me, since the document root of the subdomain was configered in a different conf file (I am using Plesk to maintain the server). This created some kind of ambiguity. Once I moved the document root of the subdomain to a different location, the error message went away.

The problem was hard to track down, because - as far as I know -

  • The error does not appear if the repo is located at the top level of the subdomain, i.e. <Location /> and SVNPath /var/www/vhosts/mydomain.com/svn in the above configuration.

  • The error only shows up if the repo is accessed via a proxy.

  • The clash with DocumentRoot was not so obvious, because it was a subdomain.

So to summarize: the solution (when using Plesk): Change the "DocumentRoot" of the subdomain in the Plesk setup (GUI) to something different form the SVN directory. The "DocumentRoot" of www.mydomain.com is httpdocs. The "DocumentRoot" of svn.mydomain.com was (by default) svn. I changed that to httpdocs-svn and the problem was gone. The folder httpdocs-svn isn't used in my setup since everything below svn.mydomain.com is handled by DavSVN.

12
votes

Make sure the link you are using is the 'svn' and not the 'view' link.

i.e. www.myrepo.com/svn/myproject/trunk ||correct
www.myrepo.com/view/myproject/trunk ||incorrect

That should work.

5
votes

In my case the problem is there was a non compatible settings between to configuration files on ubuntu.

I have ubuntu 18.04 and Apache2 and the lastest svnserver from ubuntu and to solve the problem of redirecting i had to remove Alias from two different configuration files: /etc/apache2/mods-enabled/dav_svn and /etc/apache2/site-enabled/default-ssl.conf

/etc/apache2/mods-enabled/dav_svn

 #Alias /svn /svn_repo/svn
 <Location /myrepo>
    DAV svn
    SVNPath /svn_repo/svn
    AuthType Basic
    AuthName "Subversion Repository"
    AuthUserFile /mypath/dav_svn.passwd
    Require valid-user
    AuthzSVNAccessFile /etc/apache2/dav_svn.authz
</Location>

/etc/apache2/site-enabled/default-ssl.conf

 #Alias /svn /svn_repo/svn
 <Location /myrepo>
    DAV svn
    SVNPath /svn_repo/svn
    AuthType Basic
    AuthName "Subversion Repository"
    AuthUserFile /mypath/dav_svn.passwd
    Require valid-user
    AuthzSVNAccessFile /etc/apache2/dav_svn.authz
</Location>

obviusly after modification i need to restart apache:

sudo service apache2 restart
0
votes

The problem is with the SVN URL which you gave during check-out. I checked various post for this problem but none of them worked for me. Below is the very simple solution that worked for me,

You need to you csvn repository using link 'http://localhost:3343/csvn/repo/list ' and copy the URL of 'Checkout command' for the repository which you want to access.

This URL you need to use in the tortoise SVN client for checkout.