NoSuchRevision in diff when a ghost introduced the modified text.

Bug #295611 reported by Peter Bienstman
118
This bug affects 14 people
Affects Status Importance Assigned to Milestone
Bazaar
Fix Released
High
Jelmer Vernooij
2.0
Confirmed
High
Unassigned

Bug Description

Unfortunately, I'm having again issues with my repository:

>cd ~
>rm -R .bazaar/
>mdir new_source
>cd new_source/
>bzr co https://mnemosyne-proj.svn.sourceforge.net/svnroot/mnemosyne-proj/trunk mnemosyne-proj
>pico mnemosyne-proj/mnemosyne/TODO
>cd mnemosyne-proj/
>bzr diff

=== modified file 'mnemosyne/TODO'
bzr: ERROR: bzrlib.errors.NoSuchRevision: KnitPackRepository('file:///home/pbienst/new_source/mnemosyne-proj/.bzr/repository/') has no revision <email address hidden>

Traceback (most recent call last):
  File "/usr/lib/python2.5/site-packages/bzrlib/commands.py", line 893, in run_bzr_catch_errors
    return run_bzr(argv)
  File "/usr/lib/python2.5/site-packages/bzrlib/commands.py", line 839, in run_bzr
    ret = run(*run_argv)
  File "/usr/lib/python2.5/site-packages/bzrlib/commands.py", line 539, in run_argv_aliases
    return self.run(**all_cmd_args)
  File "/usr/lib/python2.5/site-packages/bzrlib/commands.py", line 853, in ignore_pipe
    result = func(*args, **kwargs)
  File "/usr/lib/python2.5/site-packages/bzrlib/builtins.py", line 1616, in run
    extra_trees=extra_trees, using=using)
  File "/usr/lib/python2.5/site-packages/bzrlib/diff.py", line 426, in show_diff_trees
    return differ.show_diff(specific_files, extra_trees)
  File "/usr/lib/python2.5/site-packages/bzrlib/diff.py", line 831, in show_diff
    return self._show_diff(specific_files, extra_trees)
  File "/usr/lib/python2.5/site-packages/bzrlib/diff.py", line 891, in _show_diff
    self.diff(file_id, oldpath, newpath)
  File "/usr/lib/python2.5/site-packages/bzrlib/diff.py", line 914, in diff
    new_path, old_kind, new_kind)
  File "/usr/lib/python2.5/site-packages/bzrlib/diff.py", line 492, in _diff_many
    new_kind)
  File "/usr/lib/python2.5/site-packages/bzrlib/diff.py", line 614, in diff
    old_date = _patch_header_date(self.old_tree, file_id, old_path)
  File "/usr/lib/python2.5/site-packages/bzrlib/diff.py", line 438, in _patch_header_date
    mtime = tree.get_file_mtime(file_id, path)
  File "/usr/lib/python2.5/site-packages/bzrlib/workingtree_4.py", line 1615, in get_file_mtime
    return self._repository.get_revision(last_changed_revision).timestamp
  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/repofmt/knitrepo.py", line 216, in get_revision
    return self.get_revision_reconcile(revision_id)
  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 1126, in get_revision_reconcile
    return self._get_revisions([revision_id])[0]
  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 1144, in _get_revisions
    raise errors.NoSuchRevision(self, record.key[0])
NoSuchRevision: KnitPackRepository('file:///home/pbienst/new_source/mnemosyne-proj/.bzr/repository/') has no revision <email address hidden>

bzr 1.9 on python 2.5.2 (linux2)
arguments: ['/usr/bin/bzr', 'diff']
encoding: 'UTF-8', fsenc: 'UTF-8', lang: 'en_US.utf8'
plugins:
  bzrtools /usr/lib/python2.5/site-packages/bzrlib/plugins/bzrtools [1.8.0]
  launchpad /usr/lib/python2.5/site-packages/bzrlib/plugins/launchpad [unknown]
  svn /usr/lib/python2.5/site-packages/bzrlib/plugins/svn [0.4.14]
*** 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.

The only modifications I did to the released versions was to apply the patch for
https://bugs.launchpad.net/bzr/+bug/293440

Related branches

Revision history for this message
Peter Bienstman (peter-bienstman) wrote :

BTW, I'm still having problems with this using bzr-svn revision 1741 on the 0.4 branch, so I don't think this is a duplicate of bug #277043

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

My apologies, you were right. This is actually a different bug, in bzr. I think there already is a bug report open about this, but I can't find it at the moment.

Changed in bzr-svn:
status: New → Confirmed
Revision history for this message
Peter Bienstman (peter-bienstman) wrote :
Revision history for this message
Jelmer Vernooij (jelmer) wrote :

It's definitely different from any of those.

From IRC yesterday:

22:42 < jelmer> lifeless, basically it's similar to the bug we looked at during the summer
22:43 * jelmer looks again
22:43 < jelmer> lifeless, sorry, it's actually related to ghosts
22:44 < jelmer> where "bzr diff" assumes that the revision info for the last-changed-revision of all files in the tree are present
22:49 < lifeless> jelmer: I can't parse that. Is a valid rephrasing 'the last-changed-revision is used as the key for the file text'?
22:49 < jelmer> lifeless, nope
22:50 < jelmer> lifeless, bzr diff prints the timestamp of the original text of a file and of the new revised one
22:51 < lifeless> with you so far
22:51 < jelmer> in order to obtain the timestamp for the old text, it uses the text revision and calls Repository.get_revision(text_revision)
22:51 < jelmer> if that text_revision happens to be a ghost, things break
22:51 < lifeless> ah
22:51 < lifeless> so there are some interactions here
22:52 -!- ia [n=ia@89.169.165.188] has joined #bzr
22:52 < lifeless> we really need to sit down and clean up the ghost handling once and for all
22:52 < lifeless> the interaction I'm thinking of is: we only copy text (id,X) when we copy revision X
22:52 < lifeless> so that repository isn't clonable by bzr at all anyhow
22:52 < lifeless> (as it currently stands)
22:53 < jelmer> that would break bzr-svn, which usually only pushes lhs revisions
22:53 < jelmer> that may contain references to texts introduced by rhs revisions
22:54 < jelmer> *those lhs revisions may contain references to texts introduced by rhs revisions
22:56 -!- oleavr [<email address hidden>] has joined #bzr
22:57 < lifeless> jelmer: 'does break'
22:58 < lifeless> jelmer: though I think I've mentioned before that having those references isn't strictly valid
22:58 < lifeless> under the current rules. And thus the need to fix this forever
22:59 < lifeless> the inventory work being done at the moment will open the door to handling this efficiently and preserving arbitrary revision text values, which would make the revision-being-absent a valid bug

Revision history for this message
Peter Bienstman (peter-bienstman) wrote :

I was wondering if there is any update on this, or at least a workaround? This bug prevents me from using bzr and launchpad, which is rather detrimental for development...

Thanks a lot!

Peter

Revision history for this message
Jean-Francois Roy (jeanfrancois.roy) wrote :

I've just hit this this morning with bzr 1.13 final and bzr-svn 0.5.4dev:

0.032 bzr arguments: [u'diff']
0.044 looking for plugins in /Volumes/Crossroads/bahamut/.bazaar/plugins
0.089 looking for plugins in /Library/Python/2.6/site-packages/bzrlib/plugins
0.187 opening working tree '/<path>/sandbox'
0.498 Traceback (most recent call last):
  File "/Library/Python/2.6/site-packages/bzrlib/commands.py", line 716, in exception_to_return_code
    return the_callable(*args, **kwargs)
  File "/Library/Python/2.6/site-packages/bzrlib/commands.py", line 911, in run_bzr
    ret = run(*run_argv)
  File "/Library/Python/2.6/site-packages/bzrlib/commands.py", line 547, in run_argv_aliases
    return self.run(**all_cmd_args)
  File "/Library/Python/2.6/site-packages/bzrlib/commands.py", line 926, in ignore_pipe
    result = func(*args, **kwargs)
  File "/Library/Python/2.6/site-packages/bzrlib/builtins.py", line 1768, in run
    extra_trees=extra_trees, using=using)
  File "/Library/Python/2.6/site-packages/bzrlib/diff.py", line 428, in show_diff_trees
    return differ.show_diff(specific_files, extra_trees)
  File "/Library/Python/2.6/site-packages/bzrlib/diff.py", line 833, in show_diff
    return self._show_diff(specific_files, extra_trees)
  File "/Library/Python/2.6/site-packages/bzrlib/diff.py", line 893, in _show_diff
    self.diff(file_id, oldpath, newpath)
  File "/Library/Python/2.6/site-packages/bzrlib/diff.py", line 916, in diff
    new_path, old_kind, new_kind)
  File "/Library/Python/2.6/site-packages/bzrlib/diff.py", line 494, in _diff_many
    new_kind)
  File "/Library/Python/2.6/site-packages/bzrlib/diff.py", line 616, in diff
    old_date = _patch_header_date(self.old_tree, file_id, old_path)
  File "/Library/Python/2.6/site-packages/bzrlib/diff.py", line 440, in _patch_header_date
    mtime = tree.get_file_mtime(file_id, path)
  File "/Library/Python/2.6/site-packages/bzrlib/workingtree_4.py", line 1662, in get_file_mtime
    return self._repository.get_revision(last_changed_revision).timestamp
  File "/Library/Python/2.6/site-packages/bzrlib/decorators.py", line 138, in read_locked
    result = unbound(self, *args, **kwargs)
  File "/Library/Python/2.6/site-packages/bzrlib/repofmt/knitrepo.py", line 214, in get_revision
    return self.get_revision_reconcile(revision_id)
  File "/Library/Python/2.6/site-packages/bzrlib/decorators.py", line 138, in read_locked
    result = unbound(self, *args, **kwargs)
  File "/Library/Python/2.6/site-packages/bzrlib/repository.py", line 1280, in get_revision_reconcile
    return self._get_revisions([revision_id])[0]
  File "/Library/Python/2.6/site-packages/bzrlib/decorators.py", line 138, in read_locked
    result = unbound(self, *args, **kwargs)
  File "/Library/Python/2.6/site-packages/bzrlib/repository.py", line 1298, in _get_revisions
    raise errors.NoSuchRevision(self, record.key[0])
NoSuchRevision: KnitPackRepository('file://<path>/.bzr/repository/') has no revision svn-v4:be02940b-5f7b-422b-ba6c-1eb93f4884eb:<url>/branches/<branch name>:9673

The command was executed in a lightweight checkout of a native bzr branch whose parent is a remote SVN branch.

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

marking this as high as it's a blocker for quite a few people

Changed in bzr:
importance: Undecided → High
status: Confirmed → Triaged
Revision history for this message
John A Meinel (jameinel) wrote :

If this is the "fetch doesn't transmit texts introduced in a ghost" that seems to be the IRC conversation with lifeless, then it should be marked "Fix Released" as he landed a patch just last week that does the "set difference".

Namely revno 4117:
message:
  (robertc) Handle inconsistent inventories in fetch more robustly.
   (Robert Collins)

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

No, it's about diff trying to reproduce the modification time of ghost revisions if a text revision introduced in a ghost is part of the diffed tree.

John A Meinel (jameinel)
Changed in bzr:
assignee: nobody → Jelmer Vernooij (jelmer)
milestone: none → 2.1.0rc1
status: Triaged → Fix Released
Revision history for this message
Robert Collins (lifeless) wrote :

We should port this to 2.0.6/2.0.7

summary: - NoSuchRevision: KnitPackRepository
+ NoSuchRevision in diff when a ghost introduced the modified text.
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.