1

When I try to push to gerrit, I get this error:

Counting objects: 1276, done.
Delta compression using up to 8 threads.
Compressing objects: 100% (918/918), done.
Writing objects: 100% (1276/1276), 235.23 KiB | 0 bytes/s, done.
Total 1276 (delta 960), reused 381 (delta 262)
remote: Resolving deltas: 100% (960/960)
remote: Counting objects: 14637, done
fatal: Unpack error, check server log
error: unpack failed: error Missing tree a072ac238de0ba6d02359a4756418011f5ea7ad5
To ssh://someserver
 ! [remote rejected] branch1 -> refs/for/branch1 (n/a (unpacker error))
 ! [remote rejected] branch2 -> refs/for/branch2 (n/a (unpacker error))
 ! [remote rejected] branch3 -> refs/for/branch3 (n/a (unpacker error))
 ! [remote rejected] branch4 -> refs/for/branch4 (n/a (unpacker error))
 ! [remote rejected] branch5 -> refs/for/branch5 (n/a (unpacker error))
 ! [remote rejected] branch6 -> refs/for/branch6 (n/a (unpacker error))
error: failed to push some refs to 'ssh://someserver'

In this question, it is mentioned to use git push --no-thin, but that returns error as well:

Counting objects: 1276, done.
Delta compression using up to 8 threads.
Compressing objects: 100% (991/991), done.
Writing objects: 100% (1276/1276), 741.02 KiB | 0 bytes/s, done.
Total 1276 (delta 780), reused 330 (delta 189)
remote: Resolving deltas: 100% (780/780)
remote: Counting objects: 684, done
remote: Processing changes: refs: 6, done
To ssh://someserver/ProjectName
 ! [remote rejected] branch1 -> refs/for/branch1 (no new changes)
 ! [remote rejected] branch2 -> refs/for/branch2 (duplicate request)
 ! [remote rejected] branch3 -> refs/for/branch3 (duplicate request)
 ! [remote rejected] branch4 -> refs/for/branch4 (duplicate request)
 ! [remote rejected] branch5 -> refs/for/branch5 (duplicate request)
 ! [remote rejected] branch6 -> refs/for/branch6 (duplicate request)
error: failed to push some refs to 'ssh://someserver'

I have a big pile of commits that I need to upload.

None of the solutions in the linked question helped. What should I do? What does the hash after the missing tree error mean?

halfer
  • 19,824
  • 17
  • 99
  • 186
Tomáš Zato
  • 50,171
  • 52
  • 268
  • 778
  • I once tried a solution not mentioned in the linked question, but this solution does not always work. In the local somewhere else, `git init temp;cd temp;git fetch ;git push ssh://someserver/ProjectName :refs/for/`. – ElpieKay Aug 01 '17 at 12:42
  • It's possible (maybe likely?) that gerrit (mis?)uses shallow clones. If so, the right fix would probably be to unshallow the clone on the gerrit server—as it is, it's been left in an unusable state. – torek Aug 01 '17 at 15:00
  • @torek I'm not really sure what do you mean... – Tomáš Zato Aug 02 '17 at 10:41
  • Shallow clones deliberately leave out some objects. Git has special code to deal with shallow clones, but if you abuse that code (there are various restrictions on what you can *do* with a shallow clone), you get a broken clone that Git can no longer deal with. I don't use Gerrit but I did see something about it using shallow clones. – torek Aug 02 '17 at 14:30

0 Answers0