ValueError when trying to pull/merge from a remote repository

Bug #208418 reported by Guilherme Salgado on 2008-03-28
44
Affects Status Importance Assigned to Milestone
Bazaar
Critical
Andrew Bennetts
bzr (Ubuntu)
High
Martin Pitt
Hardy
High
Martin Pitt

Bug Description

This morning bzr was upgraded to 1.3 in my box (as I use http://ppa.launchpad.net/bzr/ubuntu). I did a bunch of operations on my own repository and they all worked fine, but when I tried to pull new revisions from a remote branch I got this:

salgado@feioso [mainline]$ bzr pull
Using saved location: bzr+ssh://...
bzr: ERROR: exceptions.ValueError: invalid literal for int() with base 10: '# Copyright 2004-2006 Canonical Ltd. All rights reserved.\n'

Traceback (most recent call last):
  File "/usr/lib/python2.5/site-packages/bzrlib/commands.py", line 834, in run_bzr_catch_errors
    return run_bzr(argv)
  File "/usr/lib/python2.5/site-packages/bzrlib/commands.py", line 790, in run_bzr
    ret = run(*run_argv)
  File "/usr/lib/python2.5/site-packages/bzrlib/commands.py", line 492, in run_argv_aliases
    return self.run(**all_cmd_args)
  File "/usr/lib/python2.5/site-packages/bzrlib/builtins.py", line 652, in run
    possible_transports=possible_transports)
  File "/usr/lib/python2.5/site-packages/bzrlib/decorators.py", line 165, in write_locked
    return unbound(self, *args, **kwargs)
  File "/usr/lib/python2.5/site-packages/bzrlib/workingtree.py", line 1570, in pull
    possible_transports=possible_transports)
  File "/usr/lib/python2.5/site-packages/bzrlib/decorators.py", line 165, in write_locked
    return unbound(self, *args, **kwargs)
  File "/usr/lib/python2.5/site-packages/bzrlib/branch.py", line 1714, in pull
    run_hooks=run_hooks)
  File "/usr/lib/python2.5/site-packages/bzrlib/decorators.py", line 165, in write_locked
    return unbound(self, *args, **kwargs)
  File "/usr/lib/python2.5/site-packages/bzrlib/branch.py", line 1513, in pull
    self.update_revisions(source, stop_revision, overwrite=overwrite)
  File "/usr/lib/python2.5/site-packages/bzrlib/decorators.py", line 165, in write_locked
    return unbound(self, *args, **kwargs)
  File "/usr/lib/python2.5/site-packages/bzrlib/branch.py", line 1465, in update_revisions
    self.fetch(other, stop_revision)
  File "/usr/lib/python2.5/site-packages/bzrlib/decorators.py", line 165, in write_locked
    return unbound(self, *args, **kwargs)
  File "/usr/lib/python2.5/site-packages/bzrlib/branch.py", line 266, in fetch
    pb=nested_pb)
  File "/usr/lib/python2.5/site-packages/bzrlib/repository.py", line 949, in fetch
    return inter.fetch(revision_id=revision_id, pb=pb, find_ghosts=find_ghosts)
  File "/usr/lib/python2.5/site-packages/bzrlib/decorators.py", line 165, in write_locked
    return unbound(self, *args, **kwargs)
  File "/usr/lib/python2.5/site-packages/bzrlib/repository.py", line 2963, in fetch
    pb=pb, find_ghosts=find_ghosts)
  File "/usr/lib/python2.5/site-packages/bzrlib/fetch.py", line 109, in __init__
    self.__fetch()
  File "/usr/lib/python2.5/site-packages/bzrlib/fetch.py", line 139, in __fetch
    self._fetch_everything_for_search(search, pp)
  File "/usr/lib/python2.5/site-packages/bzrlib/fetch.py", line 418, in _fetch_everything_for_search
    self.to_repository.insert_data_stream(data_stream)
  File "/usr/lib/python2.5/site-packages/bzrlib/repository.py", line 860, in insert_data_stream
    (format, data_list, reader_func))
  File "/usr/lib/python2.5/site-packages/bzrlib/knit.py", line 803, in insert_data_stream
    self.join(source)
  File "/usr/lib/python2.5/site-packages/bzrlib/versionedfile.py", line 421, in join
    ignore_missing)
  File "/usr/lib/python2.5/site-packages/bzrlib/knit.py", line 2704, in join
    return self._copy_texts(pb, msg, version_ids, ignore_missing)
  File "/usr/lib/python2.5/site-packages/bzrlib/knit.py", line 2683, in _copy_texts
    self.source.get_lines(version),
  File "/usr/lib/python2.5/site-packages/bzrlib/knit.py", line 1099, in get_lines
    return self.get_line_list([version_id])[0]
  File "/usr/lib/python2.5/site-packages/bzrlib/knit.py", line 1138, in get_line_list
    text_map, content_map = self._get_content_maps(version_ids)
  File "/usr/lib/python2.5/site-packages/bzrlib/knit.py", line 1179, in _get_content_maps
    copy_base_content=multiple_versions)
  File "/usr/lib/python2.5/site-packages/bzrlib/knit.py", line 308, in parse_record
    delta = self.parse_line_delta(record, version_id)
  File "/usr/lib/python2.5/site-packages/bzrlib/knit.py", line 456, in parse_line_delta
    return list(self.parse_line_delta_iter(lines, version_id))
  File "/usr/lib/python2.5/site-packages/bzrlib/knit.py", line 451, in parse_line_delta_iter
    start, end, c = [int(n) for n in header.split(',')]
ValueError: invalid literal for int() with base 10: '# Copyright 2004-2006 Canonical Ltd. All rights reserved.\n'

bzr 1.3 on python 2.5.2.final.0 (linux2)
arguments: ['/usr/bin/bzr', 'pull']
encoding: 'UTF-8', fsenc: 'UTF-8', lang: 'en_US.UTF-8'
plugins:
  difftools /home/salgado/.bazaar/plugins/difftools [0.91.0]
  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/salgado/.bazaar/plugins/loom [1.3.0dev0]
  lpreview /home/salgado/.bazaar/plugins/lpreview [unknown]
  pqm /usr/lib/python2.5/site-packages/bzrlib/plugins/pqm [1.0.0dev0]
  vimdiff /home/salgado/.bazaar/plugins/vimdiff [unknown]
*** 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.

(I got the same error when I tried to branch something from the remote repository)

After that I downgraded to bzr-1.2-1~bazaar1~hardy4 (also from ppa) and the was able to pull the new revisions just fine.

Related branches

Matt Zimmerman (mdz) wrote :

Confirmed here, nominating for Hardy and setting importance

Changed in bzr:
importance: Undecided → High
status: New → Triaged
Martin Albisetti (beuno) on 2008-04-03
Changed in bzr:
importance: Undecided → Critical
status: New → Confirmed
Martin Pitt (pitti) wrote :

Out of interest, which branch did you try to pull from? Any recipe how to reproduce this? I have used bzr 1.3 for over a week now, and I'm a heavy bzr user...

  • unnamed Edit (189 bytes, application/pgp-signature; name=signature.asc)

I was trying to pull from launchpad's mainline branch. I just upgraded
my old bzr 1.2-1~bazaar1~hardy4 (which was working fine) with hardy's
1.3 and got a similar traceback when trying to pull. IOW, I can't tell
you how to reproduce it, but I can help debugging if necessary; just let
me know.

Andy Dorman (adorman) wrote :
Download full text (4.8 KiB)

Using Ubuntu gutsy. I upgraded this morning to bzr 1.3. Have made several commits to my local/remote dev branch. When I tried to merge from a co-worker's branch (who upgraded to 1.3 late yesterday and committed with 1.3 the branch I am trying to merge from) I received a similar error shown below. I am trying to check with him to see what changes he may have made in the file that has the error....

adorman@andy-work2:~/programming/antespam/dev$ bzr merge bzr+ssh://<email address hidden>/var/arch/cdorman/antespam/development/
bzr: ERROR: exceptions.ValueError: invalid literal for int() with base 10: 'package FanMail::Controller::Signup;\n'

Traceback (most recent call last):
  File "/usr/lib/python2.5/site-packages/bzrlib/commands.py", line 834, in run_bzr_catch_errors
    return run_bzr(argv)
  File "/usr/lib/python2.5/site-packages/bzrlib/commands.py", line 790, in run_bzr
    ret = run(*run_argv)
  File "/usr/lib/python2.5/site-packages/bzrlib/commands.py", line 492, in run_argv_aliases
    return self.run(**all_cmd_args)
  File "/usr/lib/python2.5/site-packages/bzrlib/builtins.py", line 2872, in run
    location, revision, remember, possible_transports, pb)
  File "/usr/lib/python2.5/site-packages/bzrlib/builtins.py", line 2978, in _get_merger_from_branch
    other_revision_id, base_revision_id, other_branch, base_branch)
  File "/usr/lib/python2.5/site-packages/bzrlib/merge.py", line 187, in from_revision_ids
    merger.set_other_revision(other, other_branch)
  File "/usr/lib/python2.5/site-packages/bzrlib/merge.py", line 329, in set_other_revision
    self._maybe_fetch(other_branch, self.this_branch, self.other_rev_id)
  File "/usr/lib/python2.5/site-packages/bzrlib/merge.py", line 346, in _maybe_fetch
    target.fetch(source, revision_id)
  File "/usr/lib/python2.5/site-packages/bzrlib/decorators.py", line 165, in write_locked
    return unbound(self, *args, **kwargs)
  File "/usr/lib/python2.5/site-packages/bzrlib/branch.py", line 266, in fetch
    pb=nested_pb)
  File "/usr/lib/python2.5/site-packages/bzrlib/repository.py", line 949, in fetch
    return inter.fetch(revision_id=revision_id, pb=pb, find_ghosts=find_ghosts)
  File "/usr/lib/python2.5/site-packages/bzrlib/decorators.py", line 165, in write_locked
    return unbound(self, *args, **kwargs)
  File "/usr/lib/python2.5/site-packages/bzrlib/repository.py", line 2963, in fetch
    pb=pb, find_ghosts=find_ghosts)
  File "/usr/lib/python2.5/site-packages/bzrlib/fetch.py", line 109, in __init__
    self.__fetch()
  File "/usr/lib/python2.5/site-packages/bzrlib/fetch.py", line 139, in __fetch
    self._fetch_everything_for_search(search, pp)
  File "/usr/lib/python2.5/site-packages/bzrlib/fetch.py", line 418, in _fetch_everything_for_search
    self.to_repository.insert_data_stream(data_stream)
  File "/usr/lib/python2.5/site-packages/bzrlib/repository.py", line 860, in insert_data_stream
    (format, data_list, reader_func))
  File "/usr/lib/python2.5/site-packages/bzrlib/knit.py", line 803, in insert_data_stream
    self.join(source)
  File "/usr/lib/python2.5/site-packages/bzrlib/versionedfile.py", line 421, in join
    ignore_missing)
  File "/usr/lib/pyt...

Read more...

Andrew Bennetts (spiv) wrote :

Can someone try reproducing this with "sftp://" instead of "bzr+ssh://"? That wil tell us if it's a problem in the smart server or the knit format.

Also, I suspect that upgrading to packs will workaround this.

Andrew Bennetts (spiv) wrote :

I have a knit format branch of the bzr-dbus plugin that shows this behaviour.

Upgrading my branch to packs fixes the problem. And using sftp:// avoids the problem too, it seems.

Martin Pool (mbp) wrote :

Andrew says he has an example branch that reliably reproduces this.

I hit this too and using sftp did avoid the problem.

It's trying to parse the knit line delta, which should start with a line of START ',' END ',' COUNT

Martin Pool (mbp) wrote :

We're working on it.

Changed in bzr:
assignee: nobody → spiv
status: Confirmed → In Progress
Guilherme Salgado (salgado) wrote :
  • unnamed Edit (189 bytes, application/pgp-signature; name=signature.asc)

My branch: Repository tree (format: dirstate-tags)

Remote branch: Repository branch (format: pack-0.92)

Going over sftp:// works fine.

Andrew Bennetts (spiv) wrote :

Martin and I have a probable fix now. We're testing, polishing and double-checking it at the moment.

Martin Pool (mbp) wrote :
Changed in bzr:
milestone: none → 1.3.1rc1
status: In Progress → Fix Released
Andrew Bennetts (spiv) wrote :

I've submitted patch which adds a test to the list.

Matt Zimmerman (mdz) wrote :

On Thu, Apr 03, 2008 at 07:54:43PM -0000, Martin Pitt wrote:
> Out of interest, which branch did you try to pull from? Any recipe how
> to reproduce this? I have used bzr 1.3 for over a week now, and I'm a
> heavy bzr user...

For me, it was the Ubuntu Hardy seeds branch.

Do you use bzr repos?

--
 - mdz

Martin Pitt (pitti) wrote :

bzr guys, is there anything else in 1.3.1rc1, or just that bug fix? I. e. should we upgrade to 1.3.1, or just cherrypick that patch for now?

Changed in bzr:
assignee: nobody → pitti
status: Triaged → Fix Committed
Martin Pitt (pitti) wrote :

@mdz: bzr repos> not that I know of. So if you have to configure that explicitly, then no.

Andrew Bennetts (spiv) wrote :

1.3.1rc1 just adds that bug fix. (1.3.1 final will probably just add the test case to the test suite on top of that.) So, you may as well upgrade.

Launchpad Janitor (janitor) wrote :

This bug was fixed in the package bzr - 1.3.1~rc1-0ubuntu1

---------------
bzr (1.3.1~rc1-0ubuntu1) hardy; urgency=low

  * New upstream bug fix release:
    - Fix a bug causing a ValueError crash in ``parse_line_delta_iter`` when
      fetching revisions from a knit to pack repository or vice versa using
      bzr:// (including over http or ssh). (LP: #208418)
    - No other changes.

 -- Martin Pitt <email address hidden> Fri, 04 Apr 2008 15:47:27 +0200

Changed in bzr:
status: Fix Committed → Fix Released
Andy Dorman (adorman) wrote :

For me, I upgraded to use packs and that fixed the problem for me with
Ubuntu gutsy bzr 1.3.1

Thanks for everyone's excellent work on Bazaar.

--
Andy Dorman
Ironic Design, Inc.
AnteSpam.com

Robert Collins (lifeless) wrote :
  • unnamed Edit (189 bytes, application/pgp-signature; name=signature.asc)

On Fri, 2008-04-04 at 08:57 +0000, Martin Pitt wrote:
> bzr guys, is there anything else in 1.3.1rc1, or just that bug fix? I.
> e. should we upgrade to 1.3.1, or just cherrypick that patch for now?

take all of 1.3.1 - its a stable branch update.

-Rob
--
GPG key available at: <http://www.robertcollins.net/keys.txt>.

Andrew Bennetts (spiv) wrote :

The fix (and test) has landed in bzr.dev.

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