Crash when network goes down during a checkout

Bug #253376 reported by Andrew Hunter
10
Affects Status Importance Assigned to Milestone
Bazaar Subversion Plugin
Fix Released
Low
Jelmer Vernooij

Bug Description

The network connection to the svn server went down during a checkout, resulting in the operation timing out. It would be nice if bzr-svn would handle this cleanly by commiting the downloaded revisions, allowing the user to continue to update the checkout when the network is back up again.

The backtrace is as follows:

$ bzr checkout https://openlibraries.svn.sourceforge.net/svnroot/openlibraries/trunk trunk
Initialising Subversion metadata cache in /home/rexbron/.bazaar/svn-cache/082041ba-413d-0410-a833-c54ed8144907
bzr: ERROR: svn.core.SubversionException: ("PROPFIND of '/svnroot/openlibraries': could not connect to server (https://openlibraries.svn.sourceforge.net)", 175002)

Traceback (most recent call last):
  File "/usr/lib/python2.5/site-packages/bzrlib/commands.py", line 846, in run_bzr_catch_errors
    return run_bzr(argv)
  File "/usr/lib/python2.5/site-packages/bzrlib/commands.py", line 797, in run_bzr
    ret = run(*run_argv)
  File "/usr/lib/python2.5/site-packages/bzrlib/commands.py", line 499, in run_argv_aliases
    return self.run(**all_cmd_args)
  File "/usr/lib/python2.5/site-packages/bzrlib/builtins.py", line 1024, in run
    accelerator_tree, hardlink)
  File "/usr/lib/python2.5/site-packages/bzrlib/plugins/svn/branch.py", line 201, in create_checkout
    return self._create_heavyweight_checkout(to_location, revision_id, hardlink=hardlink)
  File "/usr/lib/python2.5/site-packages/bzrlib/plugins/svn/branch.py", line 153, in _create_heavyweight_checkout
    checkout_branch.pull(self, stop_revision=revision_id)
  File "/usr/lib/python2.5/site-packages/bzrlib/decorators.py", line 165, in write_locked
    return unbound(self, *args, **kwargs)
  File "/usr/lib/python2.5/site-packages/bzrlib/branch.py", line 1766, in pull
    run_hooks=run_hooks)
  File "/usr/lib/python2.5/site-packages/bzrlib/decorators.py", line 165, in write_locked
    return unbound(self, *args, **kwargs)
  File "/usr/lib/python2.5/site-packages/bzrlib/branch.py", line 1569, in pull
    self.update_revisions(source, stop_revision, overwrite=overwrite)
  File "/usr/lib/python2.5/site-packages/bzrlib/decorators.py", line 165, in write_locked
    return unbound(self, *args, **kwargs)
  File "/usr/lib/python2.5/site-packages/bzrlib/branch.py", line 1520, in update_revisions
    self.fetch(other, stop_revision)
  File "/usr/lib/python2.5/site-packages/bzrlib/decorators.py", line 165, in write_locked
    return unbound(self, *args, **kwargs)
  File "/usr/lib/python2.5/site-packages/bzrlib/branch.py", line 265, in fetch
    pb=nested_pb)
  File "/usr/lib/python2.5/site-packages/bzrlib/repository.py", line 953, in fetch
    return inter.fetch(revision_id=revision_id, pb=pb, find_ghosts=find_ghosts)
  File "/usr/lib/python2.5/site-packages/bzrlib/plugins/svn/fetch.py", line 703, in fetch
    self._fetch_switch(conn, needed, pb)
  File "/usr/lib/python2.5/site-packages/bzrlib/plugins/svn/fetch.py", line 659, in _fetch_switch
    reporter.finish_report(pool)
  File "/usr/lib/python2.5/site-packages/bzrlib/plugins/svn/errors.py", line 107, in convert
    raise convert_error(e)
SubversionException: ("PROPFIND of '/svnroot/openlibraries': could not connect to server (https://openlibraries.svn.sourceforge.net)", 175002)

bzr 1.5 on python 2.5.2 (linux2)
arguments: ['/usr/bin/bzr', 'checkout', 'https://openlibraries.svn.sourceforge.net/svnroot/openlibraries/trunk', 'trunk']
encoding: 'UTF-8', fsenc: 'UTF-8', lang: 'en_CA.UTF-8'
plugins:
  bzrtools /usr/lib/python2.5/site-packages/bzrlib/plugins/bzrtools [1.5.0]
  launchpad /usr/lib/python2.5/site-packages/bzrlib/plugins/launchpad [unknown]
  rebase /usr/lib/python2.5/site-packages/bzrlib/plugins/rebase [0.3.0]
  svn /usr/lib/python2.5/site-packages/bzrlib/plugins/svn [0.4.10]
*** 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.

Related branches

Revision history for this message
Andrew Hunter (rexbron) wrote :

It would appear that the svn metadata cache means that bzr-svn will restart from where it left off, provided you remove the directory you were checking into.

Perhaps then all that need to be done is a pretty error message to the user and to clean up the .bzr dir.

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

Thanks for taking the time to report this bug.

I think it's actually two different issues that come up here:

 * bzr-svn should report a clearer error rather than a backtrace
 * fetch should be continuable

The first should be fixable quite easily. Unfortunately, it'll also mean hiding the backtrace for genuine bugs in bzr-svn since the exception raised by svn is very generic.

The second is actually a bug in bzr itself, already reported as bug 116148.

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

Sorry, bug 116148 is about "bzr branch" resumability but you were using checkout. There's a bug about being able to resume checkout as well, bug 125067.

Revision history for this message
Andrew Hunter (rexbron) wrote :
Download full text (4.5 KiB)

More fun stuff. Now I am getting this backtrace:

bzr: ERROR: svn.core.SubversionException: ("'/svnroot/openlibraries/!svn/bc/1403/tags' path not found", 175007)

Traceback (most recent call last):
  File "/usr/lib/python2.5/site-packages/bzrlib/commands.py", line 846, in run_bzr_catch_errors
    return run_bzr(argv)
  File "/usr/lib/python2.5/site-packages/bzrlib/commands.py", line 797, in run_bzr
    ret = run(*run_argv)
  File "/usr/lib/python2.5/site-packages/bzrlib/commands.py", line 499, in run_argv_aliases
    return self.run(**all_cmd_args)
  File "/usr/lib/python2.5/site-packages/bzrlib/builtins.py", line 2364, in run
    author=author)
  File "/usr/lib/python2.5/site-packages/bzrlib/decorators.py", line 165, in write_locked
    return unbound(self, *args, **kwargs)
  File "/usr/lib/python2.5/site-packages/bzrlib/workingtree_4.py", line 240, in commit
    result = WorkingTree3.commit(self, message, revprops, *args, **kwargs)
  File "/usr/lib/python2.5/site-packages/bzrlib/decorators.py", line 165, in write_locked
    return unbound(self, *args, **kwargs)
  File "/usr/lib/python2.5/site-packages/bzrlib/mutabletree.py", line 197, in commit
    revprops=revprops, *args, **kwargs)
  File "/usr/lib/python2.5/site-packages/bzrlib/commit.py", line 387, in commit
    revision_id=self.rev_id)
  File "/usr/lib/python2.5/site-packages/bzrlib/repository.py", line 953, in fetch
    return inter.fetch(revision_id=revision_id, pb=pb, find_ghosts=find_ghosts)
  File "/usr/lib/python2.5/site-packages/bzrlib/plugins/svn/commit.py", line 791, in fetch
    self.copy_content(revision_id=revision_id, pb=pb)
  File "/usr/lib/python2.5/site-packages/bzrlib/plugins/svn/commit.py", line 755, in copy_content
    while not self.target.has_revision(revision_id):
  File "/usr/lib/python2.5/site-packages/bzrlib/plugins/svn/repository.py", line 373, in has_revision
    (path, revnum, _) = self.lookup_revision_id(revision_id)
  File "/usr/lib/python2.5/site-packages/bzrlib/plugins/svn/repository.py", line 553, in lookup_revision_id
    return self.get_revmap().get_branch_revnum(revid, layout)
  File "/usr/lib/python2.5/site-packages/bzrlib/plugins/svn/revids.py", line 172, in get_branch_revnum
    for entry_revid, branch, revno, mapping in self.actual.discover_revids(layout, self.cache.last_revnum_checked(str(layout)), last_revnum):
  File "/usr/lib/python2.5/site-packages/bzrlib/plugins/svn/revids.py", line 72, in discover_revids
    for (branch, revno) in self.repos.find_fileprop_branches(layout, from_revnum, to_revnum):
  File "/usr/lib/python2.5/site-packages/bzrlib/plugins/svn/repository.py", line 806, in find_fileprop_branches
    for (project, branch, nick) in layout.get_branches(revnum):
  File "/usr/lib/python2.5/site-packages/bzrlib/plugins/svn/mapping3/__init__.py", line 83, in get_branches
    find_children):
  File "/usr/lib/python2.5/site-packages/bzrlib/plugins/svn/mapping3/__init__.py", line 41, in expand_branch_pattern
    return expand_branch_pattern(begin+[todo[0]], todo[1:], check_path, get_children)
  File "/usr/lib/python2.5/site-packages/bzrlib/plugins/svn/mapping3/__init__.py", line 42, in expand_branch_pattern
    children = get_children...

Read more...

Revision history for this message
Andrew Hunter (rexbron) wrote :

Forgot to include the terminal output prior to the traceback:

$ bzr commit -m"Merged in gcc4.3 fixes."
Committing to: https://openlibraries.svn.sourceforge.net/svnroot/openlibraries/trunk
modified src/openassetlib/al/base64_codec.hpp
modified src/openimagelib/il/basic_image.hpp
modified src/openmedialib/ml/frame.hpp
modified src/openpluginlib/pl/content_handler_libxml.hpp
modified src/openpluginlib/pl/pcos/key.hpp
bzr: ERROR: svn.core.SubversionException: ("'/svnroot/openlibraries/!svn/bc/1403/tags' path not found", 175007)

Revision history for this message
Jelmer Vernooij (jelmer) wrote : Re: [Bug 253376] Re: Crash when network goes down during a checkout

Hi Andrew,

This is open bug 240954.

Cheers,

Jelmer

On Wed, Jul 30, 2008 at 09:11:12PM -0000, Andrew Hunter wrote:
> Forgot to include the terminal output prior to the traceback:

> $ bzr commit -m"Merged in gcc4.3 fixes."
> Committing to: https://openlibraries.svn.sourceforge.net/svnroot/openlibraries/trunk
> modified src/openassetlib/al/base64_codec.hpp
> modified src/openimagelib/il/basic_image.hpp
> modified src/openmedialib/ml/frame.hpp
> modified src/openpluginlib/pl/content_handler_libxml.hpp
> modified src/openpluginlib/pl/pcos/key.hpp
> bzr: ERROR: svn.core.SubversionException: ("'/svnroot/openlibraries/!svn/bc/1403/tags' path not found", 175007)

> --
> Crash when network goes down during a checkout
> https://bugs.launchpad.net/bugs/253376
> You received this bug notification because you are a member of bzr-svn
> developers, which is subscribed to Bazaar Subversion Plugin.

--

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

This error no longer prints a backtrace in the 0.4 branch.

Changed in bzr-svn:
assignee: nobody → jelmer
importance: Undecided → Low
milestone: none → 0.4.11
status: New → Fix Committed
Jelmer Vernooij (jelmer)
Changed in bzr-svn:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

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