Bazaar has encountered an internal error when removing a directory manually removed

Bug #301592 reported by linovski
2
Affects Status Importance Assigned to Milestone
Bazaar
New
Undecided
Unassigned

Bug Description

I found this behavior in a project.
How to reproduce steps:

rego@linovski-laptop:/tmp$ mkdir testeBug
rego@linovski-laptop:/tmp$ cd testeBug/
rego@linovski-laptop:/tmp/testeBug$ bzr init .
rego@linovski-laptop:/tmp/testeBug$ mkdir a
rego@linovski-laptop:/tmp/testeBug$ touch a/file
rego@linovski-laptop:/tmp/testeBug$ bzr add a/
added a
added a/file
rego@linovski-laptop:/tmp/testeBug$ bzr ci -m "Added some files"
Committing to: /tmp/testeBug/
added a
added a/file
Committed revision 1.
rego@linovski-laptop:/tmp/testeBug$ rm -r a/
rego@linovski-laptop:/tmp/testeBug$ bzr st
removed:
  a/
  a/file
rego@linovski-laptop:/tmp/testeBug$ bzr remove a/
a does not exist.
rego@linovski-laptop:/tmp/testeBug$ mkdir a
rego@linovski-laptop:/tmp/testeBug$ bzr remove a/
bzr: ERROR: exceptions.AssertionError: Could not find target parent in wt: a
parent of: (('a', 'file', 'file-20081124102249-n1ehf2xr9tb4c3ek-2'), [('f', '', 0L, 0, 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx'), ('f', 'da39a3ee5e6b4b0d3255bfef95601890afd80709', 0L, 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 2370, 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: a
parent of: (('a', 'file', 'file-20081124102249-n1ehf2xr9tb4c3ek-2'), [('f', '', 0L, 0, 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx'), ('f', 'da39a3ee5e6b4b0d3255bfef95601890afd80709', 0L, 0, '<email address hidden>')])

bzr 1.3.1 on python 2.5.2.final.0 (linux2)
arguments: ['/usr/bin/bzr', 'remove', 'a/']
encoding: 'UTF-8', fsenc: 'UTF-8', lang: 'en_US.UTF-8'
plugins:
  launchpad /usr/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.
rego@linovski-laptop:/tmp/testeBug$

This is not the supposed utilization. However, if we do it this way it crash.
(When I manual re-create the dir 'a', I had in mind remove the unknown status of that dir.)

Revision history for this message
linovski (avelinorego) wrote :

Well, at this moment my repository is inconsistent.

Reproducing that, in our testeBug dir, here is the error when I check the state:

rego@linovski-laptop:/tmp/testeBug$ bzr st
bzr: ERROR: exceptions.AssertionError: Could not find target parent in wt: a
parent of: (('a', 'file', 'file-20081124102249-n1ehf2xr9tb4c3ek-2'), [('f', '', 0L, 0, 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx'), ('f', 'da39a3ee5e6b4b0d3255bfef95601890afd80709', 0L, 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/commands.py", line 800, in ignore_pipe
    result = func(*args, **kwargs)
  File "/usr/lib/python2.5/site-packages/bzrlib/builtins.py", line 189, in run
    to_file=self.outf, short=short, versioned=versioned)
  File "/usr/lib/python2.5/site-packages/bzrlib/status.py", line 114, in show_tree_status
    want_unversioned=want_unversioned)
  File "/usr/lib/python2.5/site-packages/bzrlib/tree.py", line 93, in changes_from
    want_unversioned=want_unversioned,
  File "/usr/lib/python2.5/site-packages/bzrlib/decorators.py", line 127, in read_locked
    return unbound(self, *args, **kwargs)
  File "/usr/lib/python2.5/site-packages/bzrlib/tree.py", line 727, in compare
    want_unversioned=want_unversioned)
  File "/usr/lib/python2.5/site-packages/bzrlib/delta.py", line 217, in _compare_trees
    want_unversioned=want_unversioned):
  File "/usr/lib/python2.5/site-packages/bzrlib/workingtree_4.py", line 2370, 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: a
parent of: (('a', 'file', 'file-20081124102249-n1ehf2xr9tb4c3ek-2'), [('f', '', 0L, 0, 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx'), ('f', 'da39a3ee5e6b4b0d3255bfef95601890afd80709', 0L, 0, '<email address hidden>')])

bzr 1.3.1 on python 2.5.2.final.0 (linux2)
arguments: ['/usr/bin/bzr', 'st']
encoding: 'UTF-8', fsenc: 'UTF-8', lang: 'en_US.UTF-8'
plugins:
  launchpad /usr/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.
rego@linovski-laptop:/tmp/testeBug$

Revision history for this message
Andrew Bennetts (spiv) wrote :

I believe this bug is the same as bug 150438, which was fixed in bzr 1.6. So if you upgrade your bzr to a newer version this should be fixed for you.

Revision history for this message
linovski (avelinorego) wrote :

Ok, that is fine now that I know.
But it should also be fixed in earlier versions and maintained packages.
If that is not possible then bzr in hardy should be promoted from 1.3.1 to 1.6

Revision history for this message
Martin Pool (mbp) wrote : Re: [Bug 301592] Re: Bazaar has encountered an internal error when removing a directory manually removed

It might be good to put a newer bzr into
<https://help.ubuntu.com/community/UbuntuBackports>

--
Martin <http://launchpad.net/~mbp/>

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

On Fri, Nov 28, 2008 at 12:16 PM, Martin Pool <email address hidden> wrote:
> It might be good to put a newer bzr into
> <https://help.ubuntu.com/community/UbuntuBackports>

To expand on this a bit: putting an update in to hardy-updates
requires that the change be the minimal one to fix the bug
<https://wiki.ubuntu.com/StableReleaseUpdates>. This is in general
going to be a different patch to the one merged in to bzr.dev, because
there we want to fix it in the cleanest expedient way and to keep the
code going forward. So doing a SRU will require some substantial new
technical work. Also, people might reasonably want fixes for annoying
bugs which don't meet the pretty strict criteria for a SRU, such as
adding support for new features.

If we add bzr to the backports archive we'd also have to backport
associated packages such as bzr-gtk and bzr-svn.

I filed bug 302987 asking for a backport.

--
Martin <http://launchpad.net/~mbp/>

Revision history for this message
Anand Kumria (wildfire) wrote :

Perhaps. For me, I am running my servers on 8.04 -- so whilst a
backport would be one way to address this my concern is how much (if
any) security support bzr is likely to receive.

From that page, it appears it is a 'best-effort' basis. That is okay,
but I've restricted myself to using just 'main' so that security
support is available all the time.

Anand

On Fri, Nov 28, 2008 at 1:16 AM, Martin Pool <email address hidden> wrote:
> *** This bug is a duplicate of bug 150438 ***
> https://bugs.launchpad.net/bugs/150438
>
> It might be good to put a newer bzr into
> <https://help.ubuntu.com/community/UbuntuBackports>
>
> --
> Martin <http://launchpad.net/~mbp/>
>
> --
> Bazaar has encountered an internal error when removing a directory manually removed
> https://bugs.launchpad.net/bugs/301592
> You received this bug notification because you are a direct subscriber
> of the bug (via bug 150438).
>
>

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.