1.9->2a fetch from smart server causes "unknown object type identifier 60" in bencode

Bug #427736 reported by Martin Pool on 2009-09-11
56
This bug affects 7 people
Affects Status Importance Assigned to Milestone
Bazaar
Critical
Andrew Bennetts
2.0
Critical
Andrew Bennetts
Launchpad itself
Undecided
Unassigned

Bug Description

I'm trying to pull lp:~johnf-inodes/bzr/ppa-doc and I reproducibly get "bzr: ERROR: exceptions.ValueError: unknown object type identifier 60"

 Traceback (most recent call last):
   File "/home/mbp/bzr/trunk/bzrlib/commands.py", line 835, in exception_to_return_code
     return the_callable(*args, **kwargs)
   File "/home/mbp/bzr/trunk/bzrlib/commands.py", line 1030, in run_bzr
     ret = run(*run_argv)
   File "/home/mbp/bzr/trunk/bzrlib/commands.py", line 647, in run_argv_aliases
     return self.run(**all_cmd_args)
   File "/home/mbp/bzr/trunk/bzrlib/builtins.py", line 1017, in run
     possible_transports=possible_transports, local=local)
   File "/home/mbp/bzr/trunk/bzrlib/decorators.py", line 192, in write_locked
     result = unbound(self, *args, **kwargs)
   File "/home/mbp/bzr/trunk/bzrlib/workingtree.py", line 1611, in pull
     local=local)
   File "/home/mbp/bzr/trunk/bzrlib/decorators.py", line 192, in write_locked
     result = unbound(self, *args, **kwargs)
   File "/home/mbp/bzr/trunk/bzrlib/branch.py", line 948, in pull
     possible_transports=possible_transports, *args, **kwargs)
   File "/home/mbp/bzr/trunk/bzrlib/branch.py", line 3194, in pull
     _override_hook_target=_override_hook_target)
   File "/home/mbp/bzr/trunk/bzrlib/branch.py", line 3071, in pull
     overwrite=overwrite, graph=graph)
   File "/home/mbp/bzr/trunk/bzrlib/decorators.py", line 192, in write_locked
     result = unbound(self, *args, **kwargs)
   File "/home/mbp/bzr/trunk/bzrlib/branch.py", line 896, in update_revisions
     overwrite, graph)
   File "/home/mbp/bzr/trunk/bzrlib/branch.py", line 3014, in update_revisions
     self.target.fetch(self.source, stop_revision)
   File "/home/mbp/bzr/trunk/bzrlib/decorators.py", line 192, in write_locked
     result = unbound(self, *args, **kwargs)
   File "/home/mbp/bzr/trunk/bzrlib/branch.py", line 579, in fetch
     pb=pb)
   File "/home/mbp/bzr/trunk/bzrlib/repository.py", line 1695, in fetch
     find_ghosts=find_ghosts, fetch_spec=fetch_spec)
   File "/home/mbp/bzr/trunk/bzrlib/decorators.py", line 192, in write_locked
     result = unbound(self, *args, **kwargs)
   File "/home/mbp/bzr/trunk/bzrlib/repository.py", line 3413, in fetch
     pb=pb, find_ghosts=find_ghosts)
   File "/home/mbp/bzr/trunk/bzrlib/fetch.py", line 81, in __init__
     self.__fetch()
   File "/home/mbp/bzr/trunk/bzrlib/fetch.py", line 107, in __fetch
     self._fetch_everything_for_search(search)
   File "/home/mbp/bzr/trunk/bzrlib/fetch.py", line 135, in _fetch_everything_for_search
     stream, from_format, [])
   File "/home/mbp/bzr/trunk/bzrlib/repository.py", line 4238, in insert_stream
     return self._locked_insert_stream(stream, src_format, is_resume)
   File "/home/mbp/bzr/trunk/bzrlib/repository.py", line 4295, in _locked_insert_stream
     src_serializer)
   File "/home/mbp/bzr/trunk/bzrlib/repository.py", line 4379, in _extract_and_insert_revisions
     for record in substream:
   File "/home/mbp/bzr/trunk/bzrlib/remote.py", line 1912, in missing_parents_rev_handler
     revision = self.serialiser.read_revision_from_string(revision_bytes)
   File "/home/mbp/bzr/trunk/bzrlib/chk_serializer.py", line 104, in read_revision_from_string
     ret = bencode.bdecode(text)
   File "_bencode_pyx.pyx", line 218, in _bencode_pyx.bdecode
   File "_bencode_pyx.pyx", line 83, in _bencode_pyx.Decoder.decode
   File "_bencode_pyx.pyx", line 113, in _bencode_pyx.Decoder._decode_object
 ValueError: unknown object type identifier 60

Related branches

Martin Pool (mbp) wrote :

The bad data in question is

(Pdb) p text
'<revision committer="John Ferlito &lt;<email address hidden>&gt;" format="5" inventory_sha1="24e9bf619f7622fd6c363650eca6a3fc5d79ae51" <email address hidden>" timestamp="1251864386.509" timezone="36000">\n<message>Update versions</message>\n<parents>\n<revision_ref <email address hidden>" />\n</parents>\n<properties><property name="branch-nick">bzr.johnf</property>\n</properties>\n</revision>\n'

however the stream is meant to be in CHK forrmat:

(Pdb) p self.serialiser
<bzrlib.chk_serializer.CHKBEncodeSerializer object at 0x22b8e10>
(Pdb) p self
<bzrlib.remote.RemoteStreamSource object at 0x28bba90>

summary: - "unknown object type identifier 60" in bencode
+ "unknown object type identifier 60" in bencode pulling from pack into 2a
+ repository
Martin Pool (mbp) on 2009-09-11
Changed in bzr:
assignee: Martin Pool (mbp) → nobody

I think this bug has been fixed in bzr 1.18rc1 by John, but Launchpad is still running 1.17. Specifically John fixed some bugs where CHK repositories would generate XML inventories (and non-rich-root ones at that!) via some code paths. He fixed this as part of fixing bzr send of 2a repositories (bug 393349), I think.

So I think this will probably be fixed when Launchpad next upgrades their version of bzr.

Martin Pool (mbp) wrote :

It does look like the problem is in the server streaming, and I can branch over sftp with no problems. So I think this is solely a Launchpad bug.

summary: - "unknown object type identifier 60" in bencode pulling from pack into 2a
- repository
+ bzr1.17 on launchpad streams wrong data, causes "unknown object type
+ identifier 60" in bencode pulling from pack into 2a repository

spiv: poolie: 2.0 does blacklist that op
spiv: poolie: or rather, it will give a UnknownMethod response to that particular request because it knows the client won't be able to use the stream.

But I was actually talking about the opposite, that the client should inhibit itself from sending this request to an old server, which is apparently not happening now.

Martin Pool (mbp) wrote :

See also bug 429876 re #4.

Jonathan Lange (jml) wrote :
Jonathan Lange (jml) wrote :

Still happening with Launchpad's new rollout.

Andrew Bennetts (spiv) wrote :

Ok, there appears to be a client-side bug in RemoteStreamSource.missing_parents_rev_handler. It appears to require a cross-format fetch with a stacked branch to trigger it. I'm working on a test and fix (I'm a bit surprised the existing explicit tests for stacking + smart server + cross-format fetches aren't triggering it!).

Changed in bzr:
assignee: nobody → Andrew Bennetts (spiv)
milestone: none → 2.0.1
Andrew Bennetts (spiv) wrote :

Btw, if my analysis of the cause is correct then there are a couple of workarounds affected people can use:

 - upgrade the local (or remote) branch so that the formats match, or
 - avoid HPSS (i.e. use nosmart+, sftp, or similar URLs).

Robert Collins (lifeless) wrote :

This is critical I think.

However, Andrew was intending to say 'this should go into the 2.0 series' not ' 2.0.1 should be blocked on this, so my milestone changes were just noise, until I found out what his intent was :).

Anyhow, the metadata should be accurate now.

Changed in bzr:
importance: High → Critical
milestone: 2.0.1 → none
Andrew Bennetts (spiv) on 2009-10-02
Changed in bzr:
status: In Progress → Fix Committed
Andrew Bennetts (spiv) wrote :

The fix has been landed on lp:bzr and lp:bzr/2.0.

Changed in bzr:
status: Fix Committed → Fix Released
Andrew Bennetts (spiv) on 2009-10-06
summary: - bzr1.17 on launchpad streams wrong data, causes "unknown object type
- identifier 60" in bencode pulling from pack into 2a repository
+ 1.9->2a fetch from smart server causes "unknown object type identifier
+ 60" in bencode
Tim Penhey (thumper) wrote :

Andrew, should the be cherry picked into LP production?

Tim Penhey (thumper) on 2009-10-14
Changed in launchpad-code:
status: New → Incomplete
Andrew Bennetts (spiv) wrote :

Tim: I don't think so. It's a bug in the client, not the server, so upgrading LP production won't help affected users.

(If the puller is encountering this issue, then that might be a reason to cherrypick this fix, but IIRC the puller never does cross-format fetches.)

On Wed, 14 Oct 2009 15:04:02 Andrew Bennetts wrote:
> Tim: I don't think so. It's a bug in the client, not the server, so
> upgrading LP production won't help affected users.
>
> (If the puller is encountering this issue, then that might be a reason
> to cherrypick this fix, but IIRC the puller never does cross-format
> fetches.)

correct, if the puller notices a format change it blows it away and starts
again.

Tim Penhey (thumper) wrote :

Client side, no launchpad change needed.

Changed in launchpad-code:
status: Incomplete → Invalid
John A Meinel (jameinel) on 2009-10-14
Changed in bzr:
milestone: none → 2.0.1
John A Meinel (jameinel) on 2009-10-14
Changed in bzr:
milestone: 2.0.1 → 2.1.0b1
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers