fatal: The same object [hash-id] appears twice in the pack

142 views
Skip to first unread message

Thomas Freudenberg

unread,
May 10, 2012, 4:22:08 AM5/10/12
to hg-...@googlegroups.com
Hi, first of all, thanks for this pretty nice piec of tool ;-) It helps a lot!

We want to mirror the mercurial projects from http://www.tryton.org on github.

For this we are using hg-git. Poorly it works not on all projects we want to mirror from them. There are a few once which had error as here described:

Reporting mirroring one of this repos:

USING:

ubuntu 10.10
mercurial-git (0.2.3-1) Git plugin for Mercurial
mercurial (1.6.3-1) scalable distributed version control system
git (1:1.7.1-1.1ubuntu0.1) fast, scalable, distributed revision control system

STEP A: Mirror/Clone hg repository

hg clone http://hg.tryton.org/2.4/modules/account_invoice_line_standalone

STEP B: Editing .hg/hgrc

[paths]
default = http://hg.tryton.org/modules/account_invoice_line_standalone
github = git+ssh://g...@github.com/4commerce-technologies-AG/tryton_module_account_invoice_line_standalone.git

[git]
intree = 1

[extensions]
hgext.bookmarks =
git =
 
STEP C: Export hg to git

hg gexport

STEP D: Bookmark for master

hg bookmarks -r default master

STEP E: Pushing to GitHub repository

hg push github


RESULTING ERROR:

Übertrage nach git+ssh://g...@github.com/4commerce-technologies-AG/tryton_module_account_invoice_line_standalone.git
importing Hg objects into Git
creating and sending data
fatal: The same object 19eea3a57fb03718372ed16f174934052b455286 appears twice in the pack
** Unbekannter Fehler, Details folgen
** Problemdetails bitte bei http://www.selenic.com/mercurial/bts
** oder merc...@selenic.com melden
** Python 2.6.6 (r266:84292, Sep 15 2010, 15:52:39) [GCC 4.4.5]
** Mercurial Distributed SCM (version 1.6.3)
** Erweiterungen geladen: bookmarks, git
Traceback (most recent call last):
  File "/usr/bin/hg", line 27, in <module>
    mercurial.dispatch.run()
  File "/usr/lib/pymodules/python2.6/mercurial/dispatch.py", line 16, in run
    sys.exit(dispatch(sys.argv[1:]))
  File "/usr/lib/pymodules/python2.6/mercurial/dispatch.py", line 34, in dispatch
    return _runcatch(u, args)
  File "/usr/lib/pymodules/python2.6/mercurial/dispatch.py", line 54, in _runcatch
    return _dispatch(ui, args)
  File "/usr/lib/pymodules/python2.6/mercurial/dispatch.py", line 494, in _dispatch
    cmdpats, cmdoptions)
  File "/usr/lib/pymodules/python2.6/mercurial/dispatch.py", line 355, in runcommand
    ret = _runcommand(ui, options, cmd, d)
  File "/usr/lib/pymodules/python2.6/mercurial/dispatch.py", line 545, in _runcommand
    return checkargs()
  File "/usr/lib/pymodules/python2.6/mercurial/dispatch.py", line 499, in checkargs
    return cmdfunc()
  File "/usr/lib/pymodules/python2.6/mercurial/dispatch.py", line 492, in <lambda>
    d = lambda: util.checksignature(func)(ui, *args, **cmdoptions)
  File "/usr/lib/pymodules/python2.6/mercurial/util.py", line 420, in check
    return func(*args, **kwargs)
  File "/usr/lib/pymodules/python2.6/mercurial/extensions.py", line 129, in wrap
    util.checksignature(origfn), *args, **kwargs)
  File "/usr/lib/pymodules/python2.6/mercurial/util.py", line 420, in check
    return func(*args, **kwargs)
  File "/usr/lib/pymodules/python2.6/hgext/bookmarks.py", line 437, in push
    result = oldpush(ui, repo, dest, **opts)
  File "/usr/lib/pymodules/python2.6/mercurial/util.py", line 420, in check
    return func(*args, **kwargs)
  File "/usr/lib/pymodules/python2.6/mercurial/commands.py", line 2855, in push
    newbranch=opts.get('new_branch'))
  File "/usr/lib/pymodules/python2.6/hgext/git/hgrepo.py", line 20, in push
    git.push(remote.path, revs, force)
  File "/usr/lib/pymodules/python2.6/hgext/git/git_handler.py", line 148, in push
    changed_refs = self.upload_pack(remote, revs, force)
  File "/usr/lib/pymodules/python2.6/hgext/git/git_handler.py", line 546, in upload_pack
    changed_refs = client.send_pack(path, changed, genpack)
  File "/usr/lib/pymodules/python2.6/dulwich/client.py", line 181, in send_pack
    self._parse_status_report(proto)
  File "/usr/lib/pymodules/python2.6/dulwich/client.py", line 104, in _parse_status_report
    raise SendPackError(unpack)
dulwich.errors.SendPackError: unpack index-pack abnormal exit


If I run same procedure e.g. with module account_invoice instead of account_invoice_line_standalone everything works fine.



Hope you could fix this or give me a hint.

Thanks
Tom

Thomas Freudenberg

unread,
May 10, 2012, 12:02:24 PM5/10/12
to hg-...@googlegroups.com
Hi, I have tested t once more with latest hg-git (checkout from GitHub today).

Same problem, same object-id, only error message differs

I made a complete new "hg clone" and checked it.

Error-Message:

hg push github
Übertrage nach git+ssh://g...@github.com/4commerce-technologies-AG/tryton_module_account_invoice_line_standalone.git
creating and sending data
["git-receive-pack '/4commerce-technologies-AG/
tryton_module_account_invoice_line_standalone.git'"]

fatal: The same object 19eea3a57fb03718372ed16f174934052b455286 appears twice in the pack
Abbruch: git remote error: unpack index-pack abnormal exit


It would be great if you could help us, because we still need this stuff mirrored on GitHub

Thanx
Tom

Thomas Freudenberg

unread,
May 11, 2012, 3:43:04 AM5/11/12
to hg-...@googlegroups.com
AMAZING SOLUTION --- No idea why, but it works if you follow this way:

I wanted to to some debuggings of this problem and Instead pushing the gexport-ed stuff directly to GitHub, I created a local bare git repo. Just to speed my debugging up ... but ... no error anymore, it worked directly.

I mirrored this bare afterwards to GitHub and updated hgrc to GitHub again ... still working.

This is my Step-by-step:


STEP A: Mirror/Clone hg repository

hg clone http://hg.tryton.org/2.4/modules/account_invoice_line_standalone

STEP B: Creating local bare

    git init --bare account_invoice_line_standalone.git


STEP B: Editing .hg/hgrc

    local = ../tryton_module_account_invoice_line_standalone.git


    [git]
    intree = 1

    [extensions]
    hgext.bookmarks =
    git =

    
STEP C: Export hg to git objects


    hg gexport


STEP D: Bookmark for master

    hg bookmarks -r default master


STEP E: Pushing to local bare repository

    hg push local


STEP F: Mirror bare repo to GitHub (it is never used atfer this procedure, you can delete the local bare)

    git push --mirror git+ssh://g...@github.com/4commerce-technologies-AG/tryton_module_account_invoice_line_standalone.git


STEP G: Editing .hg/hgrc


    [paths]
    default = http://hg.tryton.org/modules/account_invoice_line_standalone
    github = git+ssh://g...@github.com/4commerce-technologies-AG/tryton_module_account_invoice_line_standalone.git

    [git]
    intree = 1

    [extensions]
    hgext.bookmarks =
    git =

    
STEP H: Pull hg updates and Export to git objects

    hg pull
    hg gexport


STEP I: Pushing Updates directly to GitHub repository (now it works ?!)

    hg push github



Hope that someone here can fix this, that it is not neccessary to do the loop with local bare repo, but at least it works for us in the moment

Thanks for additional help
Tom

Reply all
Reply to author
Forward
0 new messages