bzr 0.13 does not respect proxy env vars with urllib

Bug #74759 reported by David Cournapeau
4
Affects Status Importance Assigned to Milestone
Bazaar
Fix Released
Medium
Vincent Ladeuil

Bug Description

I've just upgraded to bzr 0.13 from 0.12 on ubuntu (using packages from bzr website), and I cannot connect to any http repositories anymore. For example:

bzr branch http://bazaar-vcs.org/bzr/bzr.0.13

returns an error : Couldn't resolve host 'bazaar.launchpad.net' (-3, 'Temporary failure in name resolution')

The problem is solved if I installed python-pycurl. Is python-pycurl a dependency ? It is not marked as such on the ubuntu package, I didn't need it with previous version of bzr, and to know that you need it is not obvious...

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

There is two implementations handling the http protocol: pycurl and urllib.

pycurl is an package distinct from bzr while urllib is pure python.

If the DNS error was transient (as the error message implies), it may be that using pycurl was not related to the bug, but pycurl do DNS caching so that may help.

Can you reproduce it ?

If you can, please use bzr branch http+urllib://bazaar-vcs.org/bzr/bzr.0.13 to force the use of the urllib implementation and attach $HOME/.bzr.log and an ethereal dump.

Changed in bzr:
assignee: nobody → v-ladeuil
Revision history for this message
David Cournapeau (david-ar) wrote : Re: [Bug 74759] Re: bzr 0.13 does not work without proxy without python-pycurl
Download full text (4.1 KiB)

vila wrote:
> There is two implementations handling the http protocol: pycurl and
> urllib.
>
> pycurl is an package distinct from bzr while urllib is pure python.
>
> If the DNS error was transient (as the error message implies), it may be
> that using pycurl was not related to the bug, but pycurl do DNS caching
> so that may help.
>
> Can you reproduce it ?
>
> If you can, please use bzr branch http+urllib://bazaar-
> vcs.org/bzr/bzr.0.13 to force the use of the urllib implementation and
> attach $HOME/.bzr.log and an ethereal dump.
>
> ** Changed in: bzr (upstream)
> Assignee: (unassigned) => vila
>
Ok, Here is my .bzr.log for the relevant part:

looking for plugins in /usr/lib/python2.4/site-packages/bzrlib/plugins
Plugin name __init__ already loaded
add plugin name launchpad
Plugin name __init__ already loaded
load plugin (None,
'/usr/lib/python2.4/site-packages/bzrlib/plugins/launchpad', ('', '', 5))
registered plugin command register-branch
loaded succesfully
looking for plugins in /home/david/.bazaar/plugins
add plugin name svn
load plugin (None, '/home/david/.bazaar/plugins/svn', ('', '', 5))
registered plugin command import-svn
loaded succesfully
encoding stdout as sys.stdout encoding 'UTF-8'
GET: [http://bazaar-vcs.org/bzr/bzr.0.13/.bzr/branch-format]
Traceback (most recent call last):
  File "/usr/lib/python2.4/site-packages/bzrlib/commands.py", line 626,
in run_bzr_catch_errors
    return run_bzr(argv)
  File "/usr/lib/python2.4/site-packages/bzrlib/commands.py", line 588,
in run_bzr
    ret = run(*run_argv)
  File "/usr/lib/python2.4/site-packages/bzrlib/commands.py", line 292,
in run_argv_aliases
    return self.run(**all_cmd_args)
  File "/usr/lib/python2.4/site-packages/bzrlib/builtins.py", line 718,
in run
    br_from = Branch.open(from_location)
  File "/usr/lib/python2.4/site-packages/bzrlib/branch.py", line 118, in
open
    control = bzrdir.BzrDir.open(base, _unsupported)
  File "/usr/lib/python2.4/site-packages/bzrlib/bzrdir.py", line 495, in
open
    return BzrDir.open_from_transport(t, _unsupported=_unsupported)
  File "/usr/lib/python2.4/site-packages/bzrlib/bzrdir.py", line 504, in
open_from_transport
    format = BzrDirFormat.find_format(transport)
  File "/usr/lib/python2.4/site-packages/bzrlib/bzrdir.py", line 1054,
in find_format
    return format.probe_transport(transport)
  File "/usr/lib/python2.4/site-packages/bzrlib/bzrdir.py", line 1064,
in probe_transport
    format_string = transport.get(".bzr/branch-format").read()
  File
"/usr/lib/python2.4/site-packages/bzrlib/transport/http/__init__.py",
line 226, in get
    code, response_file = self._get(relpath, None)
  File
"/usr/lib/python2.4/site-packages/bzrlib/transport/http/_urllib.py",
line 130, in _get
    response = self._perform(request)
  File
"/usr/lib/python2.4/site-packages/bzrlib/transport/http/_urllib.py",
line 102, in _perform
    response = self._opener.open(request)
  File "urllib2.py", line 358, in open
    response = self._open(req, data)
  File "urllib2.py", line 376, in _open
    '_open', req)
  File "urllib2.py", line 337, in _call_chain
    result = func(*args)
  File
"/usr/lib/python2.4/site-packages/bzrlib/transport/...

Read more...

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

I just changed the title, the problem is with proxy env vars.

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

More precisely, the bug is due to an interaction between connection sharing and proxy setting. Works in progress.

Changed in bzr:
status: Unconfirmed → In Progress
Revision history for this message
Vincent Ladeuil (vila) wrote :

Fix attached for tests.

Test suite fix will follows.

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

Importance set to medium. All 0.13 users trying to access repositories thru proxies are affected.

Changed in bzr:
importance: Undecided → Medium
Revision history for this message
Vincent Ladeuil (vila) wrote :

The fix is incomplete, it incorrectly handles the no_proxy env variable.

The interim work-around is to use pycurl instead.

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

Better fix, but still no tests.

We catchup pycurl a bit and do better than urllib2.

Vincent Ladeuil (vila)
Changed in bzr:
status: In Progress → Fix Released
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.