NoSuchRevision inside _show_missing_revisions_working during "bzr info -v" on a mysql-5.1 source tree

Bug #260315 reported by Vasil Dimov
4
Affects Status Importance Assigned to Milestone
Bazaar
Invalid
Low
Unassigned
Launchpad itself
Invalid
Undecided
Unassigned

Bug Description

hag:/tmp/autotest.sh-20080820_033000.6AIeTT/mysql-5.1$ bzr info -v
Lightweight checkout (format: dirstate or dirstate-tags or pack-0.92 or rich-root or rich-root-pack)
Location:
  light checkout root: .
   checkout of branch: http://bazaar.launchpad.net/%7Emysql/mysql-server/mysql-5.1/

Format:
       control: Meta directory format 1
  working tree: Working tree format 4
        branch: Branch format 6
    repository: Packs containing knits without subtree support
bzr: ERROR: bzrlib.errors.NoSuchRevision: BzrBranch6('http://bazaar.launchpad.net/%7Emysql/mysql-server/mysql-5.1/') has no revision <email address hidden>

Traceback (most recent call last):
  File "/usr/local/lib/python2.5/site-packages/bzrlib/commands.py", line 846, in run_bzr_catch_errors
    return run_bzr(argv)
  File "/usr/local/lib/python2.5/site-packages/bzrlib/commands.py", line 797, in run_bzr
    ret = run(*run_argv)
  File "/usr/local/lib/python2.5/site-packages/bzrlib/commands.py", line 499, in run_argv_aliases
    return self.run(**all_cmd_args)
  File "/usr/local/lib/python2.5/site-packages/bzrlib/commands.py", line 807, in ignore_pipe
    result = func(*args, **kwargs)
  File "/usr/local/lib/python2.5/site-packages/bzrlib/builtins.py", line 1130, in run
    verbose=noise_level, outfile=self.outf)
  File "/usr/local/lib/python2.5/site-packages/bzrlib/info.py", line 341, in show_bzrdir_info
    outfile)
  File "/usr/local/lib/python2.5/site-packages/bzrlib/info.py", line 369, in show_component_info
    _show_missing_revisions_working(working, outfile)
  File "/usr/local/lib/python2.5/site-packages/bzrlib/info.py", line 227, in _show_missing_revisions_working
    tree_last_revno = branch.revision_id_to_revno(tree_last_id)
  File "/usr/local/lib/python2.5/site-packages/bzrlib/decorators.py", line 127, in read_locked
    return unbound(self, *args, **kwargs)
  File "/usr/local/lib/python2.5/site-packages/bzrlib/branch.py", line 2105, in revision_id_to_revno
    raise errors.NoSuchRevision(self, revision_id)
NoSuchRevision: BzrBranch6('http://bazaar.launchpad.net/%7Emysql/mysql-server/mysql-5.1/') has no revision <email address hidden>

bzr 1.5 on python 2.5.2 (freebsd7)
arguments: ['/usr/local/bin/bzr', 'info', '-v']
encoding: 'US-ASCII', fsenc: 'US-ASCII', lang: None
plugins:
  launchpad /usr/local/lib/python2.5/site-packages/bzrlib/plugins/launchpad [unknown]
*** 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.
hag:/tmp/autotest.sh-20080820_033000.6AIeTT/mysql-5.1$

Tags: lp-code
Revision history for this message
Vasil Dimov (vasild) wrote :

The tree has been checked out with

$ bzr checkout --verbose --lightweight lp:mysql-server/5.1 mysql-5.1

on 2008.08.20 at 3:30 EEST (GMT+3)

Revision history for this message
Neil Martinsen-Burrell (nmb) wrote :

I can't reproduce this using the latest development version of bzr (r3649). Can you try upgrading to the latest release (version 1.6) and see if the bug recurs? Thanks.

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

Vasil, does this happen for you with a fresh checkout? Do you remember anything about the sequence of operations previously done in this tree? For example did you switch it from another branch?

Changed in bzr:
assignee: nobody → mbp
Vincent Ladeuil (vila)
Changed in bzr:
importance: Undecided → Medium
status: New → Incomplete
Revision history for this message
John A Meinel (jameinel) wrote :

So... I can reproduce this, but only by wiping and regenerating the source branch. Specifically:

bzr init SOURCE
bzr commit -m "one" --unchanged SOURCE
bzr commit -m "two" --unchanged SOURCE

bzr branch SOURCE ONE -r 1

bzr co --lightweight SOURCE checkout
mv SOURCE OLD
mv ONE SOURCE
cd checkout

bzr info -v
# Boom #

Now, a simple "bzr uncommit" in SOURCE won't trigger this, because the revisions are still present in the repository.
We don't currently give ways to garbage collect repositories (some of that is for reasons like this, that you don't always know who is refering to revisions that you used to have.)

However, I notice that SOURCE in this case is bazaar.launchpad.net. And that branch is a "pull" mirror of some other branch on a "<private server>".
I know that the branch puller *does* regenerate repositories from time to time. If you "bzr upgrade" the original branch, then the branch puller will wipe and re-pull to make sure to get everything in the right format.

So *if*
1) You had done "bzr co --lightweight lp:mysql-sever", and then
2) someone uncommitted (or used push/pull --overwrite) the <private server> branch, such that the revision your working tree refers to is no longer in the ancestry of the mysql-server branch.
3) Someone did a 'bzr upgrade' or somehow caused the Launchpad-bazaar branch puller to regenerate the branch from scratch on LP (thus no longer referencing the revision which is not in the ancestry.)

Then this could happen.

My best guess... you did 'bzr checkout --lightweight', someone did 'bzr uncommit', and then we switched Launchpad from giving a public URL for the original branch, to being on "<private server>" and this caused the branch puller to regenerate the branch ancestry.

I'm going to include 'launchpad-bazaar' on this bug, but otherwise I'm marking it as low priority, because you really need a lot of things to "go wrong" to trigger it.

Changed in bzr:
assignee: mbp → nobody
importance: Medium → Low
status: Incomplete → Triaged
Revision history for this message
John A Meinel (jameinel) wrote :

I'm including launchpad-bazaar, because I'd like them to confirm/deny when the repository could have been regenerated. As it isn't something that you can do with only 'bzr' commands.

Revision history for this message
Michael Hudson-Doyle (mwhudson) wrote :

So it looks like this was a transient issue -- cause still unknown -- but that things should be working again now. Can you retry and confirm?

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

So the actual problem seems to be that 'bzr info' gives you a traceback if the revision your checkout is based upon no longer contains the revision used by the checkout. Perhaps it should give a clearer message but this probably is an error condition.

So I'm going to close this for now, but please reopen it if this is reproducible.

Changed in bzr:
status: Triaged → Invalid
Changed in launchpad-bazaar:
status: New → Incomplete
Revision history for this message
Jonathan Lange (jml) wrote :

Closing in line w/ Martin Pool's comments.

Changed in launchpad-bazaar:
status: Incomplete → 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.