Reputation: 91
I've been handed numerous git repos which I have created mirrors of. I'm getting following error when trying to push to gerrit for review
blake-macbook:repo blake$ git push ssh://gerrit-new/repo HEAD:refs/for/master
Counting objects: 3, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (3/3), done.
Writing objects: 100% (3/3), 359 bytes | 0 bytes/s, done.
Total 3 (delta 2), reused 0 (delta 0)
remote: Resolving deltas: 100% (2/2)
remote: Processing changes: refs: 2, done
To ssh://gerrit-new/repo
! [remote rejected] HEAD -> refs/for/master (Unable to create changes:LOCK_FAILURE)
error: failed to push some refs to 'ssh://gerrit-new/repo'
Gerrit is running as its own user. I've checked the filesystem permissions and have refreshed them just in case
chown -R gerrit.gerrit /home/gerrit/review-site
Logs are showing nothing useful
[2016-09-08 00:07:45,071] [ReceiveCommits-1] ERROR com.google.gerrit.server.git.ReceiveCommits : Command CREATE on repo:refs/changes/54/54/1 not completed: LOCK_FAILURE
[2016-09-08 00:07:45,072] [ReceiveCommits-1] ERROR com.google.gerrit.server.git.ReceiveCommits : Only 0 of 1 new change refs created in repo; aborting
I've created a group call "Project Leads", granted pretty pretty much every permission in the default All-Projects access scheme, ensured that my project inherits from All-Projects.
I've also added my test user to the Administrators group ... no dice. Same error.
weird thing is that it was working fine 5 days ago. The only thing I have done is check out a new branch, try to commit to the new branch (got the error) and now the error is present for every commit (well, everything I've attempted)
If I bypass review it pushes just fine (suboptimal workaround though)
Any help appreciated
EDIT: in case you are wondering about the ssh server/port i have it set up on ssh config file
Host gerrit-new
HostName <server>
Port 29418
User <user>
IdentityFile ~/.ssh/<priv_key.rsa>
EDIT2: also tried restart, reindex, reboot, and manually deleting the write.lock files
Upvotes: 3
Views: 6186
Reputation: 39
I just reverted the commited changes back to staging area with command git reset --soft HEAD~1
And retried . It worked for me .
Upvotes: 0
Reputation:
After our server restarted unexpectedly, gerrit's database data was lost, and the account and submission information were lost. I had to reinstall the gerrit database. When I re-establish the gerrit index, I will reproduce this error. Re-push the local branch to the remote, restart the service, then no longer report this error. Hope can help you.
Git remote remove origin
Git remote add origin ssh://[email protected]:29418/you_pro
Git push -u origin master
Upvotes: 1
Reputation: 22411
Have you already seen these following old threads?
https://groups.google.com/forum/#!topic/repo-discuss/nvUnY346y14
https://bugs.chromium.org/p/gerrit/issues/detail?id=1593
Maybe they can help you or give some ideas...
Upvotes: 0