git unpack error on push to gerrit

╄→гoц情女王★ 提交于 2019-11-28 03:18:51

Pushing with --no-thin argument works as a workaround for me:

git push --no-thin omnigerrit HEAD:refs/for/android-4.4

Are you using git > 1.8.4.2 ?

I found incompatibility between git 1.8.4.3+ and gerrit 2.6, because of https://github.com/git/git/commit/fbd4a7036dfa71ec89e7c441cef1ac9aaa59a315

With this enhancement, if git finds out that the tree sha1 already exists in the server, it wont send it again, but gerrit wants to search the tree sha1 associated with the commit sha1 in the uploaded pack.

It looks like I cannot reproduce it with gerrit 2.8-rc3, not with latest version of scm-manager. I would say this has been resolved in jgit, but cannot find which version yet.

NewPtone

my case

I also encounter this problem too, and this take a long time to fix this problem.

First, I notice one error info in gerrit log:

Internal server error (user newptone account 1) during git-receive-pack                           '/neutron.git' 
com.google.gerrit.sshd.BaseCommand$Failure: fatal: Unpack error,   check server log
......
... Missing unknown 613fd2557fba30aff2dbd51c3807cc57561bab08

What is 613fd2557fba30aff2dbd51c3807cc57561bab08 object?

Then I use git review -l to search all opened patchset for this project neutron:

1974  master  Add two interfaces for manipulate forwarding individually

Then I find this patchset in gerrit dashboard by searching, I click the link and it seems error:

613fd2557fba30aff2dbd51c3807cc57561bab08 cannot  found

Aha, that's the reason!

But why this object missing?

The reason is my colleague tell me neutron project will use a new repo to replace the old, I delete the the old repo but didn't close all open patchset in gerrit. The open patchset will disappear in gerrit dashboard, but it still exist in gerrit database.

how to fix it

Login in your reviewdb sql and find this record:

First, make sure this is the one we want to modify:

select * from changes where change_id=1974\G;

Then update this record:

update changes set open='N',status='A' where change_id=1974;

I just encountered this error as well.

For my scenario, I was attempting to push an amended commit where none of the files had changed since the last time the same commit was pushed. I literally had just amended the commit message for the change, and attempted to push again. No files as part of the commit changed.

My push was rejected with the same error message you posted.

It seemed that Gerrit did not like a push with no changes other than the amended commit message.

I literally made a one character change to a file, added the file, amended the commit again, and pushed, and the push succeeded.

I'm using git == 1.8.4.2

I had this problem today and tried all the suggestions. Finally the solution was very simple:

  1. Switch to another branch (e.g. develop).
  2. Pull from the remote repository
  3. Switch back to your new branch and push.

With any luck it'll work now.

I encountered this issue today and I was not using git > 1.8.4.2. I am on Gerrit 2.7.

After around 5 minutes of frustration, I decided to just switch to the local version of the branch I was trying to push to and I did a pull. After that, my pushes started working again but I do not understand why.

I just come with this issue just now,and my case is: Some one git init and push a whole new branch (that is to say,this branch is no relation with any revision in origin git in gerrit) to a git project in gerrit. I try many way but fail. In the end I am inspired by the answer of @obuseme ,follow this and fixed:

git remote add gerrit GERRIT_GIT_PROJECT_URL
git fetch gerrit
And then upload again.

I worked around this issue by re-cloning the repository, and copying my changes over from the old one.

The other solutions did not work for me, except I did not try obrienks.

I tried with git 2.6.1 as well as with JGit 4.6.1, and I use Gerrit 2.13.1.

When you get the unpack error, you might want to look for this line as well: remote: error: unable to create temporary file: No space left on device

Deleting a couple of old backup files freed up enough space to get it working again.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!