Upack Failed When Pushing For Code Review

1,878 views
Skip to first unread message

Ryan Alberts

unread,
Apr 9, 2009, 4:59:06 PM4/9/09
to Repo and Gerrit Discussion
I am stuck :(

When trying to push for code review the following error is happening?

$ git push for-code-review
Counting objects: 45, done.
Compressing objects: 100% (21/21), done.
Writing objects: 100% (23/23), 1.85 KiB, done.
Total 23 (delta 12), reused 0 (delta 0)
error: unpack failed: error Missing unknown
081628d043d22c95764c60bea4a3813f9b387c83
To ssh://cainteg@ah-git:29418/ClientArchitecture
! [remote rejected] HEAD -> refs/for/master (n/a (unpacker error))
error: failed to push some refs to 'ssh://cainteg@ah-git:29418/
ClientArchitecture'


This is my config:

[remote "origin"]
url = ssh://cainteg@ah-git/srv/git/ClientArchitecture
fetch = +refs/heads/*:refs/remotes/origin/*
[remote "for-code-review"]
url = ssh://cainteg@ah-git:29418/ClientArchitecture
push = HEAD:refs/for/master


I just don't understand what I did to mess this up?

Shawn Pearce

unread,
Apr 9, 2009, 5:36:50 PM4/9/09
to repo-d...@googlegroups.com
Initial guess is, the repository on the server was modified/repacked
behind Gerrit's back. You'll need to restart Gerrit to get it to
identify that object 081628d043d22c95764c60bea4a3813f9b387c83 is
actually present in the repository.

Its a caching error in JGit, and a known, open bug for Gerrit. You
can't push into, fetch into, or repack a repository while Gerrit is
running.

Ryan Alberts

unread,
Apr 9, 2009, 7:09:31 PM4/9/09
to Repo and Gerrit Discussion
Shawn,

I first just have to say, you are so awesome at responding! I really
appreciate the help you have given me!

Back to my issue...

So basically, I was planing (probably incorrectly) that people could
"push" straight to master *or* they could use gerrit for code review.
From the config above... they could have done...

git push origin master
or
git push for-code-review

It sounds like I can not do this :-(

Maybe I just force everyone to use the code review tool?

Again, thanks for the help!


- Ryan


On Apr 9, 4:36 pm, Shawn Pearce <s...@google.com> wrote:
> Initial guess is, the repository on the server was modified/repacked
> behind Gerrit's back.  You'll need to restart Gerrit to get it to
> identify that object 081628d043d22c95764c60bea4a3813f9b387c83 is
> actually present in the repository.
>
> Its a caching error in JGit, and a known, open bug for Gerrit.  You
> can't push into, fetch into, or repack a repository while Gerrit is
> running.
>

Shawn Pearce

unread,
Apr 9, 2009, 7:31:57 PM4/9/09
to repo-d...@googlegroups.com
Sure you can still do that.

You just need to grant Push - Update Branch access in Gerrit, and make
sure users are using the Gerrit URL, not the non-gerrit URL.

This is actually one reason why at Google we're only using Gerrit's
SSH daemon, and not give out access via any other means. It reduces
the chances that a user pushes into the repository behind Gerrit's
back.

Ryan Alberts

unread,
Apr 9, 2009, 7:54:37 PM4/9/09
to Repo and Gerrit Discussion
Shawn,

Awesome! That sounds great!

Just to be explicit (making sure I understand)...

You are saying I should change the "origin" branch to go through
gerrit which would mean to change "url = " to use the ssh port 29418?

[remote "origin"]
url = ssh://cainteg@ah-git/srv/git/ClientArchitecture <<<<<<<
Change this to "ssh://cainteg@ah-git:29418/ClientArchitecture"
fetch = +refs/heads/*:refs/remotes/origin/*
[remote "for-code-review"]
url = ssh://cainteg@ah-git:29418/ClientArchitecture
push = HEAD:refs/for/master

Am I totally out to lunch? Or is that what I need to do?
On Apr 9, 6:31 pm, Shawn Pearce <s...@google.com> wrote:
> Sure you can still do that.
>
> You just need to grant Push - Update Branch access in Gerrit, and make
> sure users are using the Gerrit URL, not the non-gerrit URL.
>
> This is actually one reason why at Google we're only using Gerrit's
> SSH daemon, and not give out access via any other means.  It reduces
> the chances that a user pushes into the repository behind Gerrit's
> back.
>

Shawn Pearce

unread,
Apr 9, 2009, 7:57:51 PM4/9/09
to repo-d...@googlegroups.com
Yes.

Ryan Alberts

unread,
Apr 9, 2009, 8:09:28 PM4/9/09
to Repo and Gerrit Discussion
Shawn,

Thank you so much! Not sure what I would have done without you!

- Ryan

On Apr 9, 6:57 pm, Shawn Pearce <s...@google.com> wrote:
> Yes.
>
Reply all
Reply to author
Forward
0 new messages