[git-remote-helper] doesn't follow http redirects

Bug #921371 reported by Jonathan Nieder
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Bazaar Git Plugin
Fix Released
Jelmer Vernooij

Bug Description

Grabbing the latest bzr using 'git clone bzr::lp:bzr' takes a long time. After that long time (it varies from one attempt to the next), the clone fails claiming an odd redirect. Reproducible.

Cloning with 'bzr branch lp:bzr bazaar' is much faster and works fine. I'm not sure yet if conversion to git with 'git clone bzr::$(pwd)/bazaar bzr' works after that, since the command is still running.

$ git clone bzr::lp:bzr
Cloning into 'bzr'...
You have not informed bzr of your Launchpad ID, and you must do this to
write to Launchpad or access private data. See "bzr help launchpad-login".
Traceback (most recent call last):t map 8378/24733
  File "/usr/lib/git-core/git-remote-bzr", line 49, in <module>
    helper.process(sys.stdin, sys.stdout)
  File "/usr/lib/python2.7/dist-packages/bzrlib/plugins/git/git_remote_helper.py", line 168, in process
    self.process_line(l, outf)
  File "/usr/lib/python2.7/dist-packages/bzrlib/plugins/git/git_remote_helper.py", line 184, in process_line
    self.commands[argv[0]](self, outf, argv)
  File "/usr/lib/python2.7/dist-packages/bzrlib/plugins/git/git_remote_helper.py", line 120, in cmd_list
    for ref, git_sha1 in refs.as_dict().iteritems():
  File "/usr/lib/python2.7/dist-packages/dulwich/repo.py", line 202, in as_dict
    ret[key] = self[("%s/%s" % (base, key)).strip("/")]
  File "/usr/lib/python2.7/dist-packages/dulwich/repo.py", line 273, in __getitem__
    _, sha = self._follow(name)
  File "/usr/lib/python2.7/dist-packages/dulwich/repo.py", line 255, in _follow
    contents = self.read_ref(refname)
  File "/usr/lib/python2.7/dist-packages/dulwich/repo.py", line 231, in read_ref
    contents = self.read_loose_ref(refname)
  File "/usr/lib/python2.7/dist-packages/bzrlib/plugins/git/refs.py", line 134, in read_loose_ref
    return self.object_store._lookup_revision_sha1(revid)
  File "/usr/lib/python2.7/dist-packages/bzrlib/plugins/git/object_store.py", line 560, in _lookup_revision_sha1
  File "/usr/lib/python2.7/dist-packages/bzrlib/plugins/git/object_store.py", line 368, in _update_sha_map
  File "/usr/lib/python2.7/dist-packages/bzrlib/plugins/git/object_store.py", line 468, in _update_sha_map_revision
    for path, obj, ie in self._revision_to_objects(rev, tree, lossy=(not self.mapping.roundtripping)):
  File "/usr/lib/python2.7/dist-packages/bzrlib/plugins/git/object_store.py", line 422, in _revision_to_objects
    self._cache.idmap, unusual_modes, self.mapping.BZR_DUMMY_FILE):
  File "/usr/lib/python2.7/dist-packages/bzrlib/plugins/git/object_store.py", line 283, in _tree_to_objects
  File "/usr/lib/python2.7/dist-packages/bzrlib/plugins/git/mapping.py", line 566, in directory_to_tree
    hexsha = lookup_ie_sha1(ie)
  File "/usr/lib/python2.7/dist-packages/bzrlib/plugins/git/object_store.py", line 272, in ie_to_hexsha
  File "/usr/lib/python2.7/dist-packages/bzrlib/plugins/git/mapping.py", line 566, in directory_to_tree
    hexsha = lookup_ie_sha1(ie)
  File "/usr/lib/python2.7/dist-packages/bzrlib/plugins/git/object_store.py", line 266, in ie_to_hexsha
    blob.data = tree.get_file_text(ie.file_id)
  File "/usr/lib/python2.7/dist-packages/bzrlib/revisiontree.py", line 70, in get_file_text
    for (identifier, content) in self.iter_files_bytes([(file_id, None)]):
  File "/usr/lib/python2.7/dist-packages/bzrlib/revisiontree.py", line 225, in iter_files_bytes
    for result in self._repository.iter_files_bytes(repo_desired_files):
  File "/usr/lib/python2.7/dist-packages/bzrlib/vf_repository.py", line 1563, in iter_files_bytes
    for record in self.texts.get_record_stream(text_keys, 'unordered', True):
  File "/usr/lib/python2.7/dist-packages/bzrlib/groupcompress.py", line 1456, in get_record_stream
    orig_keys, ordering, include_delta_closure):
  File "/usr/lib/python2.7/dist-packages/bzrlib/groupcompress.py", line 1609, in _get_remaining_record_stream
    for factory in batcher.yield_factories():
  File "/usr/lib/python2.7/dist-packages/bzrlib/groupcompress.py", line 1170, in yield_factories
    block_read_memo, block = blocks.next()
  File "/usr/lib/python2.7/dist-packages/bzrlib/groupcompress.py", line 1412, in _get_blocks
    zdata = raw_records.next()
  File "/usr/lib/python2.7/dist-packages/bzrlib/repofmt/pack_repo.py", line 2043, in get_raw_records
    for names, read_func in reader.iter_records():
  File "/usr/lib/python2.7/dist-packages/bzrlib/pack.py", line 279, in iter_records
  File "/usr/lib/python2.7/dist-packages/bzrlib/pack.py", line 320, in _read_format
    format = self._read_line()

  File "/usr/lib/python2.7/dist-packages/bzrlib/pack.py", line 247, in _read_line
    line = self._source.readline()
  File "/usr/lib/python2.7/dist-packages/bzrlib/pack.py", line 210, in readline
  File "/usr/lib/python2.7/dist-packages/bzrlib/pack.py", line 195, in _next
    offset, data = self.readv_result.next()
  File "/usr/lib/python2.7/dist-packages/bzrlib/transport/http/__init__.py", line 241, in _readv
    for cur_coal, rfile in self._coalesce_readv(relpath, coalesced):
  File "/usr/lib/python2.7/dist-packages/bzrlib/transport/http/__init__.py", line 333, in _coalesce_readv
    for c, rfile in get_and_yield(relpath, ranges):
  File "/usr/lib/python2.7/dist-packages/bzrlib/transport/http/__init__.py", line 296, in get_and_yield
    code, rfile = self._get(relpath, coalesced)
  File "/usr/lib/python2.7/dist-packages/bzrlib/transport/http/_urllib.py", line 120, in _get
    response = self._perform(request)
  File "/usr/lib/python2.7/dist-packages/bzrlib/transport/http/_urllib.py", line 91, in _perform
    is_permanent=(code == 301))
bzrlib.errors.RedirectRequested: http://bazaar.launchpad.net/~bzr-pqm/bzr/bzr.dev/.bzr/repository/packs/a1bd96ce1421fe7d0b8d357b708a73c7.pack is redirected to https://launchpad.net

 $ dpkg-query -W bzr-git python-dulwich bzr python-bzrlib
 bzr 2.5.0~beta5-2
 bzr-git 0.6.6+bzr1561-1~jrn
 python-bzrlib 2.5.0~beta5-2
 python-dulwich 0.8.3-1~jrn

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

My guess is that the local conversion will be problematic as well. The bzr branch has "ghost revisions" (revisions that are referenced but not present), and they make a conversion to git fairly problematic.

summary: - 'git clone bzr::lp:bzr' fails with "RedirectRequested:
- http://bazaar.launchpad.net/~bzr-
- pqm/bzr/bzr.dev/.bzr/repository/packs/a1bd96ce1421fe7d0b8d357b708a73c7.pack
- is redirected to https://launchpad.net"
+ [git-remote-helper] doesn't follow http redirects
Changed in bzr-git:
status: New → Triaged
importance: Undecided → Medium
Jelmer Vernooij (jelmer)
Changed in brz-git:
status: New → Triaged
importance: Undecided → Medium
Jelmer Vernooij (jelmer)
Changed in brz-git:
status: Triaged → Fix Released
assignee: nobody → Jelmer Vernooij (jelmer)
Jelmer Vernooij (jelmer)
affects: brz-git → brz
Changed in brz:
milestone: none → 3.0.0
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.