Tag Archives: 404

SVN Commit Error: Repository Moved Temporarily; Please Relocate Tips, Tricks and Tutorials 17 FEB 2014

svn-logoI encountered a rather strange (and frustrating!) error today which was completely blocking me from committing any files into my SVN repo. After a lot of fiddling and tweaking (all unsuccessful) and finally just destroying the whole damn thing to start afresh, I did stumble across the cause and solution via Google, which means that obviously I now need to save it here for my own record.

The error Subversion was returning to me after every commit attempt read something along the lines of:

svn: Repository moved temporarily to 'xxxyyyzzz'; please relocate

The problem as it turns out is the fact that both the project webserver (in this case Apache) and Subversion are installed on the same server and thus share an Apache configuration (because you are probably using the dav_svn module to access your SVN repo).

Now if you are being clever with your 404 handling for your web project and maybe doing some redirects, and this errorDocument handler is specified on your default site configuration, then obviously your SVN module is affected by this as well. So for the one or two occasions where your SVN repo perhaps references a file that no longer exists in itself, your custom 404 redirect handler screws with the necessary SVN return error, thus resulting in the rather cryptic error message outlined above.

Luckily, it turns out that solving this issue is in fact very simple. All you need to do is edit your dav_svn.conf file:

sudo nano /etc/apache2/mods-enabled/dav_svn.conf

and add the default Apache 404 error document directive to it! A typical SVN configuration might then look like this:

<Location /svn> 
DAV svn 
SVNPath /var/svn-repos/svn 
AuthType Basic 
AuthName "Subversion Repository" 
AuthUserFile /etc/apache2/dav_svn.passwd 
Require valid-user 
ErrorDocument 404 default 

So yeah, I just wasted a lot of time by not finding this nugget via Google first.

Zend: How to fix the 404 Problem in a Zend Framework Project CodeUnit 23 MAR 2011

If you have a nice and shiny new Zend Framework project all set up but are still getting nasty browser 404 errors when attempting to hit URL other than the home page (instead of the expected errors dealt out by the error handler controller), the root of your problem is actually quite simple:

Your Apache mod_rewrite module is disabled and your Apache directory AllowOverride directive is not switched on.

To fix is easy enough. Locate your Apache httpd.conf configuration file and open it up. Run a search for mod_rewrite and you should find the line:

#LoadModule rewrite_module modules/mod_rewrite.so

Uncomment it in order to enable, by removing the # character from the front of the line.

Next search for AllowOverride and you should find it in one of your declarations. If it is present, change the value to All. If it isn’t, add it. (Note if you are using virtual hosts you will need to set it under the virtualhost declaration). Setting this to all means that Apache will honour local .htaccess files, which is exactly what Zend, in conjunction with mod_rewrite, depends on.

Restart Apache, and hit a non home page URL.

And now you know.