opening over http in dumb mode fails in selftest

Bug #731240 reported by Jelmer Vernooij
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Bazaar
Fix Released
Low
Vincent Ladeuil
Bazaar Hg Plugin
Invalid
Medium
Unassigned

Bug Description

-----------
116.332 bzr-hg: using Mercurial 1.7.5
116.355 hg: using http://127.0.0.1:45264/
116.356 hg: sending between command
116.398 hg: real URL is http://127.0.0.1:45264/?pairs=0000000000000000000000000000000000000000-0000000000000000000000000000000000000000&cmd=between/
116.399 hg: requested URL: 'http://127.0.0.1:45264/?pairs=0000000000000000000000000000000000000000-0000000000000000000000000000000000000000&cmd=between'
116.399 hg: (falling back to static-http)
116.438 opening working tree '/tmp/testbzr-ratX8g.tmp'
------------
Text attachment: traceback
------------
Traceback (most recent call last):
File "/usr/lib/python2.7/dist-packages/testtools/runtest.py", line 169, in _run_user
return fn(*args, **kwargs)
File "/usr/lib/python2.7/dist-packages/testtools/testcase.py", line 508, in _run_test_method
return self._get_test_method()()
File "/home/jelmer/bzr-alltests/bzr.dev/bzrlib/tests/per_branch/test_branch.py", line 535, in test_open_containing
self.get_readonly_url(''))
File "/home/jelmer/bzr-alltests/bzr.dev/bzrlib/branch.py", line 206, in open_containing
possible_transports)
File "/home/jelmer/bzr-alltests/bzr.dev/bzrlib/bzrdir.py", line 765, in open_containing
return BzrDir.open_containing_from_transport(transport)
File "/home/jelmer/bzr-alltests/bzr.dev/bzrlib/bzrdir.py", line 786, in open_containing_from_transport
result = BzrDir.open_from_transport(a_transport)
File "/home/jelmer/bzr-alltests/bzr.dev/bzrlib/bzrdir.py", line 750, in open_from_transport
redirected)
File "/home/jelmer/bzr-alltests/bzr.dev/bzrlib/transport/__init__.py", line 1666, in do_catching_redirections
return action(transport)
File "/home/jelmer/bzr-alltests/bzr.dev/bzrlib/bzrdir.py", line 737, in find_format
transport, _server_formats=_server_formats)
File "/home/jelmer/bzr-alltests/bzr.dev/bzrlib/controldir.py", line 830, in find_format
return prober.probe_transport(transport)
File "/home/jelmer/bzr-alltests/plugins/hg/__init__.py", line 150, in probe_transport
format.open(transport)
File "/home/jelmer/bzr-alltests/plugins/hg/dir.py", line 341, in open
repository = mercurial.hg.repository(ui(), path, create=_create)
File "/usr/lib/pymodules/python2.7/mercurial/hg.py", line 96, in repository
repo = _lookup(path).instance(ui, path, create)
File "/usr/lib/pymodules/python2.7/mercurial/httprepo.py", line 203, in instance
return statichttprepo.instance(ui, "static-" + path, create)
File "/usr/lib/pymodules/python2.7/mercurial/statichttprepo.py", line 146, in instance
return statichttprepository(ui, path[7:])
File "/usr/lib/pymodules/python2.7/mercurial/statichttprepo.py", line 96, in __init__
requirements = self.opener("requires").read().splitlines()
File "/usr/lib/pymodules/python2.7/mercurial/statichttprepo.py", line 32, in read
f = self.opener.open(req)
File "/usr/lib/python2.7/urllib2.py", line 398, in open
response = meth(req, response)
File "/usr/lib/python2.7/urllib2.py", line 511, in http_response
'http', request, response, code, msg, hdrs)
File "/usr/lib/python2.7/urllib2.py", line 430, in error
result = self._call_chain(*args)
File "/usr/lib/python2.7/urllib2.py", line 370, in _call_chain
result = func(*args)
File "/usr/lib/pymodules/python2.7/mercurial/byterange.py", line 65, in http_error_416
raise RangeError('Requested Range Not Satisfiable')
RangeError: Requested Range Not Satisfiable

Related branches

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

This appears to be related to the http server implementation in bzrlib.

Changed in bzr:
status: New → Incomplete
status: Incomplete → Confirmed
importance: Undecided → Low
Revision history for this message
John A Meinel (jameinel) wrote : Re: [Bug 731240] [NEW] opening over http in dumb mode fails in selftest

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 3/8/2011 1:09 PM, Jelmer Vernooij wrote:
> Public bug reported:
>
> -----------
> 116.332 bzr-hg: using Mercurial 1.7.5
> 116.355 hg: using http://127.0.0.1:45264/
> 116.356 hg: sending between command
> 116.398 hg: real URL is http://127.0.0.1:45264/?pairs=0000000000000000000000000000000000000000-0000000000000000000000000000000000000000&cmd=between/
> 116.399 hg: requested URL: 'http://127.0.0.1:45264/?pairs=0000000000000000000000000000000000000000-0000000000000000000000000000000000000000&cmd=between'
> 116.399 hg: (falling back to static-http)
> 116.438 opening working tree '/tmp/testbzr-ratX8g.tmp'
> ------------

It looks like Mercurial *requires* Range requests to be available,
rather than falling back to compatibility code. By default Python's HTTP
servers don't support range requests. As do a few servers we've run into
in the past. At least, when we started using it, we made sure people
could use a variety of servers.

Any more, bzr would be pretty poor if you didn't have Range available.
So it would be probably reasonable to have our HTTP server implement it.

John
=:->

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (Cygwin)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAk12IZoACgkQJdeBCYSNAANmAgCgmbIBX6xYrsqL5sSQ9kwKuOvS
vyAAnjLv0TCY5Ne9WBo/gTk17+yzFi87
=FXCi
-----END PGP SIGNATURE-----

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

On Tue, 2011-03-08 at 12:31 +0000, John A Meinel wrote:
> On 3/8/2011 1:09 PM, Jelmer Vernooij wrote:
> > Public bug reported:
> >
> > -----------
> > 116.332 bzr-hg: using Mercurial 1.7.5
> > 116.355 hg: using http://127.0.0.1:45264/
> > 116.356 hg: sending between command
> > 116.398 hg: real URL is http://127.0.0.1:45264/?pairs=0000000000000000000000000000000000000000-0000000000000000000000000000000000000000&cmd=between/
> > 116.399 hg: requested URL: 'http://127.0.0.1:45264/?pairs=0000000000000000000000000000000000000000-0000000000000000000000000000000000000000&cmd=between'
> > 116.399 hg: (falling back to static-http)
> > 116.438 opening working tree '/tmp/testbzr-ratX8g.tmp'
> > ------------
>
> It looks like Mercurial *requires* Range requests to be available,
> rather than falling back to compatibility code. By default Python's HTTP
> servers don't support range requests. As do a few servers we've run into
> in the past. At least, when we started using it, we made sure people
> could use a variety of servers.
>
> Any more, bzr would be pretty poor if you didn't have Range available.
> So it would be probably reasonable to have our HTTP server implement it.
The weird thing is, this happens during the request for ".hg/requires"
which is their equivalent of our format file. I don't know why you would
want to use a range request on that.

It's probably necessary for other things later in the process too
though.

Cheers,

Jelmer

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

> So it would be probably reasonable to have our HTTP server implement it.

I'm pretty sure the default HTTP test server support range requests.

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

Doh !

'bytes=0-' *is* a convoluted way to request the whole file content :-)

Changed in bzr-hg:
status: Triaged → Invalid
Changed in bzr:
status: Confirmed → In Progress
assignee: nobody → Vincent Ladeuil (vila)
assignee: Vincent Ladeuil (vila) → nobody
Vincent Ladeuil (vila)
Changed in bzr:
milestone: none → 2.4b1
Vincent Ladeuil (vila)
Changed in bzr:
status: In Progress → Fix Released
Jelmer Vernooij (jelmer)
Changed in bzr:
assignee: nobody → Vincent Ladeuil (vila)
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.