Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I've set up subversion and apache on my server.

If I browse to it through my webbrowser it works fine (http://svn.host.com/reposname). However, if I do a checkout on my machine I get the following error:

Command: Checkout from http://svn.host.com/reposname, revision HEAD, Fully recursive, Externals included  
Error: Repository moved permanently to 'http://svn.host.com/reposname/'; please relocate  

I checked apache's error log, but it doesn't say anything. (it does now - see edit)

My repositories are stored under: /var/www/svn/repos/

My website is stored under: /var/www/vhosts/x/...

Here's the conf file for the subdomain:

<Location />
   DAV svn
   SVNParentPath /var/www/svn/repos/

   AuthType Basic
   AuthName "Authorization Realm"
   AuthUserFile /var/www/svn/auth/svn.htpasswd
   Require valid-user
</Location>

Authentication works fine.

Does anyone know what might be causing this?

-- Edit

So I restarted apache (again) and tried it again and now it give me an error message, but it doesn't really help. Anyone have an idea what it means?

[Wed Mar 31 23:41:55 2010] [error] [client my.ip.he.re] Could not fetch resource information.  [403, #0]
[Wed Mar 31 23:41:55 2010] [error] [client my.ip.he.re] (2)No such file or directory: The URI does not contain the name of a repository.  [403, #190001]

-- Edit 2

If I do svn info it doesn't give anything usefull:

[root@eduro eduro.nl]# svn info http://svn.domain.com/repos/
Username: username
Password for 'username':
svn: Repository moved permanently to 'http://svn.domain.com/repos/'; please relocate

I also tried doing a local checkout (svn checkout file:///var/www/svn/repos/reposname) and that works fine (also adding / commiting works fine). So it seems is has something to do with apache.

Some other information:

  • I'm running CentOs 5.3
  • Plesk 9.3
  • Subversion, version 1.6.9 (r901367)

-- Edit 3

I tried moving the repositories, but it didn't make any difference.

selinux is disabled so that isn't it either.

-- Edit 4

Really? Nobody :(?

share|improve this question
1  
Why do you have Options +indexes that shouldn't really do anything useful in a svn location. –  Zoredache Mar 31 '10 at 22:22
    
Have you tried temporarily disabling anything to do with authentication/authorization? –  Zoredache Mar 31 '10 at 22:24
    
I tried to make it show me an overview of all repositories (later I found out that there's a different command for that), I removed it. I also removed authentication but it didn't solve anything (Auth actually works fine, it asks me for a username / password and only accepts a real combination). –  Bart S. Apr 1 '10 at 9:37

11 Answers 11

up vote 21 down vote accepted
+100

I had this recently... but it turned out I had forgotten the url :)

One thing you must do is ensure your svn Location does not overlap any apache-servable websites. ie, if you set your DocumentRoot to be /www, and your svn Location to be /www/svn... then you're in trouble - Apache won't know what its supposed to be served with (ie the svn special handlers, or a straight http handler).

See the FAQ entry for this.

share|improve this answer
    
This seems like it could be the right answer, but here's another possible post related to this: forum.webfaction.com/viewtopic.php?id=2423. –  Paul Kroon Apr 4 '10 at 0:42
1  
Wow, I already knew about this but I thought I gave it another try. I created a new repository and that worked. I was confused as to why this was, so I FTP'd into my server and found out there was a directory in the httpdocs directory of the subdomain (created by plesk) called test (the same as my repository). I deleted it, and now it works. Thanks for the help. –  Bart S. Apr 4 '10 at 12:57
1  
To elaborate a bit on one common scenario. If you have a virtual host setup and want SVN at the root (e.g. svn.example.com is your repo URL), do NOT set "DocumentRoot /svn" and then use a "<Directory /svn>" block inside your VirtualHost to configure the DAV svn options for the root path. This will trigger the problem where Apache gets confused between the DAV handler and its internal handlers. There should be NO DocumentRoot directive in your VirtualHost block. Use a "<Location />" block instead to configure the DAV svn options for the root path. –  nezroy Dec 17 '10 at 20:48
    
I had put an Alias directive in my config, eg Alias svn /repositories and then set up everything in <Location /svn/ >. The problem was exactly as in the FAQ link, although mysteriously, it worked perfectly for a month and then stopped on a Wednesday afternoon at tea time. If your repository is at "/" then you'll have an overlap with your DocumentRoot directive. –  Matt Connolly May 18 '11 at 7:46
    
It worked perfectly ! It was the DocumentRoot problem ! +1 –  Feiticeir0 Oct 5 '11 at 11:46

Try checking out http://svn.host.com/reposname/ (note the trailing slash).

share|improve this answer
    
I am, subversion just removes it. –  Bart S. Apr 1 '10 at 21:08

Check this web: http://www.rkrishardy.com/2009/12/subversion-fix-svn-copy-causes-repository-moved-permanentl/

Probably the alias points to the same place as congfigured is dav_svn.mod, and there is race-condition between apache and dav_svn while accesing repo.

It's better explained in provided article

In dav_svn.conf:

  <Location /svn>  #Alias we are talking about
  DAV svn

In apache_site.conf

<IfModule mod_ssl.c>
<VirtualHost *:443>
    ServerAdmin webmaster@localhost
    ServerName svn.za11.pl

    #Alias /svn  "/mnt/nfs/svn/"  ###Comment out or change this alias
    DocumentRoot /mnt/nfs/svn/
    <Directory /mnt/nfs/svn/>
        Options Indexes FollowSymLinks MultiViews
        AllowOverride None
        Order allow,deny
        allow from all
        AuthType Basic 
        AuthName "Subversion Repository"
        AuthUserFile /etc/apache2/dav_svn.passwd
        Require valid-user
    </Directory> 
... rest of the file
share|improve this answer
1  
The link here is dead, and there is no likely replacement. –  sysadmin1138 Sep 23 '13 at 16:54

I have a vhost setup with my repo at svn.mydomain.com/sites/ my vhost had a DocumentRoot and Location block. Removing the documentroot solved this problem.

share|improve this answer

I got this error when I mistakenly put my repo under the html tree served by Apache, on my FC14 machine With RPM based subversion and apache installations.

SVNParentPath (in /etc/httpd/conf.d/subversion.conf) should point to a directory outside the DocumentRoot.

I moved my repo out, and the problem went away.

Hope this helps.

share|improve this answer

I know this is old but I found it on Google because I had the same issue. Make sure port 7080 isn't blocked by either computer or server firewall

share|improve this answer

It seems like you are not doing svn checkout, but rather svn update in an existing repository(?).

If so, do this:

svn switch --relocate http://svn.host.com/reponame

share|improve this answer
    
No, as you can see in the error message I gave it says "Command: Checkout from..." I really am trying a new checkout. –  Bart S. Mar 31 '10 at 21:18

Moved permanently? Can you something like HTTPFox or something and verify that Apache is giving out the right status code for your repository(should be 200/OK). I believe status code 301 corresponds to a URL that has "moved permanently" and that sounds like what the svn client is referring to.

share|improve this answer
    
Firebug and wget both give a 200 OK. But like I said, if I browse to it through my browser (by surfing to http://svn.server.com/repos) it works great, I get "repos - Revision 0: /" and everything. The problem only occurs when I do a checkout. –  Bart S. Mar 31 '10 at 22:02

Maybe a bit late in the conversation, but I see this when using an Alias in the apache config to deal with the trailing '/': Alias /svn /path/to/svn/

share|improve this answer

You also need to make sure that no Alias directive maps to the location of the svn repos. I had this recently when I had

Alias /svn /var/lib/svn
<Location /svn>
...
</Location>

where the alias and the location directive apply to the same path.

share|improve this answer

I just had a similar problem not when CHECKING OUT, but when a COMMIT was made.

The reason? this folder "obj\Debug\TempPE", for some weird reason that folder "TempPE" is not posible to COMMIT it to the repository

Solution ?...COMMIT all the other folders of the project one by one and remove that location from the SVN server

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.