bzr 1.16 blows up on upgrade or check

Bug #392698 reported by Martin Albisetti
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Bazaar
Invalid
Undecided
Unassigned

Bug Description

When trying to upgrade a 1.9 format to 2a, I got a traceback, which is also triggered by running check.
It is *not* triggered by reconcile, and reconciling does nothing to fix it.

Traceback:

Traceback (most recent call last):
  File "/usr/lib/python2.5/site-packages/bzrlib/commands.py", line 729, in exception_to_return_code
    return the_callable(*args, **kwargs)
  File "/usr/lib/python2.5/site-packages/bzrlib/commands.py", line 924, in run_bzr
    ret = run(*run_argv)
  File "/usr/lib/python2.5/site-packages/bzrlib/commands.py", line 560, in run_argv_aliases
    return self.run(**all_cmd_args)
  File "/usr/lib/python2.5/site-packages/bzrlib/builtins.py", line 3015, in run
    check_dwim(path, verbose, do_branch=branch, do_repo=repo, do_tree=tree)
  File "/usr/lib/python2.5/site-packages/bzrlib/check.py", line 318, in check_dwim
    result = repo.check()
  File "/usr/lib/python2.5/site-packages/bzrlib/decorators.py", line 138, in read_locked
    result = unbound(self, *args, **kwargs)
  File "/usr/lib/python2.5/site-packages/bzrlib/repository.py", line 2494, in check
    return self._check(revision_ids)
  File "/usr/lib/python2.5/site-packages/bzrlib/repository.py", line 2498, in _check
    result.check()
  File "/usr/lib/python2.5/site-packages/bzrlib/check.py", line 86, in check
    self.check_one_rev(rev_id)
  File "/usr/lib/python2.5/site-packages/bzrlib/check.py", line 203, in check_one_rev
    self._check_revision_tree(rev_id)
  File "/usr/lib/python2.5/site-packages/bzrlib/check.py", line 244, in _check_revision_tree
    ie.check(self, rev_id, inv, tree)
  File "/usr/lib/python2.5/site-packages/bzrlib/inventory.py", line 283, in check
    self._check(checker, rev_id, tree)
  File "/usr/lib/python2.5/site-packages/bzrlib/inventory.py", line 497, in _check
    if (self.text_sha1 != tree._repository.texts.get_sha1s([key])[key]):
KeyError: ('wiki_icon.gif-20070525002152-lu3yrapgr7a4d8dp-75', '<email address hidden>')

Revision history for this message
John A Meinel (jameinel) wrote :

This at least looks like a case where the given text is actually missing.

So the inventory is referencing a (file, revision) key that is not present in the repository's text store.

reconcile doesn't "fail" because it can't do anything about a missing file.

A few possibilities present themselves

1) What is it about this inventory that caused us not to fetch the text. Certainly this sounds like a ghost issue, or one of the inventory bugs where a commit would claim a last-modified revision that the inventory itself did not claim. (So inventory for rev2 says the file was last modified in rev1, but the inventory in rev1 *doesn't* say that it was modified in rev1)

Note that the revision in question is from 200705, which means that it is likely to have been committed with a much older version of bzr. NEWS claims bzr 0.16 was released 2007-05-07, which was right after Dirstate was released (0.15) and IIRC 0.15 had a few dirstate bugs. I don't know that it would cause this, but potentially it could have.

2) We could try to artificially fill in the missing text from:
  a) Another repository that might have that text already present
  b) Look at the sha1, and see if we have any text with the same sha1 present.

3) Alternatively, we could try and rewrite the inventory to not reference that text. Instead, have it reference whatever a reasonable parent would reference. However, this potentially opens us up to having 2 inventories with different texts.

4) Versions of bzr ~>= 1.13 use a set-difference algorithm to determine what texts to send, so should be copy referenced texts, even if we aren't copying the revision that it claimed to be introduced in.
Versions just prior to that did not. (they only copied texts that were exactly referenced by the given revision).

So it is possible that a bzr circa 0.15/16 created a bad inventory, and a bzr circa 1.11/12 failed to copy the referenced text. So at this point, you really don't have that text present.

Revision history for this message
Martin Pool (mbp) wrote :

We fixed some bugs like this in the course of finishing 2.0 and I think this may be fixed too. Please reopen if not.

Changed in bzr:
status: New → Invalid
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.