suggested URI after "svn+ syntax is deprecated error" fails

Bug #268553 reported by Paul Kippes
4
Affects Status Importance Assigned to Milestone
Bazaar
Incomplete
Undecided
Unassigned

Bug Description

Using bzr 1.6.1 and bzr-svn 0.4.12, attempted to checkout a subversion repository using the supported method in bzr 1.5 and bzr-svn 0.4.10.

zffs1:~/bzr/iddp> bzr co svn+http://atdhost1:8000/svn/tools/applications/iddp/trunk trunk2
The svn+ syntax is deprecated, use http://atdhost1:8000/svn/tools/applications/iddp/trunk instead.

zffs1:~/bzr/iddp> bzr co http://atdhost1:8000/svn/tools/applications/iddp/trunk trunk2
bzr: ERROR: Invalid http response for http://atdhost1:8000/svn/tools/applications/iddp/trunk/.bzr/branch-format: Unable to handle http code 503: Service Unavailable

Revision history for this message
Jelmer Vernooij (jelmer) wrote :

Bazaar shouldn't abort when it gets a 503 but rather allow bzr-svn to check as well.

Revision history for this message
Vincent Ladeuil (vila) wrote :

Why didn't svn catch the exception ?

Will it be easier if there was a subclass of InvalidHttpResponse (say UnexpectedHttpCode) with an attribute for the http code ?

Changed in bzr:
status: New → Incomplete
Revision history for this message
James Westby (james-w) wrote :

vila, I believe that bzr gets 503 and aborts, rather than letting
the next format probe the location. If it allowed bzr-svn to probe
then it would succeed and bzr-svn would do its thing.

It sounds like the check for response code is overly strict, and even
if 503 can't be handled properly by bzr yet (asking for credentials)
then it should probably not abort.

Thanks,

James

Revision history for this message
Vincent Ladeuil (vila) wrote : Re: [Bug 268553] Re: suggested URI after "svn+ syntax is deprecated error" fails

    James> vila, I believe that bzr gets 503 and aborts, rather
    James> than letting the next format probe the location.
    James> If it allowed bzr-svn to probe then it would succeed
    James> and bzr-svn would do its thing.

Then svn should try first :) The http transport can't blindly
transform a 503 into a 404...

Since there is no traceback associated it's a bit difficult to
know where the problem occurs.

    James> It sounds like the check for response code is overly
    James> strict, and even if 503 can't be handled properly by
    James> bzr yet (asking for credentials) then it should
    James> probably not abort.

503 is Service Unavailable.

Asking for credentials is 401 (or 407 for proxies), that's a different bug.

Revision history for this message
James Westby (james-w) wrote :

On Fri, 2008-09-12 at 13:40 +0000, vila wrote:
> James> vila, I believe that bzr gets 503 and aborts, rather
> James> than letting the next format probe the location.
> James> If it allowed bzr-svn to probe then it would succeed
> James> and bzr-svn would do its thing.
>
> Then svn should try first :) The http transport can't blindly
> transform a 503 into a 404...

I don't think bzr-svn can control that though?

> Since there is no traceback associated it's a bit difficult to
> know where the problem occurs.

What I remember, it may not be exactly this bug, is that many
servers give 503 for POST to .bzr/smart/, so even though
things could continue using a dumb transport they don't.

I agree it would be good to have the traceback though.

> 503 is Service Unavailable.
>
> Asking for credentials is 401 (or 407 for proxies), that's a different
> bug.

Ah, my apologies.

Thanks,

James

Revision history for this message
Vincent Ladeuil (vila) wrote :

>>>>> "James" == James Westby <email address hidden> writes:

    James> On Fri, 2008-09-12 at 13:40 +0000, vila wrote:
    James> vila, I believe that bzr gets 503 and aborts, rather
    James> than letting the next format probe the location.
    James> If it allowed bzr-svn to probe then it would succeed
    James> and bzr-svn would do its thing.
    >>
    >> Then svn should try first :) The http transport can't blindly
    >> transform a 503 into a 404...

    James> I don't think bzr-svn can control that though?

Not knowing when this occurs it's hard to say, if it's really at
probe time it depends on how svn implement it. The default
mechanism try bzr formats first, but there should be a way to
override it if really needed.

    >> Since there is no traceback associated it's a bit difficult to
    >> know where the problem occurs.

    James> What I remember, it may not be exactly this bug, is
    James> that many servers give 503 for POST to .bzr/smart/, so
    James> even though things could continue using a dumb
    James> transport they don't.

403 not 503 :-) I had to get my RFC2616 because I had a doubt
about that 503 :)

I don't remember having ever encountered 503, that's why I want a
traceback. Additional bonus if .bzr.log -Dhttp is there too :)

Let's get a traceback and then we can continue the discussion.

Revision history for this message
John A Meinel (jameinel) wrote :

It sounds reasonable under the circumstances to turn most failures during POST into a 404. Well, what I would like is to catch most errors in the *initial probe* into 404s.

Something like:
=== modified file 'bzrlib/bzrdir.py'
--- bzrlib/bzrdir.py 2008-09-02 22:08:56 +0000
+++ bzrlib/bzrdir.py 2008-09-12 16:21:39 +0000
@@ -2615,7 +2615,8 @@
             if medium.should_probe():
                 try:
                     server_version = medium.protocol_version()
- except errors.SmartProtocolError:
+ except (errors.SmartProtocolError, OtherPossible,
+ ProbeFailureErrors):
                     # Apparently there's no usable smart server there, even though
                     # the medium supports the smart protocol.
                     raise errors.NotBranchError(path=transport.base)

Revision history for this message
Paul Kippes (kippesp+launchpad) wrote :
Download full text (4.8 KiB)

Below is the output of .bzr.log and a backtrace captured after the checkout. (The username/password login is cached by subversion and isn't causing problems with svn+http:// or using the svn commands directly.)

0.189 encoding stdout as sys.stdout encoding 'UTF-8'
0.190 bzr arguments: [u'-Dhttp', u'co', u'http://atdhost1:8000/svn/h1/simexec/trunk', u'trunk2']
0.191 looking for plugins in /home/sim/kippesp/.bazaar/plugins
0.191 looking for plugins in /home/sim/kippesp/.python/bzrlib/plugins
0.191 Plugin name __init__ already loaded
0.191 Plugin name __init__ already loaded
0.237 bzr-svn: using Subversion 1.4.2 ()
0.343 looking for plugins in /opt/bhti/lib/python2.5/site-packages/bzrlib/plugins
0.346 encoding stdout as sys.stdout encoding 'UTF-8'
0.385 failed to import pycurl: No module named pycurl
0.385 failed to instantiate transport <bzrlib.registry._LazyObjectGetter object at 84fb66c, module='bzrlib.transport.http._pycurl' attribute='PyCurlTransport'> for 'http://atdhost1:8000/svn/h1/simexec/trunk': DependencyNotPresent()
0.395 * About to connect() to atdhost1:8000
0.396 > POST /svn/h1/simexec/trunk/.bzr/smart
0.396 > Content-Length: 6
> Connection: Keep-Alive
> Accept: */*
> User-Agent: bzr/1.6.1 (urllib)
> Host: atdhost1:8000
> Pragma: no-cache
> Cache-Control: max-age=0
> Content-Type: application/x-www-form-urlencoded

0.398 < HTTP/1.1 401 Authorization Required
0.398 < Date: Mon, 15 Sep 2008 19:19:06 GMT
< Server: Apache/2.2.4 (Unix) DAV/2 SVN/1.4.6 mod_python/3.3.1 Python/2.5.1
< WWW-Authenticate: Basic realm="ATD Subversion Repositories"
< Content-Length: 401
< Keep-Alive: timeout=5, max=100
< Connection: Keep-Alive
< Content-Type: text/html; charset=iso-8859-1

0.399 * About to connect() to atdhost1:8000
0.399 > GET /svn/h1/simexec/trunk/.bzr/branch-format
0.399 > Host: atdhost1:8000
> Accept: */*
> User-Agent: bzr/1.6.1 (urllib)
> Connection: Keep-Alive
> Pragma: no-cache
> Cache-Control: max-age=0

0.400 < HTTP/1.1 401 Authorization Required
0.400 < Date: Mon, 15 Sep 2008 19:19:06 GMT
< Server: Apache/2.2.4 (Unix) DAV/2 SVN/1.4.6 mod_python/3.3.1 Python/2.5.1
< WWW-Authenticate: Basic realm="ATD Subversion Repositories"
< Content-Length: 401
< Keep-Alive: timeout=5, max=100
< Connection: Keep-Alive
< Content-Type: text/html; charset=iso-8859-1

0.409 Traceback (most recent call last):
  File "/home/sim/kippesp/.python/bzrlib/commands.py", line 857, in run_bzr_catch_errors
    return run_bzr(argv)
  File "/home/sim/kippesp/.python/bzrlib/commands.py", line 797, in run_bzr
    ret = run(*run_argv)
  File "/home/sim/kippesp/.python/bzrlib/commands.py", line 499, in run_argv_aliases
    return self.run(**all_cmd_args)
  File "/home/sim/kippesp/.python/bzrlib/builtins.py", line 937, in run
    branch_location)
  File "/home/sim/kippesp/.python/bzrlib/bzrdir.py", line 878, in open_tree_or_branch
    bzrdir = klass.open(location)
  File "/home/sim/kippesp/.python/bzrlib/bzrdir.py", line 756, in open
    return BzrDir.open_from_transport(t, _unsupported=_unsupported)
  File "/home/sim/kippesp/.python/bzrlib/bzrdir.py", line 793, in open_from_transport
    redirected)
  File "/home/sim/kippesp/.python/bzrlib/lazy_im...

Read more...

Revision history for this message
Jelmer Vernooij (jelmer) wrote :

I don't actually see a 503 in your log, rather a 401.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.