"bzr remove deleted_dir" corrupted my repo

Bug #250661 reported by beerfan
2
Affects Status Importance Assigned to Milestone
Bazaar
New
Undecided
Unassigned

Bug Description

I have a bzr repo in which I renamed some directories (e.g. "mv dir.old dir.new"). Bazaar reported these directories as missing so I did "bzr remove dir.old" thinking this would be fine because the bzr docs say that "remove" simply makes a file unversioned. Instead, bzr spewed python traceback and the following assertion and now my repo appears to be corrupted.

===================
censored@censored:~/Projects/wpmu/public/wp-content/themes/pro/sites$ bzr remove blog5.wpmu2.local/
bzr: ERROR: exceptions.AssertionError: Could not find target parent in wt: wp-content/themes/pro/sites/blog5.wpmu2.local
parent of: (('wp-content/themes/pro/sites/blog5.wpmu2.local', 'about.txt', 'about.txt-20080706225650-fh23g1056kx48gby-1190'), [('f', '175bb89bf2c9d9718b5cc17bbd151cf0cd8f43b8', 166L, 0, 'AAAApkhFYUtIcUNSAAAIBQFBgWcAAIGk'), ('f', '175bb89bf2c9d9718b5cc17bbd151cf0cd8f43b8', 166L, 0, '<email address hidden>')])

Traceback (most recent call last):
  File "/usr/lib/python2.5/site-packages/bzrlib/commands.py", line 834, in run_bzr_catch_errors
    return run_bzr(argv)
  File "/usr/lib/python2.5/site-packages/bzrlib/commands.py", line 790, in run_bzr
    ret = run(*run_argv)
  File "/usr/lib/python2.5/site-packages/bzrlib/commands.py", line 492, in run_argv_aliases
    return self.run(**all_cmd_args)
  File "/usr/lib/python2.5/site-packages/bzrlib/builtins.py", line 1164, in run
    force=file_deletion_strategy=='force')
  File "/usr/lib/python2.5/site-packages/bzrlib/mutabletree.py", line 51, in tree_write_locked
    return unbound(self, *args, **kwargs)
  File "/usr/lib/python2.5/site-packages/bzrlib/workingtree.py", line 1940, in remove
    want_unversioned=True, specific_files=files):
  File "/usr/lib/python2.5/site-packages/bzrlib/workingtree_4.py", line 2397, in iter_changes
    result = _process_entry(current_entry, current_path_info)
  File "/usr/lib/python2.5/site-packages/bzrlib/workingtree_4.py", line 2076, in _process_entry
    % (new_dirname, entry))
AssertionError: Could not find target parent in wt: wp-content/themes/pro/sites/blog5.wpmu2.local
parent of: (('wp-content/themes/pro/sites/blog5.wpmu2.local', 'about.txt', 'about.txt-20080706225650-fh23g1056kx48gby-1190'), [('f', '175bb89bf2c9d9718b5cc17bbd151cf0cd8f43b8', 166L, 0, 'AAAApkhFYUtIcUNSAAAIBQFBgWcAAIGk'), ('f', '175bb89bf2c9d9718b5cc17bbd151cf0cd8f43b8', 166L, 0, '<email address hidden>')])

bzr 1.3.1 on python 2.5.2.final.0 (linux2)
arguments: ['/usr/bin/bzr', 'remove', 'blog5.wpmu2.local/']
encoding: 'UTF-8', fsenc: 'UTF-8', lang: 'en_CA.UTF-8'
plugins:
  launchpad /usr/lib/python2.5/site-packages/bzrlib/plugins/launchpad [unknown]
  xmloutput /home/censored/.bazaar/plugins/xmloutput [0.4.4]
*** 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.

===================

I tried "bzr check" results in the same traceback saying that I should submit a bzr bug report. Well, here I am.

I found these other bug reports which sound similar.

https://bugs.launchpad.net/bzr/+bug/114808 (says it's fixed as of 0.18, whatever/whenever that was)
https://bugs.launchpad.net/bzr/+bug/2494 (this issue simply causes the command to not work, but does not corrupt the repo)

I now realize I must use bzr to do everything but it really should have protected me from corrupting the repository. This is a serious bug.

I'm using bzr stand-alone so there are no other distributed copies of my repository. Therefore, deleting it and getting another copy isn't an option. Is there any way to repair my repo? I cannot find any indication in google or launchpad that this is possible.

Revision history for this message
Dan Watkins (oddbloke) wrote :

Hi beerfan,

Apologies for the inconvenience this has caused you. One workaround might be to just try branching from the affected branch to somewhere else.

Also, if you could give us the output, including traceback, from running 'check' that would help us locate where the problem is occurring.

Regards,

Dan

Revision history for this message
James Westby (james-w) wrote :

Hi beerfan,

It appears that you have encountered bug 150438. In

https://bugs.edge.launchpad.net/bzr/+bug/150438/comments/12

John provides a workaround that should get you going again. Let us
know if this doesn't work for you.

Thanks,

James

Revision history for this message
beerfan (beerfan) wrote :

The work-around reported in that page did work for me. Thank you VERY much for the pointer.

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.