Fatal: Unpack error - check server log

427 views
Skip to first unread message

Mk

unread,
May 5, 2022, 1:24:00 AM5/5/22
to Repo and Gerrit Discussion
Hello,

I'm trying to push one of our old repository into another gerrit-3.2.3 instance, However push fails with below errors.

# git push -f --all gerrit
Enumerating objects: 2901, done.
Counting objects: 100% (2901/2901), done.
Delta compression using up to 72 threads
Compressing objects: 100% (1392/1392), done.
fatal: Unpack error, check server log
error: remote unpack failed: error zeroPaddedFilemode: object 087fbb748f50af6eac2248a445d25d666cc92c78: mode starts with '0'
To ssh://review.example.com:29428/project/test
 ! [remote rejected] master -> master (n/a (unpacker error))
 ! [remote rejected] main/proj/ELE_CHARGE -> main/proj/ELE_CHARGE (n/a (unpacker error))
 ! [remote rejected] main/proj/OOB_CHARGING -> main/proj/OOB_CHARGING (n/a (unpacker error))
 ! [remote rejected] main/proj/RES9377 -> main/proj/RES9377 (n/a (unpacker error))
 ! [remote rejected] main/proj/T8745YUM -> main/proj/T8745YUM (n/a (unpacker error))

Server side in error_log  file below message shown.

[2022-05-05T13:52:51.740+0900] [SSH git-receive-pack /project/test (gerrit-admin)] ERROR com.google.gerrit.sshd.BaseCommand : Internal server error (user gerrit-admin account 1000005) during git-receive-pack '/project/test'
com.google.gerrit.sshd.BaseCommand$Failure: fatal: Unpack error, check server log
        at com.google.gerrit.sshd.commands.Receive.runImpl(Receive.java:128)
        at com.google.gerrit.sshd.AbstractGitCommand.service(AbstractGitCommand.java:107)
        at com.google.gerrit.sshd.AbstractGitCommand.access$000(AbstractGitCommand.java:32)
        at com.google.gerrit.sshd.AbstractGitCommand$1.run(AbstractGitCommand.java:72)
        at com.google.gerrit.sshd.BaseCommand$TaskThunk.run(BaseCommand.java:469)
        at com.google.gerrit.server.logging.LoggingContextAwareRunnable.run(LoggingContextAwareRunnable.java:110)
        at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515)
        at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
        at java.base/java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:304)
        at com.google.gerrit.server.git.WorkQueue$Task.run(WorkQueue.java:610)
        at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
        at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
        at java.base/java.lang.Thread.run(Thread.java:834)
Caused by: java.io.IOException: Unpack error on project "project/test":
  AdvertiseRefsHook: org.eclipse.jgit.transport.AdvertiseRefsHookChain@1ba1bc3fclass org.eclipse.jgit.transport.AdvertiseRefsHookChain

        at com.google.gerrit.sshd.commands.Receive.runImpl(Receive.java:127)
        ... 12 more
Caused by: org.eclipse.jgit.errors.UnpackException: Exception while parsing pack stream
        at org.eclipse.jgit.transport.ReceivePack.service(ReceivePack.java:2194)
        at org.eclipse.jgit.transport.ReceivePack.receive(ReceivePack.java:2120)
        at com.google.gerrit.sshd.commands.Receive.runImpl(Receive.java:98)
        ... 12 more
Caused by: org.eclipse.jgit.errors.CorruptObjectException: zeroPaddedFilemode: object 087fbb748f50af6eac2248a445d25d666cc92c78: mode starts with '0'
        at org.eclipse.jgit.lib.ObjectChecker.report(ObjectChecker.java:722)
        at org.eclipse.jgit.lib.ObjectChecker.checkTree(ObjectChecker.java:621)
        at org.eclipse.jgit.lib.ObjectChecker.check(ObjectChecker.java:342)
        at org.eclipse.jgit.transport.PackParser.verifySafeObject(PackParser.java:1103)
        at org.eclipse.jgit.transport.PackParser.whole(PackParser.java:1071)
        at org.eclipse.jgit.transport.PackParser.indexOneObject(PackParser.java:980)
        at org.eclipse.jgit.transport.PackParser.parse(PackParser.java:535)
        at org.eclipse.jgit.internal.storage.file.ObjectDirectoryPackParser.parse(ObjectDirectoryPackParser.java:168)
        at org.eclipse.jgit.transport.ReceivePack.receivePack(ReceivePack.java:1493)
        at org.eclipse.jgit.transport.ReceivePack.receivePackAndCheckConnectivity(ReceivePack.java:1212)
        at org.eclipse.jgit.transport.ReceivePack.service(ReceivePack.java:2189)
        ... 14 more

Any workaround to solve this problem will be helpful.

Mk

unread,
May 5, 2022, 3:17:21 AM5/5/22
to Repo and Gerrit Discussion

Still something setting is missing? Some pointer would be helpful.

Matthias Sohn

unread,
May 5, 2022, 4:15:21 AM5/5/22
to Mk, Repo and Gerrit Discussion
On Thu, May 5, 2022 at 9:17 AM Mk <moha...@gmail.com> wrote:

Still something setting is missing? Some pointer would be helpful.

Please avoid top posting on this list since it makes it harder to follow a discussion thread.
Your repository contains zero-padded file modes [1].
Run "git fsck" on this repo to find out which objects have this problem.

To suppress this error without fixing it you can set the config option 
receive.fsck.zeroPaddedFilemode = ignore 
in the bare repository's config file on the gerrit server.

Or, if you can rewrite the repository, use git fast-export and git fast-import to rewrite the repository
to get rid of the source of this error.

-Matthias


-Matthias
 

Any workaround to solve this problem will be helpful.

--
--
To unsubscribe, email repo-discuss...@googlegroups.com
More info at http://groups.google.com/group/repo-discuss?hl=en

---
You received this message because you are subscribed to the Google Groups "Repo and Gerrit Discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to repo-discuss...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/repo-discuss/962ee039-6958-46d2-8e48-93a678dae1ccn%40googlegroups.com.

Mk

unread,
May 5, 2022, 5:51:26 AM5/5/22
to Repo and Gerrit Discussion
Hi Matthias,

Apologize for top posting.
I have tried to suppress this error on the gerrit server's bare repository side by running - git config receive.fsck.zeroPaddedFilemode ignore
In our gerrit server we have - git version 2.23.0. i feel above config option should suppress with loaded git version. However push didn't work was failing with same error.

So with this [1] workaround able to push the repository code successfully.


Thanks a lot for the quick support.

Matthias Sohn

unread,
May 5, 2022, 7:42:19 AM5/5/22
to Mk, Repo and Gerrit Discussion
On Thu, May 5, 2022 at 11:51 AM Mk <moha...@gmail.com> wrote:
Hi Matthias,

Apologize for top posting.

But why do you then continue to use top posting ?
 
I have tried to suppress this error on the gerrit server's bare repository side by running - git config receive.fsck.zeroPaddedFilemode ignore
In our gerrit server we have - git version 2.23.0. i feel above config option should suppress with loaded git version. However push didn't work was failing with same error.

gerrit is using jgit not git, though jgit should support this option since jgit 4.2.0.201601211800-r
 
So with this [1] workaround able to push the repository code successfully.

If you rewrote the repository using fast-export/fast-import this should fix the problem permanently
by rewriting the offending objects without zero-padding.
 

Mohan

unread,
May 7, 2022, 10:02:53 AM5/7/22
to Matthias Sohn, Repo and Gerrit Discussion
Hi Matthias,

I could not able to figure out the reason for this command - (git config receive.fsck.zeroPaddedFilemode ignore) not working inside the gerrit repository.

However, since I have rewrote the fast-export/fast-import
repository. For our build purposes we would need to have same commit history information. So I have deleted the repository and pushed directly from our gerrit server.

Is there any other workaround available to solve "ZeroPaddedFilemode" error? So that should be able to push from client side. 

I'm looking forward to hearing from you. This would help for future cases.
Reply all
Reply to author
Forward
0 new messages