AttributeError KnitVersionedFiles.filename when branching stacked branches from hpss

Bug #270738 reported by Jonathan Lange
2
Affects Status Importance Assigned to Milestone
Bazaar
Confirmed
Medium
Unassigned

Bug Description

When making a standalone branch from a stacked branch across the smart server, the following error is raised:

bzr: ERROR: exceptions.AttributeError: 'KnitVersionedFiles' object has no attribute 'filename'

Traceback (most recent call last):
  File "/home/jml/Code/Bazaar/bzr.dev-2.5/bzrlib/commands.py", line 857, in run_bzr_catch_errors
    return run_bzr(argv)
  File "/home/jml/Code/Bazaar/bzr.dev-2.5/bzrlib/commands.py", line 797, in run_bzr
    ret = run(*run_argv)
  File "/home/jml/Code/Bazaar/bzr.dev-2.5/bzrlib/commands.py", line 499, in run_argv_aliases
    return self.run(**all_cmd_args)
  File "/home/jml/Code/Bazaar/bzr.dev-2.5/bzrlib/builtins.py", line 879, in run
    hardlink=hardlink, stacked=stacked)
  File "/home/jml/Code/Bazaar/bzr.dev-2.5/bzrlib/bzrdir.py", line 1117, in sprout
    result_repo.fetch(source_repository, revision_id=revision_id)
  File "/home/jml/Code/Bazaar/bzr.dev-2.5/bzrlib/repository.py", line 981, in fetch
    find_ghosts=find_ghosts)
  File "/home/jml/Code/Bazaar/bzr.dev-2.5/bzrlib/repository.py", line 3075, in fetch
    find_ghosts=find_ghosts)
  File "/home/jml/Code/Bazaar/bzr.dev-2.5/bzrlib/decorators.py", line 192, in write_locked
    result = unbound(self, *args, **kwargs)
  File "/home/jml/Code/Bazaar/bzr.dev-2.5/bzrlib/repository.py", line 2763, in fetch
    pb, find_ghosts)
  File "/home/jml/Code/Bazaar/bzr.dev-2.5/bzrlib/fetch.py", line 110, in __init__
    self.__fetch()
  File "/home/jml/Code/Bazaar/bzr.dev-2.5/bzrlib/fetch.py", line 140, in __fetch
    self._fetch_everything_for_search(search, pp)
  File "/home/jml/Code/Bazaar/bzr.dev-2.5/bzrlib/fetch.py", line 166, in _fetch_everything_for_search
    for knit_kind, file_id, revisions in data_to_fetch:
  File "/home/jml/Code/Bazaar/bzr.dev-2.5/bzrlib/repository.py", line 1493, in item_keys_introduced_by
    file_ids = self.fileids_altered_by_revision_ids(revision_ids, inv_w)
  File "/home/jml/Code/Bazaar/bzr.dev-2.5/bzrlib/repository.py", line 1337, in fileids_altered_by_revision_ids
    selected_keys)
  File "/home/jml/Code/Bazaar/bzr.dev-2.5/bzrlib/repository.py", line 1313, in _find_file_ids_from_xml_inventory_lines
    line_iterator).iterkeys():
  File "/home/jml/Code/Bazaar/bzr.dev-2.5/bzrlib/repository.py", line 1253, in _find_text_key_references_from_xml_inventory_lines
    for line, line_key in line_iterator:
  File "/home/jml/Code/Bazaar/bzr.dev-2.5/bzrlib/knit.py", line 1430, in iter_lines_added_or_present_in_keys
    raise RevisionNotPresent(keys, self.filename)
AttributeError: 'KnitVersionedFiles' object has no attribute 'filename'

This doesn't seem to happen for all branches, as this example shows:

$ mkdir /tmp/stacked-bug
$ cd /tmp/stacked-bug
$ bzr init --1.6 a
Standalone tree (format: 1.6)
Location:
  branch root: a
$ bzr branch --stacked a b
Created new stacked branch referring to file:///tmp/stacked-bug/a/.
$ bzr branch bzr+ssh://localhost/tmp/stacked-bug/b c
Branched 0 revision(s).

Revision history for this message
Jonathan Lange (jml) wrote :

This will do it though.

$ bzr branch lp:pqm a
Branched 183 revision(s).
$ bzr upgrade --1.6 a
...
$ bzr branch --stacked a b
Created new stacked branch referring to file:///tmp/stacked-bug/a/.
jml@rhino:/tmp/stacked-bug$ bzr branch bzr+ssh://localhost/tmp/stacked-bug/b c
bzr: ERROR: exceptions.AttributeError: 'KnitVersionedFiles' object has no attribute 'filename'

Changed in bzr:
assignee: nobody → mbp
importance: Undecided → Critical
Revision history for this message
Martin Pool (mbp) wrote :

I can't reproduce this error with the script from comment 1 using the current bzr of 1.7.

Revision history for this message
Jonathan Lange (jml) wrote :

With trunk I get:
jml@rhino:/tmp$ bzr version
Bazaar (bzr) 1.8dev
  from bzr checkout /home/jml/Code/Bazaar/bzr.dev-2.5
    revision: 3709
    revid: <email address hidden>
    branch nick: bzr.dev
  Python interpreter: /usr/bin/python 2.5.2
  Python standard library: /usr/lib/python2.5
  bzrlib: /home/jml/Code/Bazaar/bzr.dev-2.5/bzrlib
  Bazaar configuration: /home/jml/.bazaar
  Bazaar log file: /home/jml/.bzr.log

Copyright 2005, 2006, 2007, 2008 Canonical Ltd.
http://bazaar-vcs.org/

bzr comes with ABSOLUTELY NO WARRANTY. bzr is free software, and
you may use, modify and redistribute it under the terms of the GNU
General Public License version 2 or later.

jml@rhino:/tmp$ bzr branch lp:pqm a
Branched 183 revision(s).
jml@rhino:/tmp$ bzr upgrade --1.6 a
...
jml@rhino:/tmp$ bzr branch --stacked a b
Created new stacked branch referring to file:///tmp/a/.
jml@rhino:/tmp$ bzr branch bzr+ssh://localhost/tmp/b c
bzr: ERROR: Could not install revisions:
<email address hidden>

The error in the original post is from trunk patched with the fix for bug 261315.

Revision history for this message
Martin Pool (mbp) wrote :

OK, with those instructions I can reproduce it. I'll look at it more tomorrow.

I get

mbp@grace% ~/bzr/270738-stacking/bzr -Dhpss branch bzr+ssh://localhost/home/mbp/tmp/270738/b c
bzr: ERROR: Revision {set([('Arch-1:<email address hidden>%tla-pqm--mainline--0.1--patch-10',), ('Arch-1:<email address hidden>%arch-pqm--main--0--base-0',), ('Arch-1:<email address hidden>%tla-pqm--mainline--0.1--patch-1',), ('Arch-1:<email address hidden>%tla-pqm--mainline--0.2--base-0',), ('Arch-1:<email address hidden>%arch-pqm--main--0--base-0',), ('Arch-1:<email address hidden>%arch-pqm--main--0--patch-1',), ('Arch-1:<email address hidden>%tla-pqm--mainline--0.3--base-0',)])} not present in "KnitVersionedFiles(_KnitGraphIndex(CombinedGraphIndex()), <bzrlib.knit._DirectPackAccess object at 0xa11108c>)".
zsh: exit 3 ~/bzr/270738-stacking/bzr -Dhpss branch c

I wonder if this is related to the baz ghost-filling problem recently encountered in casper.

If this is specific to baz-converted branches I think it does not need to block 1.7.

Vincent Ladeuil (vila)
Changed in bzr:
status: New → Triaged
Revision history for this message
Martin Pool (mbp) wrote :

Robert suggests it is an additional bug/facet if pull fails but check is not failing.

Revision history for this message
Martin Pool (mbp) wrote :

I can't reproduce this when applying the same method to bzr-usertest, so I suspect this may be the same problem as in bug 246880. Robert suggests we should change 'bzr check' to flag this error, so I'm going to try writing that check and see if it traps on pqm.

Revision history for this message
Martin Pool (mbp) wrote :

Bumping because it's not being treated as critical, and doesn't seem to recur often

summary: - AttributeError when branching stacked branches
+ AttributeError KnitVersionedFiles.filename when branching stacked
+ branches from hpss
Changed in bzr:
importance: Critical → Medium
Martin Pool (mbp)
Changed in bzr:
status: Triaged → Confirmed
Jelmer Vernooij (jelmer)
tags: added: knits
Martin Pool (mbp)
Changed in bzr:
assignee: Martin Pool (mbp) → nobody
Jelmer Vernooij (jelmer)
tags: added: 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.