Issue 769: Shallow clone causes internal server error
Status:  Released
Owner: ----
Closed:  Jul 2013
Reported by surove...@google.com, Nov 3, 2010
Affected Version: 2.1.5

What steps will reproduce the problem?
1. git clone --depth 1 -b <branch> ssh://<repo>

What is the expected output? What do you see instead?

I expect to get a shallow clone of the repo, instead I get this:
fatal: internal server error
fatal: The remote end hung up unexpectedly

Please provide any additional information below.

Here is server side error log:
[2010-11-03 19:18:46,676] ERROR com.google.gerrit.sshd.BaseCommand : Internal server error (user XXXXXXXXXX account YYYYYYYYYYY) during git-upload-pack '/ZZZZZZ.git'
org.eclipse.jgit.errors.PackProtocolException: expected {0}, got {1}
        at org.eclipse.jgit.transport.UploadPack.recvWants(UploadPack.java:376)
        at org.eclipse.jgit.transport.UploadPack.service(UploadPack.java:322)
        at org.eclipse.jgit.transport.UploadPack.upload(UploadPack.java:296)
        at com.google.gerrit.sshd.commands.Upload.runImpl(Upload.java:45)
        at com.google.gerrit.sshd.AbstractGitCommand.service(AbstractGitCommand.java:104)
        at com.google.gerrit.sshd.AbstractGitCommand.access$000(AbstractGitCommand.java:34)
        at com.google.gerrit.sshd.AbstractGitCommand$1.run(AbstractGitCommand.java:69)
        at com.google.gerrit.sshd.BaseCommand$TaskThunk.run(BaseCommand.java:395)
        at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
        at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)
        at java.util.concurrent.FutureTask.run(FutureTask.java:166)
        at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$101(ScheduledThreadPoolExecutor.java:165)
        at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:266)
        at com.google.gerrit.server.git.WorkQueue$Task.run(WorkQueue.java:324)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
        at java.lang.Thread.run(Thread.java:636)




Nov 3, 2010
#1 sop@google.com
Known issue.  We're actually working on it.

http://egit.eclipse.org/r/1320
Status: Started
Labels: Component-JGit
Feb 14, 2011
#2 russell....@gmail.com
Ran into this problem today when using Capistrano in conjunction with Gerrit in trying to deploy shallow clones.
Sep 23, 2011
#3 mmarcott...@gmail.com
JGit 1.1 has just been released. It includes shallow cloning support.
http://wiki.eclipse.org/JGit/New_and_Noteworthy/1.1
Oct 27, 2011
#4 sinoje...@gmail.com
has gerrit upgraded to new JGit?
Feb 28, 2012
#5 prenau...@gmail.com
I am getting the same error with Gerrit 2.2.2.1. What are the plans for having this fix integrated?
Apr 12, 2012
#6 davidjames@chromium.org
 Issue chromium-os:29047  has been merged into this issue.
Apr 12, 2012
#7 davidjames@chromium.org
jgit 1.1 has been around for a long time now -- any reason not to upgrade?
May 1, 2012
#8 ferri...@chromium.org
Looks of it editing is restricted...

If it wasn't, I'd update this bug and block it on bug 30306 (which fixes this issue).
Jul 1, 2013
#9 docw...@gmail.com
This seems to work in 2.5.2.  Mark it closed?
Jul 8, 2013
Project Member #10 nas...@grainawi.org
(No comment was entered for this change.)
Status: Released
Labels: FixedIn-2.5