My favorites | Sign in
Project Home Downloads Wiki Issues Source
New issue   Search
for
  Advanced search   Search tips   Subscriptions
Issue 1939: Repair corrupt gerrit
2 people starred this issue and may be notified of changes. Back to list
Status:  Invalid
Owner:  ----
Closed:  May 2013


Sign in to add a comment
 
Reported by carl.eri...@gmail.com, May 29, 2013
Affected Version:
2.5.1, 2.5.4

What steps will reproduce the problem?
1.Compress a set of projects from on gerrit server into a tar file.
2.Extract the tar file into another gerrit servers git-folder.
3.Push to code review fails for some projects with internal server error.

What is the expected output? What do you see instead?
The commit should be pushed without problem.

Please provide any additional information below.
I assume this might not be the correct way of migrating projects from one server to another. A bare clone of each project should probably have been done and placed in the git folder of the new server.

From the error_log:
ERROR com.google.gerrit.server.git.ReceiveCommits : Only 0 of 1 new change refs created in minsk/optics; aborting

Create path for the commit:
review_site/git/<project>/refs/changes/28

I've read through a couple of similar issues, and it seems quite likely that the change_id is the culprit.
https://code.google.com/p/gerrit/issues/detail?id=1593

A solution is suggested here:
https://groups.google.com/forum/?fromgroups#!topic/repo-discuss/NTRl42wL3Zw

gerrit> select max(change_id) + 1 from changes;
 MAX(CHANGE_ID) + 1
 ------------------
 1923
(1 row; 1 ms)


But I'm not sure what tables to update.

Best Regards
Carl Ericsson
May 29, 2013
#1 carl.eri...@gmail.com
There is a subfolder as well for the created path in the git folder:
Create path for the commit:
review_site/git/<project>/refs/changes/28/1928
May 30, 2013
#2 carl.eri...@gmail.com
I removed the projects from the new gerrit server. Did a bare clone of the projects copied from the old gerrit and then added the bare clones to the git folder of the new gerrit.
All is well.
May 30, 2013
Project Member #3 edwin.ke...@gmail.com
(No comment was entered for this change.)
Status: Invalid
May 19, 2015
#4 sdram...@gmail.com
Hi Carl Ericsson,

I copied the projects from one gerrit instance to another gerrit instance after that I am getting the same error message. 

Could you please tell me what are all commands I need to run to fix this issue.


May 19, 2015
#5 carl.eri...@gmail.com
Hi there!
As I recall I did a bare clone of each project instead of compressing the originals.
e.g.
1. cd into your git folder of gerrit, e.g. review_site/git
2. for each project here do step 3
3. git clone --bare ./myproject.git ~/gerrit_backup/myproject.git
4. Once step 3 is done for all projects, copy the contents of ~/gerrit_backup to the new servers git folder (review_site/git)
5. The new server will be lacking some metadata from the old server but at least it's working

I'm sorry if there are spelling/syntax error. This is of the top of my mind.
Regards
Carl
May 19, 2015
Project Member #6 edwin.ke...@gmail.com
If you are on Gerrit 2.11 use the importer plugin [1] instead of copying projects manually.

[1] https://gerrit-review.googlesource.com/Documentation/config-plugins.html#importer
May 19, 2015
#7 carl.eri...@gmail.com
Nice, I'll remember that
May 19, 2015
#8 sdram...@gmail.com
Hi Carl,

What about updating the mysql tables? please tell me about those commands as well.

Regards,
Ram
May 21, 2015
#9 carl.eri...@gmail.com
Hi, I didn't execute any SQL.
Maybe I did a revert in Hyper-V, can't quite remember. Sorry
Den 20 maj 2015 7:16 fm skrev <gerrit@googlecode.com>:
Sign in to add a comment

Powered by Google Project Hosting