"AssertionError: '...' is not a valid path" with moved directory in history

Bug #229410 reported by Wesley J. Landaker
2
Affects Status Importance Assigned to Milestone
Bazaar Subversion Plugin
Fix Released
Low
Jelmer Vernooij

Bug Description

I have a lot of bzr-svn lightweight checkouts, which are essentially SVN working copies. Most of them are working fine with the latest bzr-svn, but there is one that doesn't work at all when I try to do an update, and in fact, fails even when I try to just do "bzr info":

$ cd .../combo_fpga_src
$ bzr info
bzr: ERROR: exceptions.AssertionError: 'combo_fpga/src' is not a valid path

Traceback (most recent call last):
  File "/usr/lib/python2.5/site-packages/bzrlib/commands.py", line 846, in run_bzr_catch_errors
    return run_bzr(argv)
  File "/usr/lib/python2.5/site-packages/bzrlib/commands.py", line 802, in run_bzr
    ret = run(*run_argv)
  File "/usr/lib/python2.5/site-packages/bzrlib/commands.py", line 504, in run_argv_aliases
    return self.run(**all_cmd_args)
  File "/usr/lib/python2.5/site-packages/bzrlib/commands.py", line 812, in ignore_pipe
    result = func(*args, **kwargs)
  File "/usr/lib/python2.5/site-packages/bzrlib/builtins.py", line 1144, in run
    verbose=noise_level, outfile=self.outf)
  File "/usr/lib/python2.5/site-packages/bzrlib/info.py", line 317, in show_bzrdir_info
    recommend_upgrade=False)
  File "/home/wjlanda/.bazaar/plugins/svn/workingtree.py", line 741, in open_workingtree
    return SvnWorkingTree(self, self.local_path, self.open_branch())
  File "/home/wjlanda/.bazaar/plugins/svn/workingtree.py", line 88, in __init__
    self.base_tree = SvnBasisTree(self)
  File "/home/wjlanda/.bazaar/plugins/svn/tree.py", line 275, in __init__
    workingtree.branch.mapping)
  File "/home/wjlanda/.bazaar/plugins/svn/repository.py", line 286, in get_fileid_map
    return self.fileid_map.get_map(self.uuid, revnum, path, mapping)
  File "/home/wjlanda/.bazaar/plugins/svn/fileids.py", line 227, in get_map
    for revmeta in self.repos.iter_reverse_branch_changes(branch, revnum, mapping):
  File "/home/wjlanda/.bazaar/plugins/svn/repository.py", line 621, in iter_reverse_branch_changes
    for (bp, paths, revnum, revprops) in history_iter:
  File "/home/wjlanda/.bazaar/plugins/svn/repository.py", line 594, in iter_changes
    assert mapping is None or mapping.is_branch(bp) or mapping.is_tag(bp), "%r is not a valid path" % bp
AssertionError: 'combo_fpga/src' is not a valid path

bzr 1.4 on python 2.5.2 (linux2)
arguments: ['/usr/bin/bzr', 'info']
encoding: 'UTF-8', fsenc: 'UTF-8', lang: 'en_US.UTF-8'
plugins:
  bisect /home/wjlanda/.bazaar/plugins/bisect [1.1.0pre0]
  bzrtools /usr/lib/python2.5/site-packages/bzrlib/plugins/bzrtools [1.4.0]
  cvsps /home/wjlanda/.bazaar/plugins/cvsps [unknown]
  gtk /usr/lib/python2.5/site-packages/bzrlib/plugins/gtk [0.93.0]
  launchpad /usr/lib/python2.5/site-packages/bzrlib/plugins/launchpad [unknown]
  loom /home/wjlanda/.bazaar/plugins/loom [1.4.0dev0]
  rebase /home/wjlanda/.bazaar/plugins/rebase [0.3.0]
  stats /home/wjlanda/.bazaar/plugins/stats [unknown]
  svn /home/wjlanda/.bazaar/plugins/svn [0.4.11dev0]
*** 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.
$ svn info
Path: .
URL: https://.../combo_board/fpga/combo_fpga/src
Repository Root: https://.../combo_board
Repository UUID: 5f0b351c-ae82-3948-9ce8-fa6e1d16e4f9
Revision: 1079
Node Kind: directory
Schedule: normal
Last Changed Author: ...
Last Changed Rev: 1075
Last Changed Date: 2008-05-06 10:22:16 -0600 (Tue, 06 May 2008)
$ svn up
At revision 1083.

I'm not even able to delete the directory and recheck it out:
$ bzr co --lightweight https://.../combo_board/fpga/combo_fpga/src combo_fpga_src
bzr: ERROR: Invalid http response for https://.../combo_board/fpga/combo_fpga/src/.bzr/branch-format: Unable to handle http code 401: expected 200 or 404 for full response.

Of course, it checks out fine with "svn co"

Again, I'm doing this for lots of other repositories and working copies with the same exact software, so there has got to be some corner case here.

Related branches

Revision history for this message
Wesley J. Landaker (wjl) wrote :

I should mention, I even have other checkouts of the *same repository*, just different paths, and they are all working fine.

Revision history for this message
Wesley J. Landaker (wjl) wrote : Re: "AssertionError: '...' is not a valid path" in lightweight bzr-svn checkout

Just trying to debug this, I added some print statements before the assert where it is failing, e.g.:

print "mapping.is_branch(bp) =", mapping.is_branch(bp)
print "mapping.is_tag(bp) =", mapping.is_tag(bp)
print "mapping =", mapping
print "bp =", bp
assert mapping is None or mapping.is_branch(bp) or mapping.is_tag(bp), "%r is not a valid path" % bp

When I run "bzr info" and see it crash, what I get is tons of lines of output, the last one is interesting:

mapping.is_branch(bp) = True
mapping.is_tag(bp) = False
mapping = BzrSvnMappingv3FileProps(SingleBranchingScheme('fpga/combo_fpga/src'))
bp = fpga/combo_fpga/src
mapping.is_branch(bp) = True
mapping.is_tag(bp) = False
mapping = BzrSvnMappingv3FileProps(SingleBranchingScheme('fpga/combo_fpga/src'))
bp = fpga/combo_fpga/src
mapping.is_branch(bp) = True
mapping.is_tag(bp) = False
mapping = BzrSvnMappingv3FileProps(SingleBranchingScheme('fpga/combo_fpga/src'))
bp = fpga/combo_fpga/src
mapping.is_branch(bp) = True
mapping.is_tag(bp) = False
mapping = BzrSvnMappingv3FileProps(SingleBranchingScheme('fpga/combo_fpga/src'))
bp = fpga/combo_fpga/src
mapping.is_branch(bp) = True
mapping.is_tag(bp) = False
mapping = BzrSvnMappingv3FileProps(SingleBranchingScheme('fpga/combo_fpga/src'))
bp = fpga/combo_fpga/src
mapping.is_branch(bp) = False
mapping.is_tag(bp) = False
mapping = BzrSvnMappingv3FileProps(SingleBranchingScheme('fpga/combo_fpga/src'))
bp = combo_fpga/src
bzr: ERROR: exceptions.AssertionError: 'combo_fpga/src' is not a valid path

Notice that the branch path is "fpga/combo_fpga/src" (correct) every time, except the last time it's just "combo_fpga/src" which is not a correct path in the repository. I have no idea where this is coming from.

If the reason for this error isn't obvious to you, please let me know what I can do to help debug it more.

Revision history for this message
Wesley J. Landaker (wjl) wrote :

Okay, more info. I added prints to show the "paths" and "revnum" variable, and I see this:

mapping.is_branch(bp) = True
mapping.is_tag(bp) = False
mapping = BzrSvnMappingv3FileProps(SingleBranchingScheme('fpga/combo_fpga/src'))
bp = fpga/combo_fpga/src
paths = {'fpga/combo_fpga': (u'A', 'combo_fpga', 127), 'combo_fpga': (u'D', None, -1)}
revnum = 128
mapping.is_branch(bp) = False
mapping.is_tag(bp) = False
mapping = BzrSvnMappingv3FileProps(SingleBranchingScheme('fpga/combo_fpga/src'))
bp = combo_fpga/src
paths = {'fpga/combo_fpga': (u'D', None, -1), 'combo_fpga': (u'A', 'fpga/combo_fpga', 126)}
revnum = 127
bzr: ERROR: exceptions.AssertionError: 'combo_fpga/src' is not a valid path

And with svn log -v -r127, I see:

$ svn log -v -r127
------------------------------------------------------------------------
r127 | ... | 2007-07-20 09:11:37 -0600 (Fri, 20 Jul 2007) | 1 line
Changed paths:
   A /combo_fpga (from /fpga/combo_fpga:126)
   D /fpga/combo_fpga

Moved remotely
------------------------------------------------------------------------

This may have something to do with what happened next, where the move was reverted, and so it isn't a valid path anymore:

$ svn log -v -r128
------------------------------------------------------------------------
r128 | ... | 2007-07-20 09:12:11 -0600 (Fri, 20 Jul 2007) | 1 line
Changed paths:
   D /combo_fpga
   A /fpga/combo_fpga (from /combo_fpga:127)

Moved remotely
------------------------------------------------------------------------

So it's dying on that directory move somehow.

I don't know how to fix this, but I hope this info helps! Let me know if I can give you more info.

Revision history for this message
Jelmer Vernooij (jelmer) wrote : Re: [Bug 229410] Re: "AssertionError: '...' is not a valid path" with moved directory in history

  status fixcommitted
--
Jelmer Vernooij <email address hidden> - http://samba.org/~jelmer/
Jabber: <email address hidden>

Changed in bzr-svn:
status: New → Fix Committed
Revision history for this message
Wesley J. Landaker (wjl) wrote :

I can confirm that it does work after pulling your fix. Thanks!

Jelmer Vernooij (jelmer)
Changed in bzr-svn:
assignee: nobody → jelmer
milestone: none → 0.4.11
Jelmer Vernooij (jelmer)
Changed in bzr-svn:
importance: Undecided → Low
Jelmer Vernooij (jelmer)
Changed in bzr-svn:
status: Fix Committed → Fix Released
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.