bzr-fastimport crashes on deprecated and removed get_ancestry() method

Bug #1084749 reported by Zygmunt Krynicki on 2012-11-29
This bug affects 5 people
Affects Status Importance Assigned to Milestone
Bazaar Fast Import
bzr-fastimport (Ubuntu)
Andrew Starr-Bochicchio

Bug Description

22:31:14 Updating branch information ...
bzr: ERROR: exceptions.AttributeError: 'CHKInventoryRepository' object has no attribute 'get_ancestry'

Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/bzrlib/", line 930, in exception_to_return_code
    return the_callable(*args, **kwargs)
  File "/usr/lib/python2.7/dist-packages/bzrlib/", line 1141, in run_bzr
    ret = run(*run_argv)
  File "/usr/lib/python2.7/dist-packages/bzrlib/", line 673, in run_argv_aliases
  File "/usr/lib/python2.7/dist-packages/bzrlib/", line 697, in run
    return self._operation.run_simple(*args, **kwargs)
  File "/usr/lib/python2.7/dist-packages/bzrlib/", line 136, in run_simple
    self.cleanups, self.func, *args, **kwargs)
  File "/usr/lib/python2.7/dist-packages/bzrlib/", line 166, in _do_with_cleanups
    result = func(*args, **kwargs)
  File "/usr/lib/python2.7/dist-packages/bzrlib/plugins/fastimport/", line 307, in run
  File "/usr/lib/python2.7/dist-packages/bzrlib/plugins/fastimport/", line 39, in _run
    return proc.process(p.iter_commands)
  File "/usr/lib/python2.7/dist-packages/bzrlib/plugins/fastimport/processors/", line 310, in process
    super(GenericProcessor, self)._process(command_iter)
  File "/usr/lib/python2.7/dist-packages/fastimport/", line 79, in _process
  File "/usr/lib/python2.7/dist-packages/bzrlib/plugins/fastimport/processors/", line 351, in post_process
    branches_updated, branches_lost = updater.update()
  File "/usr/lib/python2.7/dist-packages/bzrlib/plugins/fastimport/", line 61, in update
    if self._update_branch(br, tip):
  File "/usr/lib/python2.7/dist-packages/bzrlib/plugins/fastimport/", line 168, in _update_branch
    ancestry = self.repo.get_ancestry(last_rev_id)
AttributeError: 'CHKInventoryRepository' object has no attribute 'get_ancestry'

bzr 2.6b2 on python 2.7.3 (Linux-3.5.0-18-generic-i686-with-
arguments: ['/usr/bin/bzr', 'fast-import', '-', '/ramdisk/plainbox']
plugins: bash_completion[2.6b2], bzrtools[2.5.0], changelog_merge[2.6b2],
    fastimport[0.13.0], launchpad[2.6b2], netrc_credential_store[2.6b2],
    news_merge[2.6b2], po_merge[2.6b2], rewrite[0.6.4dev], weave_fmt[2.6b2]
encoding: 'utf-8', fsenc: 'UTF-8', lang: 'pl_PL.UTF-8'

*** 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
    including this traceback and a description of the problem.

ProblemType: Bug
DistroRelease: Ubuntu 12.10
Package: bzr-fastimport 0.13.0-2
ProcVersionSignature: Ubuntu 3.5.0-18.29-generic 3.5.7
Uname: Linux 3.5.0-18-generic i686
ApportVersion: 2.6.1-0ubuntu6
Architecture: i386
Date: Thu Nov 29 22:54:10 2012
InstallationDate: Installed on 2012-09-07 (83 days ago)
InstallationMedia: Ubuntu 12.10 "Quantal Quetzal" - Alpha i386 (20120905.2)
MarkForUpload: True
PackageArchitecture: all
 PATH=(custom, no user)
SourcePackage: bzr-fastimport
UpgradeStatus: No upgrade log present (probably fresh install)

Zygmunt Krynicki (zyga) wrote :
Zygmunt Krynicki (zyga) wrote :

This patch fixes this bug

The attachment "0.13-2-to-0.13-3.debdiff" of this bug report has been identified as being a patch in the form of a debdiff. The ubuntu-sponsors team has been subscribed to the bug report so that they can review and hopefully sponsor the debdiff. In the event that this is in fact not a patch you can resolve this situation by removing the tag 'patch' from the bug report and editing the attachment so that it is not flagged as a patch. Additionally, if you are member of the ubuntu-sponsors team please also unsubscribe the team from this bug report.

[This is an automated message performed by a Launchpad user owned by Brian Murray. Please contact him regarding any issues with the action taken in this bug report.]

tags: added: patch
Benjamin Drung (bdrung) on 2012-12-03
Changed in bzr-fastimport:
status: New → Confirmed
Benjamin Drung (bdrung) wrote :

Thanks for your work. I like to see your fix accepted by upstream before getting it into the archive. I marked the upstream bzr-fastimport as affected. Please resubscribe ubuntu-sponsors if upstream does not respond (in a timely manner).

The version should be 0.13.0-2ubuntu1 instead of 0.13.0-3 if you want the patch uploaded to Ubuntu. You need supply a patch against the development release (currenly raring) instead of quantal. Please follow [1] if you want the fix in quantal, too. I usually add a .patch suffix to the patch files.


Jelmer Vernooij (jelmer) wrote :

Thanks for the patch.

The reason for removing .get_ancestry() was that it scales very badly (with ancestry) and accesses all of the ancestry even when that is not necessary. In this case, I think full ancestry access can be avoided so a more optimal patch is necessary.

Changed in bzr-fastimport (Ubuntu):
status: New → Triaged
importance: Undecided → High
Changed in bzr-fastimport:
importance: Undecided → High
Benjamin Drung (bdrung) wrote :

Jelmer, is there any progress on this bug? This bug collects duplicates.

Jelmer Vernooij (jelmer) wrote :

I'm no longer involved in bzr development. FWIW I think shipping the workaround patch would make sense, as it seems nobody is stepping up to fix this bug properly.

DarkLinkXXXX (darklinkxxxx) wrote :

I agree with Jelmer. Applying a patch to get something to work how it's supposed to isn't difficult, but quite annoying.

On Sun, Nov 24, 2013 at 07:53:24PM -0000, DarkLinkXXXX wrote:
> I agree with Jelmer. Applying a patch to get something to work how it's
> supposed to isn't difficult, but quite annoying.
I think you misunderstood my reply. The only proposed patch is a
workaround, not a proper fix. It's better than being completely broken

I'll go ahead and make an upload to Debian and sync it into Ubuntu.

Note that bzr-fastimport is orphaned in Debian. If anyone might be interested in taking over its maintenance, I'd be happy to review/sponsor uploads.

Changed in bzr-fastimport (Ubuntu):
status: Triaged → In Progress
assignee: nobody → Andrew Starr-Bochicchio (andrewsomething)
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package bzr-fastimport - 0.13.0-3

bzr-fastimport (0.13.0-3) unstable; urgency=low

  * QA upload.

  [ Jelmer Vernooij ]
  * Add XS-Testsuite: autopkgtest header. Closes: #692658

  [ Zygmunt Krynicki ]
  * debian/patches/dont-use-get_ancestry.diff: Don't use deprecated
    and removed get_ancestry() method (LP: #1084749).

  [ Andrew Starr-Bochicchio ]
  * debian/patches/improve_error_message.diff: Backport upstream
    commit to print sane error when a fastimport file is incomplete
    (LP: #937972).
  * debian/control: Bump Standards-Version to 3.9.4, no changes needed.
  * debian/tests/control:
   - Add python-subunit test dependency.
   - Drop undefined "no-build-needed" feature.

 -- Andrew Starr-Bochicchio <email address hidden> Sun, 24 Nov 2013 18:01:20 -0500

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

Duplicates of this bug

Other bug subscribers