Monorail Project: gerrit Issues People Development process History Sign in
New issue
Advanced search Search tips
Starred by 23 users
Status: Accepted
Owner: ----



Sign in to add a comment
Cannot push repo with invalid file modes (tree modes left-padded with zeros) repo accepted by git
Reported by mikael.o...@gmail.com, May 17 2011 Back to list
Affected Version: 2.1.7-rc1

What steps will reproduce the problem?
1. push my fancy "broken" repo

What is the expected output? What do you see instead?
I expect it to work.

The commandline git client gives me this output:

Counting objects: 149884, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (34956/34956), done.
fatal: Unpack error, check server log 36.48 MiB | 7.53 MiB/s   
error: pack-objects died of signal 13
error: failed to push some refs to 'ssh://olenfalk@localhost:29418/client'

And the server error_logs are:


[2011-05-17 09:28:52,974] ERROR com.google.gerrit.sshd.BaseCommand : Internal server error (user olenfalk account 1000000) during git-receive-pack '/client'
com.google.gerrit.sshd.BaseCommand$Failure: fatal: Unpack error, check server log
	at com.google.gerrit.sshd.commands.Receive.runImpl(Receive.java:135)
	at com.google.gerrit.sshd.AbstractGitCommand.service(AbstractGitCommand.java:103)
	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:399)
	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441)
	at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
	at java.util.concurrent.FutureTask.run(FutureTask.java:138)
	at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:98)
	at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:206)
	at com.google.gerrit.server.git.WorkQueue$Task.run(WorkQueue.java:324)
	at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
	at java.lang.Thread.run(Thread.java:680)
Caused by: java.io.IOException: Unpack error on project "client":
  RefFilter: com.google.gerrit.server.git.ReceiveCommitsRefFilter@1c571cc4class com.google.gerrit.server.git.ReceiveCommitsRefFilter

	at com.google.gerrit.sshd.commands.Receive.runImpl(Receive.java:134)
	... 13 more
Caused by: org.eclipse.jgit.errors.UnpackException: Exception while parsing pack stream
	at org.eclipse.jgit.transport.ReceivePack.service(ReceivePack.java:702)
	at org.eclipse.jgit.transport.ReceivePack.receive(ReceivePack.java:600)
	at com.google.gerrit.sshd.commands.Receive.runImpl(Receive.java:90)
	... 13 more
Caused by: java.io.IOException: Invalid tree f3bcb3c55b2b061de744601d651297b3566224c6:mode starts with '0'
	at org.eclipse.jgit.transport.PackParser.verifySafeObject(PackParser.java:923)
	at org.eclipse.jgit.transport.PackParser.whole(PackParser.java:904)
	at org.eclipse.jgit.transport.PackParser.indexOneObject(PackParser.java:822)
	at org.eclipse.jgit.transport.PackParser.parse(PackParser.java:450)
	at org.eclipse.jgit.storage.file.ObjectDirectoryPackParser.parse(ObjectDirectoryPackParser.java:178)
	at org.eclipse.jgit.transport.ReceivePack.receivePack(ReceivePack.java:830)
	at org.eclipse.jgit.transport.ReceivePack.service(ReceivePack.java:664)
	... 15 more


Please provide any additional information below.

According to: http://git.661346.n2.nabble.com/Tree-with-leading-0-modes-in-1-7-0-3-td4806618.html this is ultimately caused by a bug in git (which pads file modes with leading zeros), however jgit shouldn't fail on it.

I cannot fix this in my repository because fixing the repo entails rewriting all the SHAs which is not a solution for me because we are way too many working on this repository.

 
Project Member Comment 1 by nas...@grainawi.org, May 21 2011
Labels: Component-JGit
Status: Accepted
I have the same issue, with Gerrit 2.2.2. It's a blocker for me, unfortunately.

I'm trying to push http://github.com/cdk/cdk into a Gerrit installation, with:

git push ssh://egonw@localhost:29418/cdk *:*

returning:

Counting objects: 181366, done.
Delta compression using up to 2 threads.
Compressing objects: 100% (32350/32350), done.
fatal: Unpack error, check server log 4.30 MiB | 8.54 MiB/s   
error: pack-objects died of signal 13
error: failed to push some refs to 'ssh://egonw@localhost:29418/cdk'

In the error logs I get:

[...]
Caused by: java.io.IOException: Invalid tree 00ba05c8a75c3fdd3022fd87d92694e87556acb8:mode starts with '0'
        at org.eclipse.jgit.transport.PackParser.verifySafeObject(PackParser.java:959)
        at org.eclipse.jgit.transport.PackParser.whole(PackParser.java:940)
        at org.eclipse.jgit.transport.PackParser.indexOneObject(PackParser.java:858)
        at org.eclipse.jgit.transport.PackParser.parse(PackParser.java:467)
        at org.eclipse.jgit.storage.file.ObjectDirectoryPackParser.parse(ObjectDirectoryPackParser.java:178)
        at org.eclipse.jgit.transport.ReceivePack.receivePack(ReceivePack.java:832)
        at org.eclipse.jgit.transport.ReceivePack.service(ReceivePack.java:665)
        ... 15 more

Project Member Comment 3 by bklar...@gmail.com, Feb 7 2012
As a work-around, you can put the repository on the server directly (bypassing Gerrit).  Gerrit will continue to work serving this repository and accepting changes, assuming no now commits contain 0-padded file modes.
Looks like #3 is the only solution currently but with git push -f to the mirror in my case locally and then cp to gerrit server
Comment 5 by tar...@gmail.com, Sep 11 2013
I can confirm #3 has imported my problematic project correctly.

I needed to force replication to the mirrors

ssh <gerrit_server> replication start <project>
Comment 6 by aspr...@gmail.com, Sep 27 2013
Having the same issue here with 2.6.1. The WAR described in #3 is not an option. Only the account running Gerrit can access the repo on the server.
It looks like the "git push --no-thin ..." option fixes the problem.
This option disables a network optimization made by git which hangs occasionnaly.
I meet this problem with gerrit-2.11.1.
Project Member Comment 9 by logan@google.com, Aug 17 2016
Labels: Priority-3
Sign in to add a comment