Crash on merge when managing svn with bzr

Bug #644683 reported by Doug Lee
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Bazaar Subversion Plugin
Fix Released
High
Unassigned

Bug Description

The setup for this one is a bit complex, so I'm attaching a Unix shell script (and its output under MacOS) that produces this crash. In a nutshell, this is an emulation of a work flow for managing a Bzr trunk bound to an upstream svn repo, and several local feature branches that can individually update from the svn repo and which also, on feature completion, merge into the trunk, thus getting committed to svn. The crash in the scenario demonstrated here occurs on the second attempt to merge a feature into the trunk. The traceback follows, and also appears in the output file in the attached zip:

bzr: ERROR: bzrlib.errors.BzrCheckError: Internal check failed: Cannot add revision(s) to repository: missing text keys: [StaticTuple('1a-20100921193241-z2ptpcuze4i0fzby-1', '<email address hidden>'), StaticTuple('1b-20100921193242-3d0sb0amv2y8lxnu-1', '<email address hidden>')]

Traceback (most recent call last):
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/bzrlib/commands.py", line 911, in exception_to_return_code
    return the_callable(*args, **kwargs)
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/bzrlib/commands.py", line 1111, in run_bzr
    ret = run(*run_argv)
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/bzrlib/commands.py", line 689, in run_argv_aliases
    return self.run(**all_cmd_args)
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/bzrlib/commands.py", line 704, in run
    return self._operation.run_simple(*args, **kwargs)
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/bzrlib/cleanup.py", line 135, in run_simple
    self.cleanups, self.func, *args, **kwargs)
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/bzrlib/cleanup.py", line 165, in _do_with_cleanups
    result = func(*args, **kwargs)
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/bzrlib/builtins.py", line 3854, in run
    location, revision, remember, possible_transports, None)
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/bzrlib/builtins.py", line 3985, in _get_merger_from_branch
    other_revision_id, base_revision_id, other_branch, base_branch)
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/bzrlib/merge.py", line 410, in from_revision_ids
    merger.set_other_revision(other, other_branch)
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/bzrlib/merge.py", line 551, in set_other_revision
    self._maybe_fetch(other_branch, self.this_branch, self.other_rev_id)
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/bzrlib/merge.py", line 568, in _maybe_fetch
    target.fetch(source, revision_id)
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/bzrlib/decorators.py", line 194, in write_locked
    result = unbound(self, *args, **kwargs)
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/bzrlib/branch.py", line 673, in fetch
    pb=pb)
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/bzrlib/repository.py", line 1741, in fetch
    find_ghosts=find_ghosts, fetch_spec=fetch_spec)
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/bzrlib/decorators.py", line 194, in write_locked
    result = unbound(self, *args, **kwargs)
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/bzrlib/repository.py", line 3449, in fetch
    find_ghosts=find_ghosts)
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/bzrlib/fetch.py", line 73, in __init__
    self.__fetch()
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/bzrlib/fetch.py", line 99, in __fetch
    self._fetch_everything_for_search(search)
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/bzrlib/fetch.py", line 127, in _fetch_everything_for_search
    stream, from_format, [])
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/bzrlib/repository.py", line 4288, in insert_stream
    is_resume)
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/bzrlib/repository.py", line 4388, in _locked_insert_stream
    hint = self.target_repo.commit_write_group()
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/bzrlib/repository.py", line 1600, in commit_write_group
    result = self._commit_write_group()
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/bzrlib/repofmt/pack_repo.py", line 2311, in _commit_write_group
    hint = self._pack_collection._commit_write_group()
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/bzrlib/repofmt/pack_repo.py", line 2149, in _commit_write_group
    "Cannot add revision(s) to repository: " + problems_summary)
BzrCheckError: Internal check failed: Cannot add revision(s) to repository: missing text keys: [StaticTuple('1a-20100921193241-z2ptpcuze4i0fzby-1', '<email address hidden>'), StaticTuple('1b-20100921193242-3d0sb0amv2y8lxnu-1', '<email address hidden>')]

bzr 2.2.0 on python 2.6.6 (Darwin-10.4.0-i386-64bit)
arguments: ['/opt/local/bin/bzr', 'merge', '../f2']
encoding: 'UTF-8', fsenc: 'utf-8', lang: 'en_US.UTF-8'
plugins:
  bash_completion /opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/bzrlib/plugins/bash_completion [2.2.0]
  bookmarks /Users/dlee/.bazaar/plugins/bookmarks [unknown]
  bzrtools /opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/bzrlib/plugins/bzrtools [2.2.0]
  cvsps_import /Users/dlee/.bazaar/plugins/cvsps_import [unknown]
  email /Users/dlee/.bazaar/plugins/email [unknown]
  fastimport /Users/dlee/.bazaar/plugins/fastimport [unknown]
  launchpad /opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/bzrlib/plugins/launchpad [2.2.0]
  netrc_credential_store /opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/bzrlib/plugins/netrc_credential_store [2.2.0]
  news_merge /opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/bzrlib/plugins/news_merge [2.2.0]
  rewrite /opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/bzrlib/plugins/rewrite [0.6.1]
  service /Users/dlee/.bazaar/plugins/service [unknown]
  svn /opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/bzrlib/plugins/svn [1.0.4]

*** Bazaar has encountered an internal error. This probably indicates a
    bug in Bazaar. You can help us fix it by filing a bug report at
        https://bugs.launchpad.net/bzr/+filebug
    including this traceback and a description of the problem.

Revision history for this message
Doug Lee (dgl-dlee) wrote :

errgen in this file is a shell script that, given bzr and svn and a folder to work in, will reproduce this error. errgen.out is the result of running errgen (under `script') on my Mac.

Revision history for this message
Andrew Bennetts (spiv) wrote :

I can reproduce this with your script, thanks very much!

I had to add this to the start of the script, though, because I have commit aliased to commit --no-strict:
bzr() {
 bzr --no-aliases "$@"
}

I suspect bzr-svn is the source of this bug, rather than bzr, but it'll take some digging to be sure what's going on.

Changed in bzr:
importance: Undecided → High
status: New → Confirmed
Revision history for this message
Andrew Bennetts (spiv) wrote :

Jelmer, I'm semi-speculatively assigning this to bzr-svn, but of course feel free to assign it back.

One possible point of interest is that the 'svnBase' branch, in subversion format, fails 'bzr check', but maybe that's a red herring?

affects: bzr → bzr-svn
Jelmer Vernooij (jelmer)
Changed in bzr-svn:
milestone: none → 1.1.0
Jelmer Vernooij (jelmer)
Changed in bzr-svn:
status: Confirmed → Triaged
Revision history for this message
Jelmer Vernooij (jelmer) wrote :

This should be fixed in bzr-svn trunk; can you verify?

Changed in bzr-svn:
status: Triaged → Incomplete
Jelmer Vernooij (jelmer)
Changed in bzr-svn:
milestone: 1.1.0 → 1.1.1
Jelmer Vernooij (jelmer)
Changed in bzr-svn:
status: Incomplete → 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.