'Connection timed out' on lp branch attempt shouldn't result in a crash

Bug #198519 reported by Wesley J. Landaker
40
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Bazaar
Confirmed
Low
Unassigned

Bug Description

I tried to lp branch on a machine that was having network trouble, and so the connection timed out. This is an error, but it shouldn't throw a stack-trace and tell me to report a bug. Instead, the error should be caught inside the lp handler and the user should be given a more sensible error message.

Transcript:

$ bzr branch lp:bzr-loom loom
bzr: ERROR: socket.error: (110, 'Connection timed out')

Traceback (most recent call last):
  File "/usr/lib/python2.4/site-packages/bzrlib/commands.py", line 806, in run_bzr_catch_errors
    return run_bzr(argv)
  File "/usr/lib/python2.4/site-packages/bzrlib/commands.py", line 762, in run_bzr
    ret = run(*run_argv)
  File "/usr/lib/python2.4/site-packages/bzrlib/commands.py", line 492, in run_argv_aliases
    return self.run(**all_cmd_args)
  File "/usr/lib/python2.4/site-packages/bzrlib/builtins.py", line 877, in run
    accelerator_tree, br_from = bzrdir.BzrDir.open_tree_or_branch(
  File "/usr/lib/python2.4/site-packages/bzrlib/bzrdir.py", line 773, in open_tree_or_branch
    bzrdir = klass.open(location)
  File "/usr/lib/python2.4/site-packages/bzrlib/bzrdir.py", line 651, in open
    return BzrDir.open_from_transport(t, _unsupported=_unsupported)
  File "/usr/lib/python2.4/site-packages/bzrlib/bzrdir.py", line 688, in open_from_transport
    redirected)
  File "/usr/lib/python2.4/site-packages/bzrlib/lazy_import.py", line 125, in __call__
    return obj(*args, **kwargs)
  File "/usr/lib/python2.4/site-packages/bzrlib/transport/__init__.py", line 1661, in do_catching_redirections
    return action(transport)
  File "/usr/lib/python2.4/site-packages/bzrlib/bzrdir.py", line 664, in find_format
    return transport, BzrDirFormat.find_format(
  File "/usr/lib/python2.4/site-packages/bzrlib/bzrdir.py", line 1417, in find_format
    return format.probe_transport(transport)
  File "/usr/lib/python2.4/site-packages/bzrlib/bzrdir.py", line 1427, in probe_transport
    format_string = transport.get(".bzr/branch-format").read()
  File "/usr/lib/python2.4/site-packages/bzrlib/plugins/launchpad/lp_indirect.py", line 137, in get
    self._request_redirect(relpath)
  File "/usr/lib/python2.4/site-packages/bzrlib/plugins/launchpad/lp_indirect.py", line 130, in _request_redirect
    target = self._resolve(branchpath) + extra
  File "/usr/lib/python2.4/site-packages/bzrlib/plugins/launchpad/lp_indirect.py", line 85, in _resolve
    result = resolve.submit(service)
  File "/usr/lib/python2.4/site-packages/bzrlib/plugins/launchpad/lp_registration.py", line 155, in submit
    self._authenticated)
  File "/usr/lib/python2.4/site-packages/bzrlib/plugins/launchpad/lp_registration.py", line 120, in send_request
    result = method(*method_params)
  File "/usr/lib/python2.4/xmlrpclib.py", line 1096, in __call__
    return self.__send(self.__name, args)
  File "/usr/lib/python2.4/xmlrpclib.py", line 1383, in __request
    verbose=self.__verbose
  File "/usr/lib/python2.4/xmlrpclib.py", line 1129, in request
    self.send_content(h, request_body)
  File "/usr/lib/python2.4/xmlrpclib.py", line 1243, in send_content
    connection.endheaders()
  File "/usr/lib/python2.4/httplib.py", line 798, in endheaders
    self._send_output()
  File "/usr/lib/python2.4/httplib.py", line 679, in _send_output
    self.send(msg)
  File "/usr/lib/python2.4/httplib.py", line 646, in send
    self.connect()
  File "/usr/lib/python2.4/httplib.py", line 1072, in connect
    sock.connect((self.host, self.port))
  File "<string>", line 1, in connect
error: (110, 'Connection timed out')

bzr 1.1.0.candidate.1 on python 2.4.4.final.0 (linux2)
arguments: ['/usr/bin/bzr', 'branch', 'lp:bzr-loom', 'loom']
encoding: 'UTF-8', fsenc: 'UTF-8', lang: 'en_US.UTF-8'
plugins:
  bzrtools /usr/lib/python2.4/site-packages/bzrlib/plugins/bzrtools [1.1.0]
  email /usr/lib/python2.4/site-packages/bzrlib/plugins/email [unknown]
  gtk /usr/lib/python2.4/site-packages/bzrlib/plugins/gtk [0.93.0]
  launchpad /usr/lib/python2.4/site-packages/bzrlib/plugins/launchpad [unknown]
  multiparent /usr/lib/python2.4/site-packages/bzrlib/plugins/multiparent.pyc [unknown]
  rebase /usr/lib/python2.4/site-packages/bzrlib/plugins/rebase [0.3.0]
  svn /usr/lib/python2.4/site-packages/bzrlib/plugins/svn [0.4.7]
*** Bazaar has encountered an internal error.
    Please report a bug at https://bugs.launchpad.net/bzr/+filebug
    including this traceback, and a description of what you
    were doing when the error occurred.

Revision history for this message
Martin Albisetti (beuno) wrote :

Could you try again with the latest version of bzr? (1.5 at the moment)

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

Hi,

bug 247270 confirms this and indicates that (-2, 'Name or service not known')
should be handled in the same way as timeout.

Thanks,

James

Changed in bzr:
importance: Undecided → Low
status: New → Confirmed
Revision history for this message
Marius Kruger (amanica) wrote :
Download full text (4.6 KiB)

I also got this today running bzr.dev (1.6b4)

--
$ bzr branch lp:bzr-search/trunk search2
bzr: ERROR: socket.error: (110, 'Connection timed out')

Traceback (most recent call last):
  File "/stuph/projects/bzr/bzr.repo/bzr.work/bzrlib/commands.py", line 857, in run_bzr_catch_errors
    return run_bzr(argv)
  File "/stuph/projects/bzr/bzr.repo/bzr.work/bzrlib/commands.py", line 797, in run_bzr
    ret = run(*run_argv)
  File "/stuph/projects/bzr/bzr.repo/bzr.work/bzrlib/commands.py", line 499, in run_argv_aliases
    return self.run(**all_cmd_args)
  File "/stuph/projects/bzr/bzr.repo/bzr.work/bzrlib/builtins.py", line 826, in run
    from_location)
  File "/stuph/projects/bzr/bzr.repo/bzr.work/bzrlib/bzrdir.py", line 885, in open_tree_or_branch
    bzrdir = klass.open(location)
  File "/stuph/projects/bzr/bzr.repo/bzr.work/bzrlib/bzrdir.py", line 762, in open
    t = get_transport(base, possible_transports=possible_transports)
  File "/stuph/projects/bzr/bzr.repo/bzr.work/bzrlib/lazy_import.py", line 125, in __call__
    return obj(*args, **kwargs)
  File "/stuph/projects/bzr/bzr.repo/bzr.work/bzrlib/transport/__init__.py", line 1527, in get_transport
    base = directories.dereference(base)
  File "/stuph/projects/bzr/bzr.repo/bzr.work/bzrlib/directory_service.py", line 53, in dereference
    return service().look_up(name, url)
  File "/stuph/projects/bzr/bzr.repo/bzr.work/bzrlib/plugins/launchpad/lp_directory.py", line 60, in look_up
    return self._resolve(url)
  File "/stuph/projects/bzr/bzr.repo/bzr.work/bzrlib/plugins/launchpad/lp_directory.py", line 76, in _resolve
    result = resolve.submit(service)
  File "/stuph/projects/bzr/bzr.repo/bzr.work/bzrlib/plugins/launchpad/lp_registration.py", line 182, in submit
    self._authenticated)
  File "/stuph/projects/bzr/bzr.repo/bzr.work/bzrlib/plugins/launchpad/lp_registration.py", line 147, in send_request
    result = method(*method_params)
  File "/usr/lib/python2.5/xmlrpclib.py", line 1147, in __call__
    return self.__send(self.__name, args)
  File "/usr/lib/python2.5/xmlrpclib.py", line 1437, in __request
    verbose=self.__verbose
  File "/usr/lib/python2.5/xmlrpclib.py", line 1183, in request
    self.send_content(h, request_body)
  File "/usr/lib/python2.5/xmlrpclib.py", line 1297, in send_content
    connection.endheaders()
  File "/usr/lib/python2.5/httplib.py", line 860, in endheaders
    self._send_output()
  File "/usr/lib/python2.5/httplib.py", line 732, in _send_output
    self.send(msg)
  File "/usr/lib/python2.5/httplib.py", line 699, in send
    self.connect()
  File "/usr/lib/python2.5/httplib.py", line 1134, in connect
    sock.connect((self.host, self.port))
  File "<string>", line 1, in connect
error: (110, 'Connection timed out')

bzr 1.6b4 on python 2.5.2 (linux2)
arguments: ['/usr/local/bin/bzr', 'branch', 'lp:bzr-search/trunk', 'search2']
encoding: 'UTF-8', fsenc: 'UTF-8', lang: 'en_ZA.UTF-8'
plugins:
  authors /home/amanica/.bazaar/plugins/authors [unknown]
  bisect /home/amanica/.bazaar/plugins/bisect [1.1.0pre0]
  bookmarks /home/amanica/.bazaar/plugins/bookmarks [unknown]
  bzr_push_and_update /home/amanica/.bazaar/plug...

Read more...

Jelmer Vernooij (jelmer)
tags: added: check-for-breezy
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.