schacon / hg-git

mercurial to git bridge, pushed to directly from the hg-git plugin in Hg
GNU General Public License v2.0
620 stars 71 forks source link

Checksum Mismatch #94

Closed ryppl closed 14 years ago

ryppl commented 14 years ago
$ hg push git+ssh://git@github.com/ryppl/paste.git
pushing to git+ssh://git@github.com/ryppl/paste.git
importing Hg objects into Git
creating and sending data
** unknown exception encountered, details follow
** report bug details to http://mercurial.selenic.com/bts/
** or mercurial@selenic.com
** Mercurial Distributed SCM (version 1.5)
** Extensions loaded: bookmarks, graphlog, hggit
Traceback (most recent call last):
  File "/opt/local/bin/hg", line 27, in 
    mercurial.dispatch.run()
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/mercurial/dispatch.py", line 16, in run
    sys.exit(dispatch(sys.argv[1:]))
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/mercurial/dispatch.py", line 30, in dispatch
    return _runcatch(u, args)
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/mercurial/dispatch.py", line 47, in _runcatch
    return _dispatch(ui, args)
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/mercurial/dispatch.py", line 466, in _dispatch
    return runcommand(lui, repo, cmd, fullargs, ui, options, d)
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/mercurial/dispatch.py", line 336, in runcommand
    ret = _runcommand(ui, options, cmd, d)
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/mercurial/dispatch.py", line 517, in _runcommand
    return checkargs()
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/mercurial/dispatch.py", line 471, in checkargs
    return cmdfunc()
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/mercurial/dispatch.py", line 465, in 
    d = lambda: util.checksignature(func)(ui, *args, **cmdoptions)
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/mercurial/util.py", line 401, in check
    return func(*args, **kwargs)
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/mercurial/commands.py", line 2441, in push
    r = repo.push(other, opts.get('force'), revs=revs)
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/hg_git-0.2.1-py2.6.egg/hggit/hgrepo.py", line 19, in push
    git.push(remote.path, revs, force)
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/hg_git-0.2.1-py2.6.egg/hggit/git_handler.py", line 146, in push
    changed_refs = self.upload_pack(remote, revs, force)
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/hg_git-0.2.1-py2.6.egg/hggit/git_handler.py", line 524, in upload_pack
    changed_refs = client.send_pack(path, changed, genpack)
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/dulwich-0.5.0-py2.6-macosx-10.6-x86_64.egg/dulwich/client.py", line 328, in send_pack
    return client.send_pack(path, determine_wants, generate_pack_contents)
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/dulwich-0.5.0-py2.6-macosx-10.6-x86_64.egg/dulwich/client.py", line 123, in send_pack
    raise ChecksumMismatch(sha, client_sha)
dulwich.errors.ChecksumMismatch: Checksum mismatch: Expected ?????_d??-            
ryppl commented 14 years ago

the plugin may have a bug where it corrupted its own data when a previous attempt at pushing failed because I didn't have write permission on the repo. When I re-pulled the hg repo and re-pushed to Git, everything seemed to go fine.

ryppl commented 14 years ago

Hmm, maybe not. This failure seems to be somewhat random:

$ hg clone https://daveabrahams@bitbucket.org/daveabrahams/scripttest
destination directory: scripttest
requesting all changes
adding changesets
adding manifests
adding file changes
added 16 changesets with 34 changes to 14 files
updating to branch trunk
resolving manifests
getting .hgignore
getting docs/conf.py
getting docs/index.txt
getting docs/license.txt
getting docs/modules/scripttest.txt
getting regen-docs
getting scripttest/__init__.py
getting setup.cfg
getting setup.py
getting test
getting tests/__init__.py
getting tests/a_script.py
onverting revision "/?Pmbﺴ?(?Ԁ?~?Bl
converting revision ɟ*?8?d FW??`?K???_?
converting revisionp?І?؂?bV|
                            +?
converting revision ??d?(???rEc ?R,?R
converting revision ?i?(qm?Ro?b??1<]
creating and sending data
** unknown exception encountered, details follow
** report bug details to http://mercurial.selenic.com/bts/
** or mercurial@selenic.com
** Mercurial Distributed SCM (version 1.5)
** Extensions loaded: bookmarks, graphlog, hggit
Traceback (most recent call last):
  File "/opt/local/bin/hg", line 27, in 
    mercurial.dispatch.run()
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/mercurial/dispatch.py", line 16, in run
    sys.exit(dispatch(sys.argv[1:]))
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/mercurial/dispatch.py", line 30, in dispatch
    return _runcatch(u, args)
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/mercurial/dispatch.py", line 47, in _runcatch
    return _dispatch(ui, args)
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/mercurial/dispatch.py", line 466, in _dispatch
    return runcommand(lui, repo, cmd, fullargs, ui, options, d)
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/mercurial/dispatch.py", line 336, in runcommand
    ret = _runcommand(ui, options, cmd, d)
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/mercurial/dispatch.py", line 517, in _runcommand
    return checkargs()
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/mercurial/dispatch.py", line 471, in checkargs
    return cmdfunc()
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/mercurial/dispatch.py", line 465, in 
    d = lambda: util.checksignature(func)(ui, *args, **cmdoptions)
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/mercurial/util.py", line 401, in check
    return func(*args, **kwargs)
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/mercurial/commands.py", line 2441, in push
    r = repo.push(other, opts.get('force'), revs=revs)
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/hg_git-0.2.1-py2.6.egg/hggit/hgrepo.py", line 19, in push
    git.push(remote.path, revs, force)
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/hg_git-0.2.1-py2.6.egg/hggit/git_handler.py", line 146, in push
    changed_refs = self.upload_pack(remote, revs, force)
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/hg_git-0.2.1-py2.6.egg/hggit/git_handler.py", line 524, in upload_pack
    changed_refs = client.send_pack(path, changed, genpack)
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/dulwich-0.5.0-py2.6-macosx-10.6-x86_64.egg/dulwich/client.py", line 328, in send_pack
    return client.send_pack(path, determine_wants, generate_pack_contents)
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/dulwich-0.5.0-py2.6-macosx-10.6-x86_64.egg/dulwich/client.py", line 123, in send_pack
    raise ChecksumMismatch(sha, client_sha)
dulwich.errors.ChecksumMismatch: Checksum mismatch: Expected o?֒?s?????F'?, got 0000
zreba:scripttest dave$ hg push git+ssh://git@github.com/ryppl/scripttest.git
pushing to git+ssh://git@github.com/ryppl/scripttest.git
importing Hg objects into Git
creating and sending data
zreba:scripttest dave$ 

Then, watch this:

$ cd ..
$ rm -rf scripttest
$ hg clone ssh://hg@bitbucket.org/daveabrahams/scripttest/ && cd scripttest && hg push git+ssh://git@github.com/ryppl/scripttest.git
...
$

Plenty of "converting revision ", but no error

rctay commented 14 years ago

This is a dulwich issue - this happens when the git server is v1.6.6.1-26-g38a81b4 or after; see this ticket for more.

dabrahams commented 14 years ago

Great, thanks. Dulwich dev trunk fixes it for me

dabrahams commented 14 years ago

Unfortunately, doesn't fix this issue which has the same symptoms.