bzr-svn seems to corrupt a knit repository

Bug #291370 reported by John Szakmeister
2
Affects Status Importance Assigned to Milestone
Bazaar Subversion Plugin
New
Undecided
Unassigned

Bug Description

I was playing around with branching and merging to and from a subversion repository and ran across a situation where bzr would traceback telling me that the repository is corrupt. I've attached a script that reproduces the issue. Note that I had to use svn+ssh in the script because file:// urls didn't seem to be working with bzr-svn.

Using saved parent location: svn+ssh://localhost/Users/jszakmeister/tmp/reproduce/test-repo/trunk
bzr: ERROR: bzrlib.errors.KnitCorrupt: Knit _KnitGraphIndex(CombinedGraphIndex(GraphIndex('file:///Users/jszakmeister/tmp/reproduce/shared/.bzr/repository/indices/263b97ca058078ba4a0f34a575485fb9.tix'), GraphIndex('file:///Users/jszakmeister/tmp/reproduce/shared/.bzr/repository/indices/bc19878512c1a169a7da8b2aeebb3d7f.tix'))) corrupt: inconsistent details in add_records: (' 42 146', ((('1@5dd11918-ec11-48df-94e5-1ab5d5e00ced:trunk:file', 'svn-v3-trunk0:5dd11918-ec11-48df-94e5-1ab5d5e00ced:trunk:1'),), (('1@5dd11918-ec11-48df-94e5-1ab5d5e00ced:trunk:file', 'svn-v3-trunk0:5dd11918-ec11-48df-94e5-1ab5d5e00ced:trunk:1'),))) (' 834 144', ((('1@5dd11918-ec11-48df-94e5-1ab5d5e00ced:trunk:file', '<email address hidden>'),), ()))

Traceback (most recent call last):
  File "/Users/jszakmeister/Library/Python/2.5/site-packages/bzrlib/commands.py", line 849, in run_bzr_catch_errors
    return run_bzr(argv)
  File "/Users/jszakmeister/Library/Python/2.5/site-packages/bzrlib/commands.py", line 795, in run_bzr
    ret = run(*run_argv)
  File "/Users/jszakmeister/Library/Python/2.5/site-packages/bzrlib/commands.py", line 495, in run_argv_aliases
    return self.run(**all_cmd_args)
  File "/Users/jszakmeister/Library/Python/2.5/site-packages/bzrlib/builtins.py", line 717, in run
    result = branch_to.pull(branch_from, overwrite, revision_id)
  File "/Users/jszakmeister/Library/Python/2.5/site-packages/bzrlib/decorators.py", line 192, in write_locked
    result = unbound(self, *args, **kwargs)
  File "/Users/jszakmeister/Library/Python/2.5/site-packages/bzrlib/branch.py", line 1907, in pull
    _override_hook_target=_override_hook_target)
  File "/Users/jszakmeister/Library/Python/2.5/site-packages/bzrlib/decorators.py", line 192, in write_locked
    result = unbound(self, *args, **kwargs)
  File "/Users/jszakmeister/Library/Python/2.5/site-packages/bzrlib/branch.py", line 1707, in pull
    graph=graph)
  File "/Users/jszakmeister/Library/Python/2.5/site-packages/bzrlib/decorators.py", line 192, in write_locked
    result = unbound(self, *args, **kwargs)
  File "/Users/jszakmeister/Library/Python/2.5/site-packages/bzrlib/branch.py", line 511, in update_revisions
    self.fetch(other, stop_revision)
  File "/Users/jszakmeister/Library/Python/2.5/site-packages/bzrlib/decorators.py", line 192, in write_locked
    result = unbound(self, *args, **kwargs)
  File "/Users/jszakmeister/Library/Python/2.5/site-packages/bzrlib/branch.py", line 273, in fetch
    pb=nested_pb)
  File "/Users/jszakmeister/Library/Python/2.5/site-packages/bzrlib/repository.py", line 989, in fetch
    find_ghosts=find_ghosts)
  File "/Users/jszakmeister/.bazaar/plugins/svn/fetch.py", line 822, in fetch
    self._fetch_switch(self.source.transport.get_svn_repos_root(), needed, pb)
  File "/Users/jszakmeister/.bazaar/plugins/svn/fetch.py", line 767, in _fetch_switch
    report_inventory_contents(reporter, parent_inv, parent_revnum, start_empty)
  File "/Users/jszakmeister/.bazaar/plugins/svn/fetch.py", line 591, in report_inventory_contents
    reporter.finish()
  File "/Users/jszakmeister/.bazaar/plugins/svn/fetch.py", line 200, in close
    return self._close()
  File "/Users/jszakmeister/.bazaar/plugins/svn/fetch.py", line 344, in _close
    [(self.file_id, revid) for revid in self.file_parents], lines)
  File "/Users/jszakmeister/Library/Python/2.5/site-packages/bzrlib/knit.py", line 754, in add_lines
    parent_texts, left_matching_blocks, nostore_sha, random_id)
  File "/Users/jszakmeister/Library/Python/2.5/site-packages/bzrlib/knit.py", line 837, in _add
    random_id=random_id)
  File "/Users/jszakmeister/Library/Python/2.5/site-packages/bzrlib/knit.py", line 2111, in add_records
    ": %s %s" % ((value, node_refs), keys[key]))
KnitCorrupt: Knit _KnitGraphIndex(CombinedGraphIndex(GraphIndex('file:///Users/jszakmeister/tmp/reproduce/shared/.bzr/repository/indices/263b97ca058078ba4a0f34a575485fb9.tix'), GraphIndex('file:///Users/jszakmeister/tmp/reproduce/shared/.bzr/repository/indices/bc19878512c1a169a7da8b2aeebb3d7f.tix'))) corrupt: inconsistent details in add_records: (' 42 146', ((('1@5dd11918-ec11-48df-94e5-1ab5d5e00ced:trunk:file', 'svn-v3-trunk0:5dd11918-ec11-48df-94e5-1ab5d5e00ced:trunk:1'),), (('1@5dd11918-ec11-48df-94e5-1ab5d5e00ced:trunk:file', 'svn-v3-trunk0:5dd11918-ec11-48df-94e5-1ab5d5e00ced:trunk:1'),))) (' 834 144', ((('1@5dd11918-ec11-48df-94e5-1ab5d5e00ced:trunk:file', '<email address hidden>'),), ()))

bzr 1.8 on python 2.5.1 (darwin)
arguments: ['/Users/jszakmeister/bin/bzr', 'pull']
encoding: 'UTF-8', fsenc: 'utf-8', lang: 'en_US.UTF-8'
plugins:
  bzrtools /Users/jszakmeister/.bazaar/plugins/bzrtools [1.8.0]
  launchpad /Users/jszakmeister/Library/Python/2.5/site-packages/bzrlib/plugins/launchpad [unknown]
  rebase /Users/jszakmeister/.bazaar/plugins/rebase [0.3.0]
  svn /Users/jszakmeister/.bazaar/plugins/svn [0.4.13]
*** 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
John Szakmeister (jszakmeister) wrote :
Revision history for this message
John Szakmeister (jszakmeister) wrote :

BTW, my previous version of the script may not work. There's a block in the new script that modifies svnserve.conf to allow anonymous writes. You might need that.

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

Thanks John, this should be fixed now. I've merged your script into the bzr-svn testsuite to make sure it doesn't break again.

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.