IndexError on moving added file

Bug #403322 reported by Jonathan Lange
68
This bug affects 10 people
Affects Status Importance Assigned to Milestone
Bazaar
Fix Released
High
Robert Collins
2.0
Fix Released
High
Robert Collins

Bug Description

$ bzr st
added:
  lib/lp/archiveuploader/permission.py
  lib/lp/archiveuploader/tests/test_permisson.py
unknown:
  lib/lp/archiveuploader/tests/data/suite/bar_1.0-2/bar_1.0.orig.tar.gz
(hardy_chroot)jml@truth:~/src/launchpad/package-permission-love$ bzr mv lib/lp/archiveuploader/tests/test_permisson.py lib/lp/archiveuploader/tests/test_permission.py
bzr: ERROR: exceptions.IndexError: list index out of range

Traceback (most recent call last):

  File "/usr/lib/python2.5/site-packages/bzrlib/builtins.py", line 804, in run
    self._run(tree, names_list, rel_names, after)

  File "/usr/lib/python2.5/site-packages/bzrlib/workingtree_4.py", line 1240, in rename_one
    WorkingTree.rename_one(self, from_rel, to_rel, after)

  File "/usr/lib/python2.5/site-packages/bzrlib/dirstate.py", line 2629, in set_state_from_inventory
    fullscan=True)
  File "/usr/lib/python2.5/site-packages/bzrlib/dirstate.py", line 2797, in update_minimal
    other_key = list(existing_keys)[0]
IndexError: list index out of range

bzr 1.18dev on python 2.5.2 (linux2)
arguments: ['/usr/bin/bzr', 'mv', 'lib/lp/archiveuploader/tests/test_permisson.py', 'lib/lp/archiveuploader/tests/test_permission.py']

Tags: dirstate

Related branches

Revision history for this message
Robert Collins (lifeless) wrote : Re: [Bug 403322] [NEW] IndexError on moving added file

 tag dirstate
 importance high

Changed in bzr:
importance: Undecided → High
Martin Pool (mbp)
Changed in bzr:
status: New → Confirmed
Revision history for this message
Martin Pool (mbp) wrote :

Maybe this was fixed by recent delta application changes?

Revision history for this message
Robert Collins (lifeless) wrote :

I don't have any reason to think so.

Revision history for this message
Robert Collins (lifeless) wrote :

This uses set_state_from_inventory which is slow. And apparently still buggy.

I suggest we fix it by changing to apply_inventory_delta.

description: updated
Revision history for this message
Robert Collins (lifeless) wrote :

There is only one call to set state from inventory outside dirstate, so this is quite within reach if we're willing to move the delta generation code out of dirstate (by patching into write_inventory).

jml - can you tell use the revid you found this problem on?

Revision history for this message
Robert Collins (lifeless) wrote :

jml, please try to reproduce with my branch.

Revision history for this message
Robert Collins (lifeless) wrote :

from fullermd in the dup bug - and fixed by my branch.

This isn't actually 'renaming it back', it's another ordering issue. Naming to a lexically earlier name is what fails.

Example reproduction script (tested on bzr.dev and 1.18):

#!/bin/sh -x
bzr="/usr/local/bin/bzr --no-plugins --no-aliases"

${bzr} init A
(
 # Setup
 cd A ;
 ${bzr} mkdir a ;
 ${bzr} ci -m '1' ;

 # Add it
 ${bzr} mkdir a/b ;

 # Both work
 ${bzr} mv a/b a/c ;
 ${bzr} mv a/c a/d ;

 # This fails
 ${bzr} mv a/d a/a ;

 # Show that we lost it.
 ${bzr} stat
)

Changed in bzr:
status: Confirmed → Fix Committed
assignee: nobody → Robert Collins (lifeless)
Andrew Bennetts (spiv)
Changed in bzr:
status: Fix Committed → Fix Released
John A Meinel (jameinel)
Changed in bzr:
milestone: none → 2.1.0b1
Revision history for this message
Emilien Klein (emilien-klein) wrote :

I've experienced the same bug (this bug is marked as "fix released", so it might be fixed in a newer version, I'm "still" using the default version for Ubuntu 9.10)

I tried to rename a file that I had just added to bzr, but not yet committed. I've attached the crash report.

emilien@tesla:~/devel/issuetrackertracker$ bzr status
added:
  conf/
  conf/__init__.py
  conf/locale/
  conf/locale/fr/
  conf/locale/fr/LC_MESSAGES/
  conf/locale/fr/LC_MESSAGES/django.po
  conf/settings.py
  i18n-tasks
  simplecookie.py
modified:
  .bzrignore
  issuetrackertracker.py
  templates/my-issues.html
emilien@tesla:~/devel/issuetrackertracker$ bzr mv i18n-tasks README-I18N
bzr: ERROR: exceptions.IndexError: list index out of range

*** 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
    attaching the crash file
        /home/emilien/.cache/crash/bzr-20091228153228-6932.crash
    and including a description of the problem.

    The crash file is plain text and you can inspect or edit it to remove
    private information.
emilien@tesla:~/devel/issuetrackertracker$

Revision history for this message
Matt Nordhoff (mnordhoff) wrote : Re: [Bug 403322] Re: IndexError on moving added file

Emilien Klein wrote:
> I've experienced the same bug (this bug is marked as "fix released", so
> it might be fixed in a newer version, I'm "still" using the default
> version for Ubuntu 9.10)
>
> I tried to rename a file that I had just added to bzr, but not yet
> committed. I've attached the crash report.

The bug is targeted to 2.0.1 and 2.1.0b1, while you're using 2.0.0.

Upgrading would presumably fix it for you. You could use the PPA:

<https://launchpad.net/~bzr/+archive/ppa>
--
Matt Nordhoff

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Bug attachments

Remote bug watches

Bug watches keep track of this bug in other bug trackers.