[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

HTTP 301 PROPFIND error does not report the "moved to" URL nor follow the redirect

From: Ximon Eighteen <ximon.eighteen_at_int.greenpeace.org>
Date: 2005-09-23 14:13:01 CEST

Hi all,

Firstly, apologies for raising this issue if it has been addressed
before. I see lots of traffic about HTTP 301 but not quite for the issue
I wish to raise. Perhaps in the noise I have missed
closure/dismissal/explanation of the behaviour I am seeing.

Additionally, apologies if this is an Apache or Apache DAV issue and not
a Subversion issue.

FYI:
   Server SVN version: 1.2.1
   Client SVN version: 1.2.3
   Apache 2.0.54 on port 80 with a config just doing a 301 rewrite
   Apache 2.0.54 on port 443 serving SVN via Basic Auth mod_authz_svn

I've been looking through the mailing list archives, Google and the
Subversion FAQ about HTTP 301. There is a lot of noise concerning
misconfigured Apache but my issue is not about a misconfigured Apache
but instead a deliberately configured Apache :)

My server serves SVN over HTTPS, it works fine and has done for a while
now. Yesterday I finally got round to making requests to port 80 respond
with HTTP 301 to the same URL but using the HTTPS protocol instead of
HTTP. This works fine (i.e. using Wget or my browser I can view the
Apache simple HTML listing of the repository HEAD).

Just for kicks I thought I'd see what the Subversion command line client
says when trying to checkout using the HTTP URL instead of HTTPS:-

[ximon]$ svn co http://svn.greenpeace.org/repositories/planet2-guide
svn: PROPFIND request failed on '/repositories/planet2-guide'
svn: PROPFIND of '/repositories/planet2-guide': 301 Moved Permanently
(http://svn.greenpeace.org)

I have two issues with this:

1. The 301 message does not report the new URL but instead the old one.
This is not very helpful.

2. The SVN client does not follow the redirect.

The HTTP 301 FAQ item is an obvious candidate for information but talks
about misconfigured Apache, not my case:

http://subversion.tigris.org/faq.html#http-301-error

This URL appears to be someone else reporting a similar problem back in
November 2004:

http://snurf.bdash.net.nz/2004/10/28/problems-getting-snurf-source-from-subversion/

This recent discussion on this list speaks about HTTP 301 issues but
doesn't appear to mention my two points:

http://svn.haxx.se/users/archive-2005-09/0960.shtml

Issue 1116 "svn doesn't follow HTTP 301" sounds like my point 2 but the
ticket was closed because it was a user configuration problem. My case
is NOT a configuration problem (that I am aware of).

http://subversion.tigris.org/issues/show_bug.cgi?id=1116

However on 1116 Greg Stein says "The default Apache processing (mod_dir)
is performing the redirection. If the request hit SVN *first*, then the
redirection would not occur -- mod_dav_svn only redirects GET requests
(not PROPFINDs)".

This sounds very much like my issue. However, I am using mod_rewrite to
perform the redirection, mod_dav_svn is not even listening on port 80,
only on port 443 (there are two different instances of Apache with
totally separate configurations), and mod_dir is unknown to me. I
imagine that mod_rewrite returns the 301 and SVN reports the 301
(unhelpfully as stated) and does nothing more. Perhaps there is a good
reason why it does not follow the redirection automatically, and for me
at least it doesn't cause a problem, I just want to flag it.

FYI my rewrite rule is:

RewriteRule ^/(.*) https://svn.greenpeace.org/$1 [R=301,L]

FYI wget says:

[ximon]$ wget -S -O- http://svn.greenpeace.org/repositories/planet2-guide
--13:46:57-- http://svn.greenpeace.org/repositories/planet2-guide
            => `-'
Resolving svn.greenpeace.org... 85.184.8.198
Connecting to svn.greenpeace.org[85.184.8.198]:80... connected.
HTTP request sent, awaiting response...
  1 HTTP/1.1 301 Moved Permanently
  2 Date: Fri, 23 Sep 2005 11:52:34 GMT
  3 Server: Apache/2.0.54 (Unix) DAV/2 PHP/4.4.0
  4 Location: https://svn.greenpeace.org/repositories/planet2-guide
  5 Content-Length: 261
  6 Connection: close
  7 Content-Type: text/html; charset=iso-8859-1
Location: https://svn.greenpeace.org/repositories/planet2-guide [following]
--13:46:57-- https://svn.greenpeace.org/repositories/planet2-guide
            => `-'
Connecting to svn.greenpeace.org[85.184.8.198]:443... connected.
HTTP request sent, awaiting response...
  1 HTTP/1.1 401 Authorization Required
  2 Date: Fri, 23 Sep 2005 11:52:34 GMT
  3 Server: Apache/2.0.54 (Unix) DAV/2 mod_ssl/2.0.54 OpenSSL/0.9.7a
PHP/4.4.0 SVN/1.2.1 mod_python/3.1.4 Python/2.3.4
  4 WWW-Authenticate: Basic realm="Restricted repository | Anonymous
read-only access is allowed to some repositories (username: anonymous,
leave password blank)"
  5 Content-Length: 401
  6 Connection: close
  7 Content-Type: text/html; charset=iso-8859-1
Authorization failed.

The "Authorization failed" is expected because the repository is
protected by Basic Auth.

Thanks, Ximon

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org
Received on Fri Sep 23 14:16:00 2005

This is an archived mail posted to the Subversion Users mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.