AssertionError in dirstate.py when committing with bzr 0.15.0candidate2

Bug #93681 reported by Björn Tillenius
2
Affects Status Importance Assigned to Milestone
Bazaar
Fix Released
High
John A Meinel

Bug Description

When I ran 'bzr commit' after merging in some changes I got the following assertion error:

bzr arguments: [u'commit', u'-m', u'merge bug-90062.']
looking for plugins in /home/bjorn/.bazaar/plugins
looking for plugins in /usr/lib/python2.4/site-packages/bzrlib/plugins
Plugin name __init__ already loaded
Plugin name __init__ already loaded
encoding stdout as sys.stdout encoding 'UTF-8'
got branch format Bazaar-NG branch format 5
opening working tree '/extra/devel/launchpad/initial-ubuntu-cve-tracking'
preparing to commit
commit parent revision {<email address hidden>}
[21731] Mon 13:47:17.494 INFO: missing lib/canonical/launchpad/pathlookup
Traceback (most recent call last):
  File "/usr/lib/python2.4/site-packages/bzrlib/commands.py", line 650, in run_bzr_catch_errors
    return run_bzr(argv)
  File "/usr/lib/python2.4/site-packages/bzrlib/commands.py", line 612, in run_bzr
    ret = run(*run_argv)
  File "/usr/lib/python2.4/site-packages/bzrlib/commands.py", line 304, in run_argv_aliases
    return self.run(**all_cmd_args)
  File "/usr/lib/python2.4/site-packages/bzrlib/builtins.py", line 2119, in run
    reporter=reporter)
  File "/usr/lib/python2.4/site-packages/bzrlib/decorators.py", line 165, in write_locked
    return unbound(self, *args, **kwargs)
  File "/usr/lib/python2.4/site-packages/bzrlib/workingtree_4.py", line 238, in commit
    result = WorkingTree3.commit(self, message, revprops, *args, **kwargs)
  File "/usr/lib/python2.4/site-packages/bzrlib/decorators.py", line 165, in write_locked
    return unbound(self, *args, **kwargs)
  File "/usr/lib/python2.4/site-packages/bzrlib/mutabletree.py", line 160, in commit
    revprops=revprops, *args, **kwargs)
  File "/usr/lib/python2.4/site-packages/bzrlib/commit.py", line 318, in commit
    self._remove_deleted()
  File "/usr/lib/python2.4/site-packages/bzrlib/commit.py", line 581, in _remove_deleted
    self.work_tree.unversion(deleted_ids)
  File "/usr/lib/python2.4/site-packages/bzrlib/mutabletree.py", line 38, in tree_write_locked
    return unbound(self, *args, **kwargs)
  File "/usr/lib/python2.4/site-packages/bzrlib/workingtree_4.py", line 1167, in unversion
    if not state._make_absent(block[1][entry_index]):
  File "/usr/lib/python2.4/site-packages/bzrlib/dirstate.py", line 2055, in _make_absent
    assert update_tree_details[0][0] != 'a' # absent
AssertionError

Related branches

Revision history for this message
Björn Tillenius (bjornt) wrote :

I should add that the pathlookup directory was removed by the merge, but there was a conflict since a file inside the pathlookup directory had been modified in branch.

Doing 'mkdir lib/canonical/launchpad/pathlookup' made 'bzr commit' work.

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

I haven't been able to replicate this locally, though I did find a different bug. This is what I tried
% bzr init a
% cd a
% bzr
% mkdir foo; echo bar > foo/bar
% bzr add
added foo
added foo/bar
% bzr commit -m "init"
added foo
added foo/bar
Committed revision 1.
% cd ..
% bzr branch a b
cd b
Branched 1 revision(s).
% cd b
% echo baz > foo/baz
% bzr add
added foo/baz
% bzr commit -m "foo/baz"
added foo/baz
Committed revision 2.
% cd ../a
% rm -rf fo
% bzr rm foo; rm -rf foo
% bzr commit -m "rm foo"
deleted foo
deleted foo/bar
Committed revision 2.
% cd ../b
% bzr merge ../a
-D foo/bar
Conflict: can't delete foo because it is not empty. Not deleting.
Conflict because foo is not versioned, but has versioned children. Versioned directory.
2 conflicts encountered.
% bzr st
removed:
  foo/bar
  foo/baz
conflicts:
  Conflict: can't delete foo because it is not empty. Not deleting.
  Conflict because foo is not versioned, but has versioned children. Versioned directory.
pending merges:
  John Arbash Meinel 2007-03-19 rm foo

Is it possible to get access to the branches in question (possibly privately). It would certainly be helpful to have a reproducible test case.

Revision history for this message
Björn Tillenius (bjornt) wrote : Re: [Bug 93681] Re: AssertionError in dirstate.py when committing with bzr 0.15.0candidate2
Download full text (3.2 KiB)

On Mon, Mar 19, 2007 at 04:41:49PM -0000, John A Meinel wrote:
> I haven't been able to replicate this locally, though I did find a
> different bug.

I tried some more, and I did manage to reproduce it now, using the
following commands:

bettan:/tmp> bzr init foo
bettan:/tmp> cd foo/
bettan:/tmp/foo> mkdir dir
bettan:/tmp/foo> echo foo > dir/file
bettan:/tmp/foo> bzr add
added dir
added dir/file
bettan:/tmp/foo> bzr commit -m "add dir/file"
added dir
added dir/file
Committed revision 1.

bettan:/tmp/foo> cd ..
bettan:/tmp> bzr branch foo/ bar
Branched 1 revision(s).
bettan:/tmp> cd foo/
bettan:/tmp/foo> bzr rm dir/file
bettan:/tmp/foo> bzr rm dir
bettan:/tmp/foo> bzr commit -m "remove dir/file"
deleted dir
deleted dir/file
Committed revision 2.

bettan:/tmp/foo> cd ../bar/
bettan:/tmp/bar> echo bar > dir/file
bettan:/tmp/bar> bzr commit -m "modify dir/file"
modified dir/file
Committed revision 2.

bettan:/tmp/bar> bzr merge ../foo/
RM dir/file => dir/file.THIS
Conflict: can't delete dir because it is not empty. Not deleting.
Conflict because dir is not versioned, but has versioned children. Versioned directory.
Contents conflict in dir/file
3 conflicts encountered.
bettan:/tmp/bar> rm -r dir
bettan:/tmp/bar> bzr resolved dir
bettan:/tmp/bar> bzr resolved dir/file
bettan:/tmp/bar> bzr commit -m "merge foo"
missing dir
bzr: ERROR: exceptions.AssertionError:

Traceback (most recent call last):
  File "/usr/lib/python2.4/site-packages/bzrlib/commands.py", line 650, in run_bzr_catch_errors
    return run_bzr(argv)
  File "/usr/lib/python2.4/site-packages/bzrlib/commands.py", line 612, in run_bzr
    ret = run(*run_argv)
  File "/usr/lib/python2.4/site-packages/bzrlib/commands.py", line 304, in run_argv_aliases
    return self.run(**all_cmd_args)
  File "/usr/lib/python2.4/site-packages/bzrlib/builtins.py", line 2119, in run
    reporter=reporter)
  File "/usr/lib/python2.4/site-packages/bzrlib/decorators.py", line 165, in write_locked
    return unbound(self, *args, **kwargs)
  File "/usr/lib/python2.4/site-packages/bzrlib/workingtree_4.py", line 238, in commit
    result = WorkingTree3.commit(self, message, revprops, *args, **kwargs)
  File "/usr/lib/python2.4/site-packages/bzrlib/decorators.py", line 165, in write_locked
    return unbound(self, *args, **kwargs)
  File "/usr/lib/python2.4/site-packages/bzrlib/mutabletree.py", line 160, in commit
    revprops=revprops, *args, **kwargs)
  File "/usr/lib/python2.4/site-packages/bzrlib/commit.py", line 318, in commit
    self._remove_deleted()
  File "/usr/lib/python2.4/site-packages/bzrlib/commit.py", line 581, in _remove_deleted
    self.work_tree.unversion(deleted_ids)
  File "/usr/lib/python2.4/site-packages/bzrlib/mutabletree.py", line 38, in tree_write_locked
    return unbound(self, *args, **kwargs)
  File "/usr/lib/python2.4/site-packages/bzrlib/workingtree_4.py", line 1167, in unversion
    if not state._make_absent(block[1][entry_index]):
  File "/usr/lib/python2.4/site-packages/bzrlib/dirstate.py", line 2055, in _make_absent
    assert update_tree_details[0][0] != 'a' # absent
AssertionError

bzr 0.15.0candidate2 on python 2.4.4.candidate.1 (linux2)
arguments: ['/usr/bin/bzr', 'commi...

Read more...

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

I can confirm this is happening, and I've started a branch to fix it.

Changed in bzr:
assignee: nobody → jameinel
importance: Undecided → High
status: Unconfirmed → In Progress
Revision history for this message
John A Meinel (jameinel) wrote :

This seems to be an odd mix of having the directory disappear underneath us. Because after failing the first commit, doing "bzr commit" again will succeed.

Also, if you call "bzr rm dir" after resolving the conflicts, rather than just deleting the directory, it works.

I was able to reproduce this without a merge. You just need a moved file that is then removed from the directory on up.

% bzr init a
% cd a
% mkdir dir
% echo foo > dir/foo
% bzr add
% bzr commit -m "foo"
% bzr mv dir/foo dir/bar
% rm -rf dir
% bzr commit -m "deleted"
### Assertion Error
% bzr commit -m "bar"
deleted dir
deleted dir/foo
Committed revision 2.

The reason this was triggered by the merge is because the conflict actually causes a rename from dir/file => dir/file.THIS. (And as another bug the 'bzr resolve dir/file' actually deletes the dir/file.THIS)

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

This can also be triggered by just 'bzr rm dir/file'. Because a dirblock is removed, but there is a record inside which is already marked as absent.

Fixed in the associated branch.

Changed in bzr:
status: In Progress → Fix Committed
Revision history for this message
John A Meinel (jameinel) wrote :

This is in the next bzr release.

Changed in bzr:
status: Fix Committed → Fix Released
Revision history for this message
Bubba Siggler (bud3) wrote :

  Hi John
    I broke Can't get a install for feisty. The email is on baz is close to
400 At the time I am using the wife win xp. I been downloading feisty daily
alternate. That has alot of bugs. I hope I can get feisty up and running
soon. The only mail I've be reading is what is a little each day.

  IF you got any idea.

   Bubba

On 3/21/07, John A Meinel <email address hidden> wrote:
>
> This is in the next bzr release.
>
> ** Changed in: bzr (upstream)
> Status: Fix Committed => Fix Released
>
> --
> AssertionError in dirstate.py when committing with bzr 0.15.0candidate2
> https://launchpad.net/bugs/93681
>

--
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.3 (GNU/Linux)

iD8DBQFFkcN7yXWcajQQndYRAgbqAKCMyXN9Jx4g0X7jocg+aUSFz0x4LwCgrURW
eGtqLjpzQVYa9+gzpCRtB84=
=zrpM
-----END PGP SIGNATURE-----

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.