← Back to team overview

dulwich-users team mailing list archive

KeyError on fetch

 

Hi there,

I've continued to build my toy with dulwich. So far, so good. :)

I'm encountering an error from time to time, and I'm unable to
understand what's wrong.

What I'm doing is that I'm building a repository using Dulwich on one
side, and fetching a refs (using Client.fetch) on the other side in
another repository. Nothing fancy.

This is the backtrace I get once in a while:
  File "remote.py", line 125, in fetch
    return self.client.fetch(self.path, self.storage, determine_wants, self.FetchProgress)
  File "/usr/local/lib/python2.6/dist-packages/dulwich/client.py", line 211, in fetch
    commit()
  File "/usr/local/lib/python2.6/dist-packages/dulwich/object_store.py", line 475, in commit
    return self.move_in_pack(path)
  File "/usr/local/lib/python2.6/dist-packages/dulwich/object_store.py", line 431, in move_in_pack
    entries = p.sorted_entries()
  File "/usr/local/lib/python2.6/dist-packages/dulwich/pack.py", line 888, in sorted_entries
    ret = list(self.iterentries(progress=progress))
  File "/usr/local/lib/python2.6/dist-packages/dulwich/pack.py", line 878, in iterentries
    type, obj = self.resolve_object(offset, type, obj)
  File "/usr/local/lib/python2.6/dist-packages/dulwich/pack.py", line 852, in resolve_object
    base_offset, type, base_obj = get_ref(basename)
  File "/usr/local/lib/python2.6/dist-packages/dulwich/pack.py", line 824, in get_ref
    raise KeyError(sha)
KeyError: 'C\x9ag&\x1e\x15\x0f\x8e\xd7 \x10a\x9e\x8e\xab\xf5\x80f6\xf0'

When this happens, it always happens: I mean doing another fetch on the
same ref using Dulwich raises the same exception.

I noticed there's an objects/pack/tmpXXXX.pack file left in the
repository after this. I can send it if this can help. I can also send
the repositories.

I'm not sure it's a bug in dulwich. Well, it is probably, because
raising on commit with such an exception looks like a bad idea. :-)
But before reporting it, I'd like to be sure this is not a mistake on my
side that I could easily avoid doing. :)

Thanks!

-- 
Julien Danjou
❱ http://julien.danjou.info

Attachment: pgplgFK0cTnEF.pgp
Description: PGP signature


Follow ups