bzrlib.errors.InvalidEntryName when resolving path conflict

Bug #660935 reported by dmuir
50
This bug affects 7 people
Affects Status Importance Assigned to Milestone
Bazaar
Fix Released
High
Vincent Ladeuil
2.2
Fix Released
High
Vincent Ladeuil
2.3
Fix Released
High
Vincent Ladeuil
bzr (Ubuntu)
Fix Released
Undecided
Unassigned
Maverick
Fix Released
Undecided
Unassigned

Bug Description

I had the following conflict:
Path conflict: path1/file / path2/file

I tried resolving by:
`bzr resolve path2/file --take-this`

which gave me
bzr: ERROR: bzrlib.errors.InvalidEntryName: Invalid entry name: path1/file

I also tried:
`bzr resolve --take-this`
which gave me the same result

Crash file is attached.

Traceback:
   File "/usr/lib/python2.6/dist-packages/bzrlib/commands.py", line 912, in exception_to_return_code
     return the_callable(*args, **kwargs)
   File "/usr/lib/python2.6/dist-packages/bzrlib/commands.py", line 1112, in run_bzr
     ret = run(*run_argv)
   File "/usr/lib/python2.6/dist-packages/bzrlib/commands.py", line 690, in run_argv_aliases
     return self.run(**all_cmd_args)
   File "/usr/lib/python2.6/dist-packages/bzrlib/commands.py", line 705, in run
     return self._operation.run_simple(*args, **kwargs)
   File "/usr/lib/python2.6/dist-packages/bzrlib/cleanup.py", line 135, in run_simple
     self.cleanups, self.func, *args, **kwargs)
   File "/usr/lib/python2.6/dist-packages/bzrlib/cleanup.py", line 165, in _do_with_cleanups
     result = func(*args, **kwargs)
   File "/usr/lib/python2.6/dist-packages/bzrlib/conflicts.py", line 160, in run
     resolve(tree, file_list, action=action)
   File "/usr/lib/python2.6/dist-packages/bzrlib/conflicts.py", line 189, in resolve
     conflict._do(action, tree)
   File "/usr/lib/python2.6/dist-packages/bzrlib/conflicts.py", line 415, in _do
     meth(tree)
   File "/usr/lib/python2.6/dist-packages/bzrlib/conflicts.py", line 537, in action_take_this
     winner='this')
   File "/usr/lib/python2.6/dist-packages/bzrlib/conflicts.py", line 444, in _resolve_with_cleanups
     op.run_simple(tt, *args, **kwargs)
   File "/usr/lib/python2.6/dist-packages/bzrlib/cleanup.py", line 135, in run_simple
     self.cleanups, self.func, *args, **kwargs)
   File "/usr/lib/python2.6/dist-packages/bzrlib/cleanup.py", line 165, in _do_with_cleanups
     result = func(*args, **kwargs)
   File "/usr/lib/python2.6/dist-packages/bzrlib/conflicts.py", line 508, in _resolve
     tt.apply()
   File "/usr/lib/python2.6/dist-packages/bzrlib/transform.py", line 1549, in apply
     inventory_delta = self._generate_inventory_delta()
   File "/usr/lib/python2.6/dist-packages/bzrlib/transform.py", line 1625, in _generate_inventory_delta
     parent_file_id, file_id)
   File "/usr/lib/python2.6/dist-packages/bzrlib/inventory.py", line 2317, in make_entry
     return factory(file_id, name, parent_id)
   File "/usr/lib/python2.6/dist-packages/bzrlib/inventory.py", line 537, in __init__
     super(InventoryFile, self).__init__(file_id, name, parent_id)
   File "/usr/lib/python2.6/dist-packages/bzrlib/inventory.py", line 216, in __init__
     raise errors.InvalidEntryName(name=name)
 InvalidEntryName: Invalid entry name: application/views/scripts/student/partial_modify_interviews_section.phtml

BzrVersion: 2.2.1

Related branches

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

I know Vincent has been fixing bugs in this area recently, hopefully he can fix this one for you too. (Or maybe he already has?)

tags: added: conflicts resolve
description: updated
Changed in bzr:
importance: Undecided → High
status: New → Confirmed
Revision history for this message
Vincent Ladeuil (vila) wrote :

This kind of bug is etremely hard to diagnose without a reproducing recipe.

Could you provide more info about what happened to 'file' in both branches ?

Revision history for this message
dmuir (dmuir) wrote :

hmm, can't quite remember what I had done...
I'll see if I can reproduce.

Revision history for this message
Seth Purcell (seth-purcell) wrote :
Download full text (3.3 KiB)

I got this bug after the following:

1. I modified a file in a feature branch
2. Another developer deleted the file in his own feature branch and merged into trunk
3. I pulled from the master trunk to my local mirror of trunk, getting his changes (fine)
4. I merged from my local trunk into my feature branch (conflict)
5. I tried bzr resolve --take-other and got a crash report (below)

I'm a new user so I'm probably just doing something stupid, but I thought I'd see if there was a bug report pertaining to this, and there was.

Hope this helps!

C:\feature-branch> bzr resolve --take-other
bzr: ERROR: bzrlib.errors.InvalidEntryName: Invalid entry name: src/test/library
/SKS/Model/GenericModelTest.php

Traceback (most recent call last):
  File "bzrlib\commands.pyo", line 911, in exception_to_return_code
  File "bzrlib\commands.pyo", line 1111, in run_bzr
  File "bzrlib\commands.pyo", line 689, in run_argv_aliases
  File "bzrlib\commands.pyo", line 704, in run
  File "bzrlib\cleanup.pyo", line 135, in run_simple
  File "bzrlib\cleanup.pyo", line 165, in _do_with_cleanups
  File "bzrlib\conflicts.pyo", line 160, in run
  File "bzrlib\conflicts.pyo", line 189, in resolve
  File "bzrlib\conflicts.pyo", line 415, in _do
  File "bzrlib\conflicts.pyo", line 600, in action_take_other
  File "bzrlib\conflicts.pyo", line 444, in _resolve_with_cleanups
  File "bzrlib\cleanup.pyo", line 135, in run_simple
  File "bzrlib\cleanup.pyo", line 165, in _do_with_cleanups
  File "bzrlib\conflicts.pyo", line 594, in _resolve
  File "bzrlib\transform.pyo", line 1549, in apply
  File "bzrlib\transform.pyo", line 1625, in _generate_inventory_delta
  File "bzrlib\inventory.pyo", line 2320, in make_entry
  File "bzrlib\inventory.pyo", line 537, in __init__
  File "bzrlib\inventory.pyo", line 216, in __init__
InvalidEntryName: Invalid entry name: src/test/library/SKS/Model/GenericModelTes
t.php

bzr 2.2.0 on python 2.6.4 (Windows-XP-5.1.2600-SP3)
arguments: ['bzr', 'resolve', '--take-other']
encoding: 'cp1252', fsenc: 'mbcs', lang: None
plugins:
  bzrp4 C:\Program Files\Bazaar\plugins\bzrp4 [unknown]
  bzrtools C:\Program Files\Bazaar\plugins\bzrtools [2.2.0]
  colo C:\Program Files\Bazaar\plugins\colo [0.1.0]
  explorer C:\Program Files\Bazaar\plugins\explorer [1.1b1]
  fastimport C:\Program Files\Bazaar\plugins\fastimport [0.9.0dev]
  launchpad C:\Program Files\Bazaar\plugins\launchpad [2.2.0]
  loom C:\Program Files\Bazaar\plugins\loom [2.2.1dev]
  netrc_credential_store C:\Program Files\Bazaar\plugins\netrc_credential_store
[2.2.0]
  news_merge C:\Program Files\Bazaar\plugins\news_merge [2.2.0]
  pipeline C:\Program Files\Bazaar\plugins\pipeline [unknown]
  qbzr C:\Program Files\Bazaar\plugins\qbzr [0.19.0]
  rewrite C:\Program Files\Bazaar\plugins\rewrite [0.6.0]
  svn C:\Program Files\Bazaar\plugins\svn [1.0.3]
  upload C:\Program Files\Bazaar\plugins\upload [1.0.0dev]
  xmloutput C:\Program Files\Bazaar\plugins\xmloutput [0.8.6]

*** Bazaar has encountered an internal error. This pro...

Read more...

Revision history for this message
Vincent Ladeuil (vila) wrote :

Using the following shell-like script, I can't reproduce the problem with neither bzr-2.2.0 nor 2.2.1:

$ bzr init trunk
Created a standalone tree (format: 2a)
$ cd trunk
$ echo trunk > file
$ bzr add
adding file
$ bzr commit -m 'create file on trunk'
2>Committing to: .../trunk/
2>added file
2>Committed revision 1.
$ cd ..
$ bzr branch trunk featureA
2>Branched 1 revision(s).
$ cd featureA
$ echo featureA > file
$ bzr commit -m 'modify file for featureA'
2>Committing to: .../featureA/
2>modified file
2>Committed revision 2.
$ cd ..
$ cd trunk
$ bzr rm file
2>deleted file
$ bzr commit -m 'Delete file'
2>Committing to: .../trunk/
2>deleted file
2>Committed revision 2.
$ cd ../featureA
$ bzr merge ../trunk
2>RM file => file.THIS
2>Contents conflict in file
2>1 conflicts encountered.
$ bzr conflicts
Contents conflict in file
$ bzr resolve --take-other

I realize you can't use it directly (it's available with bzr-2.3b3 though), but it should reproduce what you described (minus the local trunk part that I simplified).

May be you can tweak it to make it fail in your case ?

Changed in bzr:
assignee: nobody → Vincent Ladeuil (vila)
Vincent Ladeuil (vila)
Changed in bzr:
assignee: Vincent Ladeuil (vila) → nobody
status: Confirmed → Incomplete
Revision history for this message
Glenn Morris (rgm+lp) wrote :
Download full text (4.4 KiB)

I have what looks like the same problem. The key to reproducing it seems to be subdirectories.
The following example crashes bzr 2.2.2 for me on Debian testing and RHEL 5.5:

mkdir test1
cd test1
mkdir src
touch 1 src/unexalpha.c
bzr init
bzr add
bzr commit -m "commit1"
cd ../
bzr branch test1 test2
cd test2
echo "test2" >> src/unexalpha.c
bzr commit -m "change"
cd ../test1
bzr remove src/unexalpha.c
bzr commit -m "remove"
bzr merge ../test2
bzr resolve src/unexalpha.c --take-this

If "unexalpha.c" is in the top-level directory, not src/, it works fine.

bzr: ERROR: bzrlib.errors.InvalidEntryName: Invalid entry name: src/unexalpha.c

Traceback (most recent call last):
  File "/usr/local/lib/python2.6/dist-packages/bzrlib/commands.py", line 912, in exception_to_return_code
    return the_callable(*args, **kwargs)
  File "/usr/local/lib/python2.6/dist-packages/bzrlib/commands.py", line 1112, in run_bzr
    ret = run(*run_argv)
  File "/usr/local/lib/python2.6/dist-packages/bzrlib/commands.py", line 690, in run_argv_aliases
    return self.run(**all_cmd_args)
  File "/usr/local/lib/python2.6/dist-packages/bzrlib/commands.py", line 705, in run
    return self._operation.run_simple(*args, **kwargs)
  File "/usr/local/lib/python2.6/dist-packages/bzrlib/cleanup.py", line 135, in run_simple
    self.cleanups, self.func, *args, **kwargs)
  File "/usr/local/lib/python2.6/dist-packages/bzrlib/cleanup.py", line 165, in _do_with_cleanups
    result = func(*args, **kwargs)
  File "/usr/local/lib/python2.6/dist-packages/bzrlib/conflicts.py", line 160, in run
    resolve(tree, file_list, action=action)
  File "/usr/local/lib/python2.6/dist-packages/bzrlib/conflicts.py", line 189, in resolve
    conflict._do(action, tree)
  File "/usr/local/lib/python2.6/dist-packages/bzrlib/conflicts.py", line 415, in _do
    meth(tree)
  File "/usr/local/lib/python2.6/dist-packages/bzrlib/conflicts.py", line 597, in action_take_this
    self._resolve_with_cleanups(tree, 'OTHER')
  File "/usr/local/lib/python2.6/dist-packages/bzrlib/conflicts.py", line 444, in _resolve_with_cleanups
    op.run_simple(tt, *args, **kwargs)
  File "/usr/local/lib/python2.6/dist-packages/bzrlib/cleanup.py", line 135, in run_simple
    self.cleanups, self.func, *args, **kwargs)
  File "/usr/local/lib/python2.6/dist-packages/bzrlib/cleanup.py", line 165, in _do_with_cleanups
    result = func(*args, **kwargs)
  File "/usr/local/lib/python2.6/dist-packages/bzrlib/conflicts.py", line 594, in _resolve
    tt.apply()
  File "/usr/local/lib/python2.6/dist-packages/bzrlib/transform.py", line 1554, in apply
    inventory_delta = self._generate_inventory_delta()
  File "/usr/local/lib/python2.6/dist-packages/bzrlib/transform.py", line 1630, in _generate_inventory_delta
    parent_file_id, file_id)
  File "/usr/local/lib/python2.6/dist-packages/bzrlib/inventory.py", line 2317, in make_entry
    return factory(file_id, name, parent_id)
  File "/usr/local/lib/python2.6/dist-packages/bzrlib/inventory.py", line 537, in __init__
    super(InventoryFile, self).__init__(file_id, name, parent_id)
  File "/usr/local/lib/python2.6/dist-packages/bzrlib/inventory.py", line 216, in __init__
    raise errors.InvalidEn...

Read more...

Revision history for this message
Gordon Tyler (doxxx) wrote :

Confirmed with bzr 2.2.1 on Windows 7 using Glenn's recipe.

Changed in bzr:
status: Incomplete → Confirmed
Vincent Ladeuil (vila)
Changed in bzr:
assignee: nobody → Vincent Ladeuil (vila)
Revision history for this message
Glenn Morris (rgm+lp) wrote :

In the meantime, can I get the desired result by doing:

bzr revert src/unexalpha.c.OTHER
rm src/unexalpha.c.BASE
bzr resolve src/unexalpha.c

? It seems to produce the right end state, but I'd like to check before I start using it...

Vincent Ladeuil (vila)
Changed in bzr:
status: Confirmed → In Progress
Revision history for this message
Vincent Ladeuil (vila) wrote :

@Glen: yes, for your specific case, it should work.

And for the good news: I have a fix in the associated branch.

Vincent Ladeuil (vila)
Changed in bzr:
milestone: none → 2.4b1
status: In Progress → Fix Released
Jelmer Vernooij (jelmer)
Changed in bzr (Ubuntu):
status: New → Fix Released
Revision history for this message
Colin Watson (cjwatson) wrote : Please test proposed package

Accepted bzr into maverick-proposed, the package will build now and be available in a few hours. Please test and give feedback here. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation how to enable and use -proposed. Thank you in advance!

Changed in bzr (Ubuntu Maverick):
status: New → Fix Committed
tags: added: verification-needed
Revision history for this message
Martin Pool (mbp) wrote :

SRU Verification:

I ran Glenn's script (thanks for that) on 2.2.4-0ubuntu1 on maverick, and it passed successfully. I also tried with maverick's original 2.2.1-0 and that failed.

verification done.

tags: added: verification-done
removed: verification-needed
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package bzr - 2.2.4-0ubuntu1

---------------
bzr (2.2.4-0ubuntu1) maverick-proposed; urgency=low

  [ Jelmer Vernooij ]
  * Update watch file to use 2.2 series.
  * New upstream release.
   + Fixes closing of leaked sockets to SSH subprocesses, which causes
     dput sftp uploads to hang. LP: #659590
   + Fixes the use of 'lp:' urls behind a http proxy. LP: #558343
   + Correctly sets the Content-Type header when http POSTing to comply
     with stricter web frameworks. LP: #665100
   + Fixes propagating tags to the master branch in a bound branch or
     heavyweight checkout. LP: #603395
   + Fixes the use of 'bzr resolve --take-other' if the file is
     involved in an unresolved text conflict. LP: #646961
   + Fixes https access with newer versions of python2.7. LP: #693880
   + Fixes crash during pack caused by a concurrent repository pack
     operation. LP: #701940
   + Fixes communication with the Launchpad web service when using
     launchpadlib >= 1.5.5. LP: #707075
   + Switches away from deprecated 'edge.launchpad.net' LP: #583667
   + Fixes resolving of content (and path) conflicts for files in subdirs.
     LP: #660935
   + Fixes nasty recursion loop while displaying branch opening error.
     LP: #687653

  [ Martin Pool ]
  * Propose for maverick SRU.
 -- Martin Pool <email address hidden> Thu, 07 Apr 2011 15:30:17 +1000

Changed in bzr (Ubuntu Maverick):
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Bug attachments

Remote bug watches

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