"bzr: ERROR: exceptions.KeyError:" at 'bzr remove'

Bug #615238 reported by Michael Schuster
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Bazaar
Confirmed
High
Unassigned

Bug Description

I committed my recent changes successfully, but they contain some files I used only for testing and which I now want to remove; 'bzr status -SV -r <previous rev.>' says:

+N tests/suite/base/t/select_timeout-mock.lua

when I try to 'bzr remove' this file, I get:

Traceback (most recent call last):
  File "/usr/lib/python2.6/site-packages/bzrlib/commands.py", line 853, in exception_to_return_code
    return the_callable(*args, **kwargs)
  File "/usr/lib/python2.6/site-packages/bzrlib/commands.py", line 1055, in run_bzr
    ret = run(*run_argv)
  File "/usr/lib/python2.6/site-packages/bzrlib/commands.py", line 661, in run_argv_aliases
    return self.run_direct(**all_cmd_args)
  File "/usr/lib/python2.6/site-packages/bzrlib/commands.py", line 665, in run_direct
    return self._operation.run_simple(*args, **kwargs)
  File "/usr/lib/python2.6/site-packages/bzrlib/cleanup.py", line 122, in run_simple
    self.cleanups, self.func, *args, **kwargs)
  File "/usr/lib/python2.6/site-packages/bzrlib/cleanup.py", line 156, in _do_with_cleanups
    result = func(*args, **kwargs)
  File "/usr/lib/python2.6/site-packages/bzrlib/builtins.py", line 1542, in run
    force=file_deletion_strategy=='force')
  File "/usr/lib/python2.6/site-packages/bzrlib/mutabletree.py", line 49, in tree_write_locked
    return unbound(self, *args, **kwargs)
  File "/usr/lib/python2.6/site-packages/bzrlib/workingtree.py", line 2002, in remove
    want_unversioned=True, specific_files=files):
  File "_dirstate_helpers_pyx.pyx", line 1410, in bzrlib._dirstate_helpers_pyx.ProcessEntryC.__next__
  File "_dirstate_helpers_pyx.pyx", line 1522, in bzrlib._dirstate_helpers_pyx.ProcessEntryC._iter_next
  File "_dirstate_helpers_pyx.pyx", line 1223, in bzrlib._dirstate_helpers_pyx.ProcessEntryC._process_entry
  File "/usr/lib/python2.6/site-packages/bzrlib/dirstate.py", line 1970, in _get_entry
    self._get_block_entry_index(dirname, basename, tree_index)
  File "/usr/lib/python2.6/site-packages/bzrlib/dirstate.py", line 1928, in _get_block_entry_index
    block_index, present = self._find_block_index_from_key(key)
  File "/usr/lib/python2.6/site-packages/bzrlib/dirstate.py", line 1203, in _find_block_index_from_key
    cache=self._split_path_cache)
KeyError: 'tests/suite/base/t'

bzr 2.1.1 on python 2.6.4 (Solaris-2.11-i86pc-i386-32bit-ELF)
arguments: ['/bin/bzr', 'remove', 'tests/suite/base/t/select_timeout-mock.lua']
encoding: 'ISO8859-1', fsenc: 'ISO8859-1', lang: None
plugins:
  difftools /home/schuster/.bazaar/plugins/difftools [0.91.0]
  extmerge /home/schuster/.bazaar/plugins/extmerge [unknown]
  gtk /home/schuster/.bazaar/plugins/gtk [0.99.0dev1]
  launchpad /usr/lib/python2.6/site-packages/bzrlib/plugins/launchpad [2.1.1]
  mysql /home/schuster/.bazaar/plugins/mysql [0.4.2]
  netrc_credential_store /usr/lib/python2.6/site-packages/bzrlib/plugins/netrc_credential_store [2.1.1]
  news_merge /usr/lib/python2.6/site-packages/bzrlib/plugins/news_merge [2.1.1]
  qbzr /home/schuster/.bazaar/plugins/qbzr [0.18.5]
  rewrite /home/schuster/.bazaar/plugins/rewrite [0.6.1dev]

*** Bazaar has encountered an internal error. This probably indicates a
    bug in Bazaar. You can help us fix it by filing a bug report at
        https://bugs.launchpad.net/bzr/+filebug
    including this traceback and a description of the problem.

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

I'm not entirely sure what is going on here. It hints that it thinks the files are in a directory which doesn't have a proper entry in the inventory. (so you have a file that exists in a dir that doesn't exist).

Certainly we should figure out what is going on.

In the short term, if you backup your .bzr directory, and then create a new checkout and replaced the .bzr/checkout directory of the old location with the new one, this might be fixed.

Changed in bzr:
importance: Undecided → High
status: New → Confirmed
Revision history for this message
Michael Schuster (schuster) wrote : Re: [Bug 615238] Re: "bzr: ERROR: exceptions.KeyError:" at 'bzr remove'

On 08/13/10 21:06, John A Meinel wrote:
> I'm not entirely sure what is going on here. It hints that it thinks the
> files are in a directory which doesn't have a proper entry in the
> inventory. (so you have a file that exists in a dir that doesn't exist).
>
> Certainly we should figure out what is going on.
>
> In the short term, if you backup your .bzr directory, and then create a
> new checkout and replaced the .bzr/checkout directory of the old
> location with the new one, this might be fixed.

thx - since all I was trying to do was remove a few files I'd added but
then not needed, I also tried "revert", which worked nicely ("shelve"
didn't, btw).

Michael
>
> ** Changed in: bzr
> Importance: Undecided => High
>
> ** Changed in: bzr
> Status: New => Confirmed
>

Jelmer Vernooij (jelmer)
tags: added: dirstate
Jelmer Vernooij (jelmer)
tags: added: check-for-breezy
Jelmer Vernooij (jelmer)
tags: removed: check-for-breezy
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.